From e15bc36fbbaa48d84803e4034fe2d02571cd30c0 Mon Sep 17 00:00:00 2001 From: Michael Foiani Date: Mon, 30 Jul 2018 12:35:36 -0400 Subject: Created fourm page and itnegrated it. Also, --- src/actions/app.js | 3 + src/components/mao-app.js | 4 ++ src/components/mao-fourms.js | 146 +++++++++++++++++++++++++++++++++++++++++ src/components/mao-tutoring.js | 2 +- 4 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 src/components/mao-fourms.js (limited to 'src') diff --git a/src/actions/app.js b/src/actions/app.js index d58c7ff..3a5f9fb 100644 --- a/src/actions/app.js +++ b/src/actions/app.js @@ -40,6 +40,9 @@ const loadPage = (page) => (dispatch) => { case 'tutor': import('../components/mao-tutoring.js'); break; + case 'fourms': + import('../components/mao-fourms.js'); + break; case 'account': import('../components/mao-account.js'); break; diff --git a/src/components/mao-app.js b/src/components/mao-app.js index f1c0c57..5a02542 100644 --- a/src/components/mao-app.js +++ b/src/components/mao-app.js @@ -198,6 +198,7 @@ class MaoApp extends connect(store)(LitElement) { Home Tutoring Compete + Fourms Account @@ -209,6 +210,8 @@ class MaoApp extends connect(store)(LitElement) { Home Tutoring Compete + Compete + Fourms Account @@ -219,6 +222,7 @@ class MaoApp extends connect(store)(LitElement) { + diff --git a/src/components/mao-fourms.js b/src/components/mao-fourms.js new file mode 100644 index 0000000..c0fd509 --- /dev/null +++ b/src/components/mao-fourms.js @@ -0,0 +1,146 @@ +/** +@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'; +import { PageViewElement } from './page-view-element.js'; +import { connect } from 'pwa-helpers/connect-mixin.js'; + +// This element is connected to the Redux store. +import { store } from '../store.js'; + +//These are the actions needed by this element. +import { requestHours } from '../actions/firebase.js'; + +// We are lazy loading its reducer. +import firebase from '../reducers/firebase.js'; + +store.addReducers({ + firebase +}); + +// These are the shared styles needed by this element. +import { SharedStyles } from './shared-styles.js'; +import { ButtonSharedStyles } from './button-shared-styles.js' + +// Import paper elements +import '@polymer/paper-input/paper-input.js'; +import '@polymer/paper-card/paper-card.js'; +import '@polymer/paper-dropdown-menu/paper-dropdown-menu.js'; +import '@polymer/paper-item/paper-item.js'; +import '@polymer/paper-slider/paper-slider.js'; +import '@polymer/paper-button/paper-button.js'; + +// Import other customElements +import '@vaadin/vaadin-date-picker/vaadin-date-picker.js'; + +class MaoFourms extends connect(store)(PageViewElement) { + _render(props) { + return html` + ${SharedStyles} + ${ButtonSharedStyles} + + + +
+
+ `; + } + + static get properties() { return { + // This is the data from the store. + signedIn: Boolean, + authMessage: String, + hours: Number, + requestedHours: Number + }} + + _stateChanged(state) { + this.hours = state.firebase.hours; + this.requestedHours = state.firebase.requestedHours; + this.signedIn = state.firebase.initialized; + this.authMessage = state.firebase.authMessage; + + this.sumbitFieldsOpened = false; + } + +} + +window.customElements.define('mao-fourms', MaoFourms); diff --git a/src/components/mao-tutoring.js b/src/components/mao-tutoring.js index 04b7b1d..e325f36 100644 --- a/src/components/mao-tutoring.js +++ b/src/components/mao-tutoring.js @@ -16,7 +16,7 @@ import { connect } from 'pwa-helpers/connect-mixin.js'; import { store } from '../store.js'; //These are the actions needed by this element. -import { signIn, signOut, requestHours } from '../actions/firebase.js'; +import { requestHours } from '../actions/firebase.js'; // We are lazy loading its reducer. import firebase from '../reducers/firebase.js'; -- cgit v1.2.3-70-g09d2