2016-05-14 16:56:17 +05:30
|
|
|
import React from 'react';
|
2019-12-08 00:32:00 +05:30
|
|
|
import icons from 'app/components/ui/icons.scss';
|
|
|
|
import { Input, Checkbox } from 'app/components/ui/form';
|
|
|
|
import BaseAuthBody from 'app/components/auth/BaseAuthBody';
|
|
|
|
import authStyles from 'app/components/auth/auth.scss';
|
2020-06-04 22:11:27 +05:30
|
|
|
import { defineMessages } from 'react-intl';
|
2016-05-14 16:56:17 +05:30
|
|
|
|
|
|
|
import styles from './password.scss';
|
2020-06-04 22:11:27 +05:30
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
accountPassword: 'Account password',
|
|
|
|
rememberMe: 'Remember me on this device',
|
|
|
|
});
|
2016-05-14 16:56:17 +05:30
|
|
|
|
|
|
|
export default class PasswordBody extends BaseAuthBody {
|
2020-05-24 04:38:24 +05:30
|
|
|
static displayName = 'PasswordBody';
|
|
|
|
static panelId = 'password';
|
|
|
|
static hasGoBack = true;
|
|
|
|
|
|
|
|
autoFocusField = 'password';
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { user } = this.context;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
{this.renderErrors()}
|
|
|
|
|
|
|
|
<div className={styles.miniProfile}>
|
|
|
|
<div className={styles.avatar}>
|
|
|
|
{user.avatar ? <img src={user.avatar} /> : <span className={icons.user} />}
|
|
|
|
</div>
|
|
|
|
<div className={styles.email}>{user.email || user.username}</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<Input
|
|
|
|
{...this.bindField('password')}
|
|
|
|
icon="key"
|
|
|
|
type="password"
|
|
|
|
required
|
|
|
|
placeholder={messages.accountPassword}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<div className={authStyles.checkboxInput}>
|
|
|
|
<Checkbox {...this.bindField('rememberMe')} defaultChecked label={messages.rememberMe} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2016-05-14 16:56:17 +05:30
|
|
|
}
|