diff --git a/app/components/DeclarationQuestions.js b/app/components/DeclarationQuestions.js index c32e8e054f24ac3fcf5ff2f8a3dcdca3b952eedd..1a3a7b0bac8159448a46390fc02f3772f5083a9e 100644 --- a/app/components/DeclarationQuestions.js +++ b/app/components/DeclarationQuestions.js @@ -36,12 +36,9 @@ class DeclarationQuestions extends React.Component { this.setState({ declarations }) } - changed = (declarations) => { + onChange = (declarations) => { this.setState({ declarations }) - } - - save = () => { - this.props.save(this.state.declarations) + // TODO: save changed declarations automatically? } autoresize = name => () => { @@ -54,15 +51,16 @@ class DeclarationQuestions extends React.Component { render () { const { declarations = {} } = this.state + const { save } = this.props // TODO: only display "submit" once declarations are complete return ( <div className="questions questions-reset content-metadata"> <FRC.Form - onSubmit={this.save} + onSubmit={save} validateOnSubmit={true} - onChange={this.changed} + onChange={this.onChange} layout="vertical"> <div className="question-section"> <div className="question-section-heading">PART I - Questions about ethics</div>