Skip to content

Commit

Permalink
Switches inline handlers to members
Browse files Browse the repository at this point in the history
  • Loading branch information
knod committed Nov 28, 2018
1 parent bdffdd7 commit bd691bb
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/components/prompts/PredictionsWarning.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@ class PredictionsWarningComp extends Component {
}
};

clickHandlerBox1 = () => {
return this.handleChange(`checkbox1`);
};

clickHandlerBox2 = () => {
return this.handleChange(`checkbox2`);
};

cancelHandler = () => {
return this.closeModal(false);
};

acceptHandler = () => {
return this.closeModal(true);
};

render() {

const {
Expand Down Expand Up @@ -74,7 +90,7 @@ class PredictionsWarningComp extends Component {
<Checkbox
checked = { this.state.Checkbox1 }
name = { `checkbox1` }
onClick = { () => { return this.handleChange(`checkbox1`); } } />
onClick = { this.clickHandlerBox1 } />
</Form.Field>
<Form.Field>{ translations.i_checkboxLabel1 }</Form.Field>
</div>
Expand All @@ -86,19 +102,19 @@ class PredictionsWarningComp extends Component {
<Checkbox
checked = { this.state.Checkbox2 }
name = { `checkbox2` }
onClick = { () => { return this.handleChange(`checkbox2`); } } />
onClick = { this.clickHandlerBox2 } />
</Form.Field>
<Form.Field>{ translations.i_checkboxLabel2 }</Form.Field>
</div>

</Modal.Content>
<Modal.Actions>
<Button onClick={ () => { return this.closeModal(false); } }>
<Button onClick={ this.cancelHandler }>
{ translations.i_buttonCancel }
</Button>
<Button
disabled = { !this.allowContinue() }
onClick = { () => { return this.closeModal(true); } }
onClick = { this.acceptHandler }
color = { `teal` }>
{ translations.i_buttonAcceptWarning }
</Button>
Expand Down

0 comments on commit bd691bb

Please sign in to comment.