import React, { PropTypes } from 'react'; import { FormattedMessage as Message } from 'react-intl'; import Helmet from 'react-helmet'; import buttons from 'components/ui/buttons.scss'; import icons from 'components/ui/icons.scss'; import { Input, Checkbox } from 'components/ui/Form'; import BaseAuthBody from './BaseAuthBody'; import styles from './password.scss'; import messages from './Password.messages'; class Body extends BaseAuthBody { static propTypes = { ...BaseAuthBody.propTypes, login: PropTypes.func.isRequired, logout: PropTypes.func.isRequired, auth: PropTypes.shape({ error: PropTypes.string, login: PropTypes.shape({ login: PropTypes.stirng, password: PropTypes.stirng }) }) }; render() { const {user} = this.props; return (
{this.renderErrors()}
{user.avatar ? : }
{user.email || user.username}
} />
); } onFormSubmit() { this.props.login({ ...this.serialize(), login: this.props.user.email || this.props.user.username }); } onGoBack() { this.props.logout(); } } export default function Password() { var Title = () => ( // TODO: separate component for PageTitle {(msg) => {msg}} ); Title.goBack = true; return { Title, Body, Footer: () => ( ), Links: () => ( ) }; }