// @flow import React, { Component } from 'react'; import { Link } from 'react-router-dom'; 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 { props: { location: { pathname: string, search: string, hash: string }, history: { replace: Function } }; 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: MouseEvent & {target: HTMLElement, currentTarget: HTMLElement}) { if (event.defaultPrevented || !event.currentTarget.id || event.target.tagName.toLowerCase() === 'a' ) { // some-one have already processed this event or it is a link return; } const {id} = event.currentTarget; const newPath = `${this.props.location.pathname}${this.props.location.search}#${id}`; this.props.history.replace(newPath); } static getTitleHash(sectionIndex) { return `rule-${sectionIndex + 1}`; } static getRuleHash(sectionIndex, ruleIndex) { return `${RulesPage.getTitleHash(sectionIndex)}-${ruleIndex + 1}`; } }
{projectName}) }} />