Add day/evening attendance option

This commit is contained in:
2017-02-16 20:43:42 +00:00
parent c939c09991
commit e69d04f199
9 changed files with 46 additions and 3 deletions

View File

@@ -17,6 +17,7 @@ class RsvpCard extends React.Component {
password: PropTypes.string,
completed: PropTypes.boolean,
attending: PropTypes.boolean,
ceremony: PropTypes.boolean,
dietary: PropTypes.string,
starter: PropTypes.string,
main: PropTypes.string,
@@ -47,6 +48,8 @@ class RsvpCard extends React.Component {
if (prop === 'attending' && value === 'false') { return true; }
if (!this.props.person.ceremony) { return true; }
return (isOK(this.state.saveAttending) &&
isOK(this.state.saveStarter) &&
isOK(this.state.saveMain));
@@ -186,7 +189,12 @@ class RsvpCard extends React.Component {
{this.state.saveAttending === 'error' ? <MdError size={30} color="red" /> : null}
</div>
</div>
<div className={[s.rsvpDetails, this.state.detailsVisible ? s.rsvpDetailsVisible : null].join(' ')}>
<div
className={[
s.rsvpDetails,
this.state.detailsVisible && this.props.person.ceremony ? s.rsvpDetailsVisible : null,
].join(' ')}
>
<div className={s.formGroup}>
<label className={s.label} htmlFor="starter">
Starter: