2016-05-31 15:00:41 +05:30
|
|
|
import React, { Component, PropTypes } from 'react';
|
2016-05-22 21:26:52 +05:30
|
|
|
|
2016-05-23 23:22:05 +05:30
|
|
|
import { Link } from 'react-router';
|
2016-05-26 15:53:58 +05:30
|
|
|
import { FormattedMessage as Message } from 'react-intl';
|
2016-05-23 23:22:05 +05:30
|
|
|
|
|
|
|
import { FooterMenu } from 'components/footerMenu';
|
|
|
|
|
2016-05-22 21:26:52 +05:30
|
|
|
import styles from './rules.scss';
|
|
|
|
|
2016-05-26 15:53:58 +05:30
|
|
|
import messages from './RulesPage.intl.json';
|
|
|
|
import appInfo from 'components/auth/appInfo/AppInfo.intl.json';
|
|
|
|
|
|
|
|
const projectName = <Message {...appInfo.appName} />;
|
|
|
|
|
2016-05-31 15:00:41 +05:30
|
|
|
import classNames from 'classnames';
|
|
|
|
|
2016-05-22 21:26:52 +05:30
|
|
|
const rules = [
|
|
|
|
{
|
2016-05-26 15:53:58 +05:30
|
|
|
title: <Message {...messages.mainProvisions} />,
|
2016-05-22 21:26:52 +05:30
|
|
|
items: [
|
2016-05-31 15:00:41 +05:30
|
|
|
<Message {...messages.mainProvision1} values={{
|
2016-05-26 15:53:58 +05:30
|
|
|
name: (<b>{projectName}</b>)
|
2016-05-31 15:00:41 +05:30
|
|
|
}} />,
|
|
|
|
<Message {...messages.mainProvision2} />,
|
|
|
|
<Message {...messages.mainProvision3} />,
|
|
|
|
<Message {...messages.mainProvision4} values={{
|
2016-05-26 15:53:58 +05:30
|
|
|
link: (<Link to={'/register'}>https://account.ely.by/register</Link>)
|
2016-05-31 15:00:41 +05:30
|
|
|
}} />
|
2016-05-22 21:26:52 +05:30
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2016-05-26 15:53:58 +05:30
|
|
|
title: <Message {...messages.emailAndNickname} />,
|
2016-05-22 21:26:52 +05:30
|
|
|
items: [
|
2016-05-31 15:00:41 +05:30
|
|
|
<Message {...messages.emailAndNickname1} />,
|
|
|
|
<Message {...messages.emailAndNickname2} />,
|
|
|
|
<Message {...messages.emailAndNickname3} />,
|
|
|
|
<Message {...messages.emailAndNickname4} />,
|
|
|
|
<Message {...messages.emailAndNickname5} />,
|
|
|
|
<Message {...messages.emailAndNickname6} />,
|
|
|
|
<Message {...messages.emailAndNickname7} />
|
2016-05-22 21:26:52 +05:30
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2016-05-26 15:53:58 +05:30
|
|
|
title: <Message {...messages.elyAccountsAsService} values={{
|
|
|
|
name: projectName
|
|
|
|
}} />,
|
2016-05-23 23:22:05 +05:30
|
|
|
description: (<div>
|
2016-05-26 15:53:58 +05:30
|
|
|
<p><Message {...messages.elyAccountsAsServiceDesc1} values={{
|
|
|
|
name: (<b>{projectName}</b>)
|
|
|
|
}} /></p>
|
|
|
|
<p><Message {...messages.elyAccountsAsServiceDesc2} /></p>
|
2016-05-23 23:22:05 +05:30
|
|
|
</div>),
|
2016-05-22 21:26:52 +05:30
|
|
|
items: [
|
2016-05-31 15:00:41 +05:30
|
|
|
<Message {...messages.elyAccountsAsService1} />,
|
|
|
|
<Message {...messages.elyAccountsAsService2} />
|
2016-05-22 21:26:52 +05:30
|
|
|
]
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2016-05-31 15:00:41 +05:30
|
|
|
export default class RulesPage extends Component {
|
|
|
|
static propTypes = {
|
|
|
|
location: PropTypes.shape({
|
|
|
|
hash: PropTypes.string
|
|
|
|
})
|
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
|
|
let {hash} = this.props.location;
|
|
|
|
if (hash) {
|
|
|
|
hash = hash.substring(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div className={styles.rules}>
|
|
|
|
{rules.map((block, sectionIndex) => (
|
|
|
|
<div className={styles.rulesSection} key={sectionIndex}>
|
|
|
|
<h2
|
|
|
|
className={classNames(styles.rulesSectionTitle, {
|
|
|
|
[styles.target]: this.getTitleHash(sectionIndex) === hash
|
|
|
|
})}
|
|
|
|
id={this.getTitleHash(sectionIndex)}
|
|
|
|
>
|
|
|
|
{block.title}
|
|
|
|
</h2>
|
2016-05-22 21:26:52 +05:30
|
|
|
|
2016-05-31 15:00:41 +05:30
|
|
|
<div className={styles.rulesBody}>
|
|
|
|
{block.description ? (
|
|
|
|
<div className={styles.blockDescription}>
|
|
|
|
{block.description}
|
|
|
|
</div>
|
|
|
|
) : ''}
|
|
|
|
<ol className={styles.rulesList}>
|
|
|
|
{block.items.map((item, ruleIndex) => (
|
|
|
|
<li
|
|
|
|
className={classNames(styles.rulesItem, {
|
|
|
|
[styles.target]: this.getRuleHash(sectionIndex, ruleIndex) === hash
|
|
|
|
})}
|
|
|
|
key={ruleIndex}
|
|
|
|
id={this.getRuleHash(sectionIndex, ruleIndex)}
|
|
|
|
>
|
|
|
|
{item}
|
|
|
|
</li>
|
|
|
|
))}
|
|
|
|
</ol>
|
|
|
|
</div>
|
2016-05-23 23:22:05 +05:30
|
|
|
</div>
|
2016-05-31 15:00:41 +05:30
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
<div className={styles.footer}>
|
|
|
|
<FooterMenu />
|
|
|
|
</div>
|
2016-05-23 23:22:05 +05:30
|
|
|
</div>
|
2016-05-31 15:00:41 +05:30
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
getTitleHash(sectionIndex) {
|
|
|
|
return `rule-${sectionIndex + 1}`;
|
|
|
|
}
|
|
|
|
|
|
|
|
getRuleHash(sectionIndex, ruleIndex) {
|
|
|
|
return `rule-${sectionIndex + 1}-${ruleIndex + 1}`;
|
|
|
|
}
|
2016-05-22 21:26:52 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
RulesPage.displayName = 'RulesPage';
|