From 2b17d5468f8f96ad041eec6a61e77f0483e003e0 Mon Sep 17 00:00:00 2001 From: Michael Foiani Date: Sat, 4 Aug 2018 23:14:31 -0400 Subject: Removed some other uneccessary fles --- src/components/counter-element.js | 66 ------------------------------------- src/components/my-icons.js | 17 ---------- src/components/shop-cart.js | 67 -------------------------------------- src/components/shop-item.js | 33 ------------------- src/components/shop-products.js | 68 --------------------------------------- 5 files changed, 251 deletions(-) delete mode 100644 src/components/counter-element.js delete mode 100644 src/components/my-icons.js delete mode 100644 src/components/shop-cart.js delete mode 100644 src/components/shop-item.js delete mode 100644 src/components/shop-products.js (limited to 'src') diff --git a/src/components/counter-element.js b/src/components/counter-element.js deleted file mode 100644 index 680c077..0000000 --- a/src/components/counter-element.js +++ /dev/null @@ -1,66 +0,0 @@ -/** -@license -Copyright (c) 2018 The Polymer Project Authors. All rights reserved. -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt -Code distributed by Google as part of the polymer project is also -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/ - -import { LitElement, html } from '@polymer/lit-element'; - -// These are the elements needed by this element. -import { plusIcon, minusIcon } from './my-icons.js'; - -// These are the shared styles needed by this element. -import { ButtonSharedStyles } from './button-shared-styles.js'; - -// This is a reusable element. It is not connected to the store. You can -// imagine that it could just as well be a third-party element that you -// got from someone else. -class CounterElement extends LitElement { - _render(props) { - return html` - ${ButtonSharedStyles} - -
-

- Clicked: ${props.clicks} times. - Value is ${props.value}. - - -

-
- `; - } - - static get properties() { return { - /* The total number of clicks you've done. */ - clicks: Number, - /* The current value of the counter. */ - value: Number - }}; - - constructor() { - super(); - this.clicks = 0; - this.value = 0; - } - - _onIncrement() { - this.value++; - this.clicks++; - this.dispatchEvent(new CustomEvent('counter-incremented')); - } - - _onDecrement() { - this.value--; - this.clicks++; - this.dispatchEvent(new CustomEvent('counter-decremented')); - } -} - -window.customElements.define('counter-element', CounterElement); diff --git a/src/components/my-icons.js b/src/components/my-icons.js deleted file mode 100644 index 76d5834..0000000 --- a/src/components/my-icons.js +++ /dev/null @@ -1,17 +0,0 @@ -/** -@license -Copyright (c) 2018 The Polymer Project Authors. All rights reserved. -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt -Code distributed by Google as part of the polymer project is also -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/ - -import { html } from '@polymer/lit-element'; - -export const menuIcon = html``; -export const addToCartIcon = html``; -export const removeFromCartIcon = html``; -export const minusIcon = html``; -export const plusIcon = html``; diff --git a/src/components/shop-cart.js b/src/components/shop-cart.js deleted file mode 100644 index 1fd7f15..0000000 --- a/src/components/shop-cart.js +++ /dev/null @@ -1,67 +0,0 @@ -/** -@license -Copyright (c) 2018 The Polymer Project Authors. All rights reserved. -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt -Code distributed by Google as part of the polymer project is also -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/ - -import { LitElement, html } from '@polymer/lit-element'; -import { connect } from 'pwa-helpers/connect-mixin.js'; - -// This element is connected to the Redux store. -import { store } from '../store.js'; - -// These are the elements needed by this element. -import { removeFromCartIcon } from './my-icons.js'; -import './shop-item.js'; - -// These are the actions needed by this element. -import { removeFromCart } from '../actions/shop.js'; - -// These are the reducers needed by this element. -import { cartItemsSelector, cartTotalSelector } from '../reducers/shop.js'; - -// These are the shared styles needed by this element. -import { ButtonSharedStyles } from './button-shared-styles.js'; - -class ShopCart extends connect(store)(LitElement) { - _render({_items, _total}) { - return html` - ${ButtonSharedStyles} - - - ${_items.map((item) => - html` -
- - -
- ` - )} - - `; - } - - static get properties() { return { - _items: Array, - _total: Number - }} - - // This is called every time something is updated in the store. - _stateChanged(state) { - this._items = cartItemsSelector(state); - this._total = cartTotalSelector(state); - } -} - -window.customElements.define('shop-cart', ShopCart); diff --git a/src/components/shop-item.js b/src/components/shop-item.js deleted file mode 100644 index 6c6dcb9..0000000 --- a/src/components/shop-item.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -@license -Copyright (c) 2018 The Polymer Project Authors. All rights reserved. -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt -Code distributed by Google as part of the polymer project is also -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/ - -import { LitElement, html } from '@polymer/lit-element'; - -// This element is *not* connected to the Redux store. -class ShopItem extends LitElement { - _render(props) { - return html` - ${props.name}: - - $${props.price} - - `; - } - - static get properties() { - return { - name: String, - amount: String, - price: String - } - } -} - -window.customElements.define('shop-item', ShopItem); diff --git a/src/components/shop-products.js b/src/components/shop-products.js deleted file mode 100644 index b5b33e2..0000000 --- a/src/components/shop-products.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -@license -Copyright (c) 2018 The Polymer Project Authors. All rights reserved. -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt -Code distributed by Google as part of the polymer project is also -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/ - -import { LitElement, html } from '@polymer/lit-element'; -import { connect } from 'pwa-helpers/connect-mixin.js'; - -// This element is connected to the Redux store. -import { store } from '../store.js'; - -// These are the elements needed by this element. -import './shop-item.js'; - -// These are the actions needed by this element. -import { getAllProducts, addToCart } from '../actions/shop.js'; - -// These are the elements needed by this element. -import { addToCartIcon } from './my-icons.js'; - -// These are the shared styles needed by this element. -import { ButtonSharedStyles } from './button-shared-styles.js'; - -class ShopProducts extends connect(store)(LitElement) { - _render({_products}) { - return html` - ${ButtonSharedStyles} - - ${Object.keys(_products).map((key) => { - const item = _products[key]; - return html` -
- - -
- ` - })} - `; - } - - static get properties() { return { - _products: Object - }} - - _firstRendered() { - store.dispatch(getAllProducts()); - } - - // This is called every time something is updated in the store. - _stateChanged(state) { - this._products = state.shop.products; - } -} - -window.customElements.define('shop-products', ShopProducts); -- cgit v1.2.3-70-g09d2