Skip to content
Snippets Groups Projects
Commit 90038b6d authored by Andy's avatar Andy
Browse files

[export] - Experimentations with radio buttons.

parent bfbc63cb
No related branches found
No related tags found
No related merge requests found
import { styler } from 'polythene-core-css';
import m from 'mithril';
import { Button} from "polythene-mithril"
import { Button, RadioGroup, TextField } from 'polythene-mithril';
import EditView from '../views/editView';
import { styler } from 'polythene-core-css';
const draftStyle = [
......@@ -25,25 +24,59 @@ styler.add('eventDraft', draftStyle);
export default class eventDraft extends EditView {
constructor(vnode) {
super(vnode, 'events');
this.data = {};
}
view() {
//Submit Button
const buttonMaker = m(Button, {
label: "Submit Request",
color: "white",
//Error pop-up in case not all mandatory fields were completed
//CURRENTLY: Error triggered onclick
events: {
onclick: () => alert("You did not complete all prioritary fields!")
}
view(){
const radioButtonSelectionMode = m(RadioGroup, {
name: 'Selection Mode',
buttons: [
{
value: true,
label: 'Yes, create the project.',
},
{
value: false,
label: 'No, deny the request.',
},
],
onChange: ({ value }) => { this.data.create = value; console.log(this.data); }
});
const Comment = m(TextField, {
label: 'Comment',
required: true,
onChange: ({ value }) => this.data.comment = value,
});
// Submit Button
const buttonMaker = m(Button, {
label: 'Submit Request',
color: 'white',
// Error pop-up in case not all mandatory fields were completed
// CURRENTLY: Error triggered onclick
//if(one of the fields isn't )
events: {
onclick: () => alert('You did not complete all prioritary fields!'),
}
});
return m('div',[
m('h2', {class: "title"}, "Creating a new event:"),
m('div.footer', buttonMaker),
]);
return m('div', [
m("main", [
m('h2', { class: 'title' }, 'Creating a new event:'),
m('h3', 'Do you wish to create this event?(Admin only): '),
radioButtonSelectionMode,
Comment,
m('div.footer', buttonMaker),
]
)
]
)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment