diff --git a/src/components/auth/PanelTransition.jsx b/src/components/auth/PanelTransition.jsx index 027fdd1..a72faf4 100644 --- a/src/components/auth/PanelTransition.jsx +++ b/src/components/auth/PanelTransition.jsx @@ -184,8 +184,8 @@ class PanelTransition extends Component { this.body.onFormSubmit(); }; - onFormInvalid = (errorMessage) => { - this.props.setError(errorMessage); + onFormInvalid = (errors) => { + this.props.setError(Object.values(errors).shift()); }; willEnter = (config) => this.getTransitionStyles(config); diff --git a/src/components/profile/changePassword/ChangePassword.jsx b/src/components/profile/changePassword/ChangePassword.jsx index e188a10..37ad250 100644 --- a/src/components/profile/changePassword/ChangePassword.jsx +++ b/src/components/profile/changePassword/ChangePassword.jsx @@ -14,16 +14,23 @@ export default class ChangePassword extends Component { static displayName = 'ChangePassword'; static propTypes = { + form: PropTypes.instanceOf(FormModel).isRequired, onSubmit: PropTypes.func.isRequired }; - form = new FormModel(); + static get defaultProps() { + return { + form: new FormModel() + }; + } render() { - const {form} = this; + const {form} = this.props; return ( -