diff --git a/src/components/Shared/ValidationErrorsInfoDialog.js b/src/components/Shared/ValidationErrorsInfoDialog.js index f0efe0c..262092f 100644 --- a/src/components/Shared/ValidationErrorsInfoDialog.js +++ b/src/components/Shared/ValidationErrorsInfoDialog.js @@ -3,60 +3,57 @@ import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; export class ValidationErrorsInfoDialog extends React.Component { - constructor(props) { - super(props) - this.props = props; - this.state = { + + state = { open: this.props.open, } + + componentWillReceiveProps(newProps){ + this.setState({open: newProps.open}); + } + + handleOpen = () => { + this.setState({ open: true }); + }; + + handleClose = () => { + this.setState({ open: false }); + this.props.onDismiss(); + }; + + render() { + + const actions = [ + , + ]; + + return ( +
+ + {this.props.errorMessages.map(errorMessage => { + return ( +
+ {errorMessage.message} +
+
+ ); + })} +
+
+ ); + } } - componentWillReceiveProps(newProps) { - this.setState({ open: newProps.open }); - } - - handleOpen = () => { - this.setState({ open: true }); - }; - - handleClose = () => { - this.setState({ open: false }); - this.props.onDismiss(); - }; - - render() { - - const actions = [ - , - ]; - - return ( -
- - {this.props.errorMessages.map(errorMessage => { - return ( -
- {errorMessage.message} -
-
- ); - })} -
-
- ); - } -} - -module.exports = ValidationErrorsInfoDialog; \ No newline at end of file + module.exports = ValidationErrorsInfoDialog;