Внедрена зависимость от router для компонента RulesPage

Добавлен тайтл для страницы правил
Проброшена ссылка на пункт правил для предупреждения о нике на странице профиля
This commit is contained in:
ErickSkrauch
2016-06-01 12:12:41 +03:00
parent d9309662f2
commit 9c7073a422
7 changed files with 60 additions and 16 deletions

View File

@@ -3,7 +3,8 @@
"personalData": "Personal data",
"accountDescription": "Ely.by account allows you to get access to many Minecraft resources. Please, take care of your account safety. Use secure password and change it regularly.",
"preferencesDescription": "Here you can change the key preferences of your account. Please note that all actions must be confirmed by entering a password.",
"mojangPriorityWarning": "A Mojang account with the same nickname was found. According to project rules, account owner has the right to demand the restoration of control over nickname.",
"mojangPriorityWarning": "A Mojang account with the same nickname was found. According to {rules}, account owner has the right to demand the restoration of control over nickname.",
"projectRules": "project rules",
"oldHashingAlgoWarning": "Your was hashed with an old hashing algorithm.<br />Please, change password.",
"changedAt": "Changed {at}",
"disabled": "Disabled",

View File

@@ -1,6 +1,7 @@
import React, { Component } from 'react';
import { FormattedMessage as Message, FormattedRelative as Relative, FormattedHTMLMessage as HTMLMessage } from 'react-intl';
import { Link } from 'react-router';
import Helmet from 'react-helmet';
import { userShape } from 'components/user/User';
@@ -12,6 +13,8 @@ import styles from './profile.scss';
import profileForm from './profileForm.scss';
import messages from './Profile.intl.json';
import RulesPage from 'pages/rules/RulesPage';
export default class Profile extends Component {
static displayName = 'Profile';
static propTypes = {
@@ -55,7 +58,16 @@ export default class Profile extends Component {
label={<Message {...messages.nickname} />}
value={user.username}
warningMessage={user.hasMojangUsernameCollision ? (
<Message {...messages.mojangPriorityWarning} />
<Message {...messages.mojangPriorityWarning} values={{
rules: (
<Link to={{
pathname: '/rules',
hash: `#${RulesPage.getRuleHash(1, 4)}`
}}>
<Message {...messages.projectRules} />
</Link>
)
}} />
) : ''}
/>

View File

@@ -95,6 +95,16 @@ $formColumnWidth: 416px;
color: $red;
font-size: 11px;
line-height: 1.2;
a {
color: $red;
border-bottom: 1px dashed transparent;
transition: .25s;
&:hover {
border-bottom-color: lighter($red);
}
}
}
.uuid {