2018-03-26 00:46:45 +05:30
|
|
|
// @flow
|
2017-08-23 00:19:50 +05:30
|
|
|
import React, { Component } from 'react';
|
2017-12-31 03:08:54 +05:30
|
|
|
import { connect } from 'react-redux';
|
2017-05-26 00:41:57 +05:30
|
|
|
import { Link } from 'react-router-dom';
|
2016-05-22 22:55:38 +05:30
|
|
|
import { FormattedMessage as Message } from 'react-intl';
|
2017-12-31 03:08:54 +05:30
|
|
|
import LanguageSwitcher from 'components/languageSwitcher';
|
|
|
|
import { create as createPopup } from 'components/ui/popup/actions';
|
2018-05-05 13:12:29 +05:30
|
|
|
import { ContactLink } from 'components/contact';
|
2016-05-22 22:55:38 +05:30
|
|
|
|
|
|
|
import styles from './footerMenu.scss';
|
|
|
|
import messages from './footerMenu.intl.json';
|
|
|
|
|
2019-06-30 19:02:50 +05:30
|
|
|
type OwnProps = {|
|
2019-11-27 14:33:32 +05:30
|
|
|
createContactPopup: () => void,
|
2019-06-30 19:02:50 +05:30
|
|
|
|};
|
|
|
|
|
|
|
|
type Props = {
|
2019-11-27 14:33:32 +05:30
|
|
|
...OwnProps,
|
|
|
|
createLanguageSwitcherPopup: () => void,
|
2019-06-30 19:02:50 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
class FooterMenu extends Component<Props> {
|
2019-11-27 14:33:32 +05:30
|
|
|
static displayName = 'FooterMenu';
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className={styles.footerMenu}>
|
|
|
|
<Link to="/rules">
|
|
|
|
<Message {...messages.rules} />
|
|
|
|
</Link>
|
|
|
|
{' | '}
|
|
|
|
<ContactLink>
|
|
|
|
<Message {...messages.contactUs} />
|
|
|
|
</ContactLink>
|
|
|
|
{' | '}
|
|
|
|
<Link to="/dev">
|
|
|
|
<Message {...messages.forDevelopers} />
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
<div className={styles.langTriggerContainer}>
|
|
|
|
<a
|
|
|
|
href="#"
|
|
|
|
className={styles.langTrigger}
|
|
|
|
onClick={this.onLanguageSwitcher}
|
|
|
|
>
|
|
|
|
<span className={styles.langTriggerIcon} />
|
|
|
|
<Message {...messages.siteLanguage} />
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
onLanguageSwitcher = (event: SyntheticMouseEvent<HTMLElement>) => {
|
|
|
|
event.preventDefault();
|
|
|
|
|
|
|
|
this.props.createLanguageSwitcherPopup();
|
|
|
|
};
|
2016-05-22 22:55:38 +05:30
|
|
|
}
|
|
|
|
|
2016-06-28 14:39:15 +05:30
|
|
|
// mark this component, as not pure, because it is stateless,
|
|
|
|
// but should be re-rendered, if current lang was changed
|
2019-11-27 14:33:32 +05:30
|
|
|
export default connect<Props, OwnProps, _, _, _, _>(
|
|
|
|
null,
|
|
|
|
{
|
2019-06-30 19:02:50 +05:30
|
|
|
createLanguageSwitcherPopup: () => createPopup({ Popup: LanguageSwitcher }),
|
2019-11-27 14:33:32 +05:30
|
|
|
},
|
|
|
|
null,
|
|
|
|
{ pure: false },
|
|
|
|
)(FooterMenu);
|