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 'app/components/footerMenu'; import appInfo from 'app/components/auth/appInfo/AppInfo.intl.json'; import styles from './rules.scss'; import messages from './RulesPage.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<{ 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: React.SyntheticEvent) { if ( event.defaultPrevented || !event.currentTarget.id || event.target instanceof HTMLAnchorElement ) { // 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: number) { return `rule-${sectionIndex + 1}`; } static getRuleHash(sectionIndex: number, ruleIndex: number) { return `${RulesPage.getTitleHash(sectionIndex)}-${ruleIndex + 1}`; } }
{projectName}, }} />