import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { FormattedMessage as Message } from 'react-intl'; import Helmet from 'react-helmet'; import { Input, Button, Checkbox, Form, FormModel, } from 'app/components/ui/form'; import { BackButton } from 'app/components/profile/ProfileForm'; import styles from 'app/components/profile/profileForm.scss'; import messages from './ChangePassword.intl.json'; export default class ChangePassword extends Component { static displayName = 'ChangePassword'; static propTypes = { form: PropTypes.instanceOf(FormModel), onSubmit: PropTypes.func.isRequired, }; static get defaultProps() { return { form: new FormModel(), }; } render() { const { form } = this.props; return (
{pageTitle => (

{pageTitle}

)}


); } onFormSubmit = () => { const { form } = this.props; this.props.onSubmit(form).catch(resp => { if (resp.errors) { form.setErrors(resp.errors); } else { return Promise.reject(resp); } }); }; }