Create settings for slack/email

This commit is contained in:
2017-03-04 18:35:27 +00:00
parent e3fd086792
commit 98ed3a970f
11 changed files with 168 additions and 23 deletions

View File

@@ -2,6 +2,7 @@ import React, { PropTypes } from 'react';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import s from './Admin.css';
import Link from '../../components/Link';
import Button from '../../components/Button';
class Admin extends React.Component {
static propTypes = {
@@ -26,6 +27,10 @@ class Admin extends React.Component {
hash: PropTypes.string,
time: PropTypes.string,
}),
settings: PropTypes.shape({
slack: PropTypes.boolean,
email: PropTypes.boolean,
}),
};
render() {
@@ -54,6 +59,38 @@ class Admin extends React.Component {
))}
</ul>
</div>
<div>
<h3>Settings</h3>
<form method="post" action="/admin/settings">
<div className={s.formGroup}>
<label className={s.label} htmlFor="slack">
Send slack messages on RSVP:
</label>
<input
className={s.input}
type="checkbox"
name="slack"
defaultChecked={this.props.settings.slack}
/>
</div>
<div className={s.formGroup}>
<label className={s.label} htmlFor="email">
Send confirmation emails on RSVP:
</label>
<input
className={s.input}
type="checkbox"
name="email"
defaultChecked={this.props.settings.email}
/>
</div>
<div className={s.formGroup}>
<Button type="submit">
Save
</Button>
</div>
</form>
</div>
<div>
Build hash: <a href={`https://bitbucket.org/dan_head/wedding/commits/${this.props.build.hash}`}>{this.props.build.hash}</a>
</div>