aboutsummaryrefslogtreecommitdiff
path: root/src/components/mao-admin.js
diff options
context:
space:
mode:
authorMichael Foiani <mfoiani2019@communiyschoolnaples.org>2018-08-01 18:00:17 -0400
committerMichael Foiani <mfoiani2019@communiyschoolnaples.org>2018-08-01 18:00:17 -0400
commit80b238f5e9f0c84abcb2753c569bb732c05739b0 (patch)
tree96d154ac834c8253f0fe9345a50a4bd19046532b /src/components/mao-admin.js
parent7d9b4f6cc3b731f0cdd385bce9564b6dc3b53c53 (diff)
Working on creating admin page. Having issues with keeping the page hidden in the toolbar.
Diffstat (limited to 'src/components/mao-admin.js')
-rw-r--r--src/components/mao-admin.js72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/components/mao-admin.js b/src/components/mao-admin.js
new file mode 100644
index 0000000..8cc93ca
--- /dev/null
+++ b/src/components/mao-admin.js
@@ -0,0 +1,72 @@
+/**
+@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 {} 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-slider/paper-slider.js';
+import '@polymer/paper-button/paper-button.js';
+
+class MaoAdmin extends connect(store)(PageViewElement) {
+ _render(props) {
+ return html`
+ ${SharedStyles}
+ ${ButtonSharedStyles}
+
+ <style>
+
+ </style>
+
+
+
+ <section hidden="${!props.isAdmin}">
+
+ Admin Stuff
+
+ </section>
+ `;
+ }
+
+ static get properties() { return {
+ // This is the data from the store.
+ signedIn: Boolean,
+ isAdmin: Boolean
+ }}
+
+ _stateChanged(state) {
+ this.signedIn = state.firebase.initialized;
+ this.isAdmin = state.firebase.isAdmin;
+ }
+
+
+}
+
+window.customElements.define('mao-admin', MaoAdmin);