aboutsummaryrefslogtreecommitdiff
path: root/src/components/mao-tutoring.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/mao-tutoring.js')
-rw-r--r--src/components/mao-tutoring.js27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/components/mao-tutoring.js b/src/components/mao-tutoring.js
index d55b11f..5ab3c97 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 } from '../actions/firebase.js';
+import { signIn, signOut, requestHours } from '../actions/firebase.js';
// We are lazy loading its reducer.
import firebase from '../reducers/firebase.js';
@@ -109,6 +109,12 @@ class MaoTutoring extends connect(store)(PageViewElement) {
--paper-card-background-color: #f7f7f7;
}
+ paper-button {
+ margin-left: auto;
+ margin-right: auto;
+ display: block;
+ }
+
h3 {
text-align: center;
}
@@ -220,9 +226,17 @@ class MaoTutoring extends connect(store)(PageViewElement) {
<p>How many hours of tutoring?</p>
- <paper-input id="timeField" label="Time"><span slot="suffix">(in minutes)</span></paper-input>
+ <paper-input
+ id= "timeField"
+ label= "Time"
+ type= "number"
+ value= "15"
+ step= "15"
+ max= "120">
+ <span slot="suffix">(minutes)</span>
+ </paper-input>
- <paper-input id="traineeField" label="Trainee's Name"></paper-input>
+ <paper-input id="traineeField" label="Trainee's Name" type="text"></paper-input>
<vaadin-date-picker id="dateField" placeholder="Choose Date">
</vaadin-date-picker>
@@ -290,7 +304,12 @@ class MaoTutoring extends connect(store)(PageViewElement) {
}
requestHours() {
- alert(this.shadowRoot.getElementById('dateField').value);
+ const timeHours = (this.shadowRoot.getElementById('timeField') .value)
+ /60;
+ const traineeName = this.shadowRoot.getElementById('traineeField').value;
+ const date = this.shadowRoot.getElementById('dateField') .value;
+
+ store.dispatch(requestHours(timeHours, traineeName, date));
}
}