import React from 'react'; import { defineMessages, FormattedMessage as Message } from 'react-intl'; import { Helmet } from 'react-helmet-async'; import { Input, Button, Checkbox, Form, FormModel } from 'app/components/ui/form'; import { BackButton } from '../ProfileForm'; import styles from '../profileForm.scss'; const labels = defineMessages({ changePasswordButton: 'Change password', newPasswordLabel: 'New password:', repeatNewPasswordLabel: 'Repeat the password:', logoutOnAllDevices: 'Logout on all devices', }); interface Props { form: FormModel; onSubmit: (form: FormModel) => Promise; } export default class ChangePassword extends React.Component { static get defaultProps(): Partial { 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); } }); }; }