From 936bbaa65fcb34c415991af95984b6b174f974b8 Mon Sep 17 00:00:00 2001 From: Michael Foiani Date: Mon, 30 Jul 2018 19:29:41 -0400 Subject: Added some icons to tutoring page and fixed bug with empty textbox fields. --- src/components/mao-fourms.js | 26 ++++++++++++++++++-------- src/components/mao-tutoring.js | 29 ++++++++++++++++++++++++----- 2 files changed, 42 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/components/mao-fourms.js b/src/components/mao-fourms.js index e7398b5..cb7095b 100644 --- a/src/components/mao-fourms.js +++ b/src/components/mao-fourms.js @@ -132,7 +132,7 @@ class MaoFourms extends connect(store)(PageViewElement) { }} _stateChanged(state) { - this.signedIn = state.firebase.signedIn; + this.signedIn = state.firebase.initialized; this.authMessage = state.firebase.authMessage; this.fourmPosts = state.firebase.fourmPosts; @@ -140,17 +140,27 @@ class MaoFourms extends connect(store)(PageViewElement) { } submitFourm() { - if( this.shadowRoot && - confirm('Are you sure you want to submit this to the fourm page? It will be public to everyone.') - ) - { + if(this.shadowRoot) { var subjectElement = this.shadowRoot.getElementById('subject-field'); var contentElement = this.shadowRoot.getElementById('content-field'); - store.dispatch(createFourmPost(subjectElement.value, contentElement.value)); + if(!contentElement.value) { + contentElement.value = ""; + } - subjectElement.value = ""; - contentElement.value = ""; + if( subjectElement.value.trim() === "" || + contentElement.value.trim() === "" + ) + { + alert("Please fill out all fields when creating a form post."); + } else { + if(confirm('Are you sure you want to submit this to the fourm page? It will be public to everyone.')) { + store.dispatch(createFourmPost(subjectElement.value, contentElement.value)); + + subjectElement.value = ""; + contentElement.value = ""; + } + } } } diff --git a/src/components/mao-tutoring.js b/src/components/mao-tutoring.js index cf769cd..ed44b8f 100644 --- a/src/components/mao-tutoring.js +++ b/src/components/mao-tutoring.js @@ -29,10 +29,15 @@ store.addReducers({ import { SharedStyles } from './shared-styles.js'; import { ButtonSharedStyles } from './button-shared-styles.js'; +// Import iron-icon +import '@polymer/iron-icons/communication-icons.js'; + // Import paper elements import '@polymer/paper-input/paper-input.js'; import '@polymer/paper-card/paper-card.js'; import '@polymer/paper-item/paper-item.js'; +import '@polymer/paper-item/paper-icon-item.js'; +import '@polymer/paper-icon-button/paper-icon-button.js'; import '@polymer/paper-slider/paper-slider.js'; import '@polymer/paper-button/paper-button.js'; @@ -91,7 +96,11 @@ class MaoTutoring extends connect(store)(PageViewElement) { } .hopeCard { - --paper-card-background-color: #b7e1cd; + --paper-card-background-color: #58d68d; + } + + paper-item { + display: block; } paper-button { @@ -108,6 +117,11 @@ class MaoTutoring extends connect(store)(PageViewElement) { margin-top: 10px; } + .paper-item-link { + color: inherit; + text-decoration: none; + } + .tutoring-grid { display: grid; grid-gap: 10px; @@ -231,17 +245,22 @@ class MaoTutoring extends connect(store)(PageViewElement) {

Need Help Finiding A Tutor?

-

Please, meet with your friends to create tutring sessions. - Otherwise, contact our tutoring coordinator Mike Binkowski.

+

Please, meet with your friends to create tutring sessions.

+

Otherwise, contact our tutoring coordinator Mike Binkowski.

-- cgit v1.2.3-70-g09d2