2016-03-17 11:31:11 +05:30
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
2016-03-20 14:00:58 +05:30
|
|
|
import { FormattedMessage as Message, FormattedRelative as Relative, FormattedHTMLMessage as HTMLMessage } from 'react-intl';
|
2016-03-17 11:31:11 +05:30
|
|
|
import Helmet from 'react-helmet';
|
|
|
|
|
|
|
|
import { userShape } from 'components/user/User';
|
|
|
|
|
|
|
|
import ProfileField from './ProfileField';
|
|
|
|
import styles from './profile.scss';
|
2016-04-17 15:05:04 +05:30
|
|
|
import profileForm from './profileForm.scss';
|
2016-03-20 14:00:58 +05:30
|
|
|
import messages from './Profile.messages';
|
2016-03-17 11:31:11 +05:30
|
|
|
|
2016-04-17 15:05:04 +05:30
|
|
|
export default class Profile extends Component {
|
2016-03-17 11:31:11 +05:30
|
|
|
static displayName = 'Profile';
|
|
|
|
static propTypes = {
|
|
|
|
user: userShape
|
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { user } = this.props;
|
|
|
|
|
|
|
|
return (
|
2016-04-17 15:05:04 +05:30
|
|
|
<div>
|
2016-03-20 14:00:58 +05:30
|
|
|
<Message {...messages.accountPreferencesTitle}>
|
|
|
|
{(pageTitle) => (
|
2016-04-17 15:05:04 +05:30
|
|
|
<h2 className={styles.indexTitle}>
|
2016-03-20 14:00:58 +05:30
|
|
|
<Helmet title={pageTitle} />
|
|
|
|
{pageTitle}
|
|
|
|
</h2>
|
|
|
|
)}
|
|
|
|
</Message>
|
2016-03-17 11:31:11 +05:30
|
|
|
|
2016-04-17 15:05:04 +05:30
|
|
|
<div className={styles.indexContent}>
|
|
|
|
<div className={styles.descriptionColumn}>
|
|
|
|
<div className={styles.indexDescription}>
|
|
|
|
<Message {...messages.accountDescription} />
|
|
|
|
</div>
|
2016-03-17 11:31:11 +05:30
|
|
|
</div>
|
|
|
|
|
2016-04-17 15:05:04 +05:30
|
|
|
<div className={styles.formColumn}>
|
|
|
|
<div className={profileForm.form}>
|
|
|
|
<div className={styles.item}>
|
|
|
|
<h3 className={profileForm.title}>
|
|
|
|
<Message {...messages.personalData} />
|
|
|
|
</h3>
|
|
|
|
<p className={profileForm.description}>
|
|
|
|
<Message {...messages.preferencesDescription} />
|
|
|
|
</p>
|
|
|
|
</div>
|
2016-03-17 11:31:11 +05:30
|
|
|
|
2016-04-17 15:05:04 +05:30
|
|
|
<ProfileField
|
2016-05-02 18:43:18 +05:30
|
|
|
link="/profile/change-username"
|
2016-04-17 15:05:04 +05:30
|
|
|
label={<Message {...messages.nickname} />}
|
|
|
|
value={user.username}
|
2016-04-24 00:14:10 +05:30
|
|
|
warningMessage={user.hasMojangUsernameCollision ? (
|
|
|
|
<Message {...messages.mojangPriorityWarning} />
|
|
|
|
) : ''}
|
2016-04-17 15:05:04 +05:30
|
|
|
/>
|
2016-03-17 11:31:11 +05:30
|
|
|
|
2016-04-17 15:05:04 +05:30
|
|
|
<ProfileField
|
|
|
|
label={'E-mail'}
|
|
|
|
value={user.email}
|
|
|
|
/>
|
2016-03-17 11:31:11 +05:30
|
|
|
|
2016-04-17 15:05:04 +05:30
|
|
|
<ProfileField
|
|
|
|
link="/profile/change-password"
|
2016-05-02 18:43:18 +05:30
|
|
|
label={<Message {...messages.password} />}
|
2016-04-17 15:05:04 +05:30
|
|
|
value={<Message {...messages.changedAt} values={{
|
|
|
|
at: (<Relative value={user.passwordChangedAt * 1000} />)
|
|
|
|
}} />}
|
|
|
|
warningMessage={user.shouldChangePassword ? (
|
|
|
|
<HTMLMessage {...messages.oldHashingAlgoWarning} />
|
|
|
|
) : ''}
|
|
|
|
/>
|
2016-03-17 11:31:11 +05:30
|
|
|
|
2016-04-17 15:05:04 +05:30
|
|
|
<ProfileField
|
|
|
|
label={<Message {...messages.twoFactorAuth} />}
|
|
|
|
value={<Message {...messages.disabled} />}
|
|
|
|
/>
|
2016-03-17 11:31:11 +05:30
|
|
|
|
2016-04-17 15:05:04 +05:30
|
|
|
<ProfileField
|
|
|
|
label={'UUID'}
|
|
|
|
value={user.uuid}
|
|
|
|
readonly
|
|
|
|
/>
|
|
|
|
</div>
|
2016-03-17 11:31:11 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|