import React, { Component, PropTypes } from 'react'; import { Link } from 'react-router'; import { FormattedMessage as Message } from 'react-intl'; import Helmet from 'react-helmet'; import { FooterMenu } from 'components/footerMenu'; import styles from './rules.scss'; import messages from './RulesPage.intl.json'; import appInfo from 'components/auth/appInfo/AppInfo.intl.json'; const projectName = ; import classNames from 'classnames'; const rules = [ { title: , items: [ {projectName}) }} />, , , https://account.ely.by/register) }} /> ] }, { title: , items: [ , , , , , , ] }, { title: , description: ( {projectName}) }} /> ), items: [ , ] } ]; export default class RulesPage extends Component { static propTypes = { location: PropTypes.shape({ hash: PropTypes.string }) }; static contextTypes = { router: PropTypes.shape({ createLocation: PropTypes.func.required, replace: PropTypes.func.required }).isRequired }; render() { let {hash} = this.props.location; if (hash) { hash = hash.substring(1); } return ( {(pageTitle) => ( )} {rules.map((block, sectionIndex) => ( {block.title} {block.description ? ( {block.description} ) : ''} {block.items.map((item, ruleIndex) => ( {item} ))} ))} ); } onRuleClick(event) { if (event.defaultPrevented || event.target.tagName.toLowerCase() === 'a') { // some-one have already processed this event or it is a link return; } const {id} = event.currentTarget; const {router} = this.context; const newLocation = router.createLocation({...location, hash: `#${id}`}); router.replace(newLocation); } static getTitleHash(sectionIndex) { return `rule-${sectionIndex + 1}`; } static getRuleHash(sectionIndex, ruleIndex) { return `${RulesPage.getTitleHash(sectionIndex)}-${ruleIndex + 1}`; } } RulesPage.displayName = 'RulesPage';
{projectName}) }} />