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 = {|
|
2018-03-26 00:46:45 +05:30
|
|
|
createContactPopup: () => void,
|
2019-06-30 19:02:50 +05:30
|
|
|
|};
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
...OwnProps,
|
2018-03-26 00:46:45 +05:30
|
|
|
createLanguageSwitcherPopup: () => void,
|
2019-06-30 19:02:50 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
class FooterMenu extends Component<Props> {
|
2016-05-22 22:55:38 +05:30
|
|
|
static displayName = 'FooterMenu';
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className={styles.footerMenu}>
|
|
|
|
<Link to="/rules">
|
|
|
|
<Message {...messages.rules} />
|
|
|
|
</Link>
|
|
|
|
{' | '}
|
2018-05-05 13:12:29 +05:30
|
|
|
<ContactLink>
|
2016-05-22 22:55:38 +05:30
|
|
|
<Message {...messages.contactUs} />
|
2018-05-05 13:12:29 +05:30
|
|
|
</ContactLink>
|
2018-03-26 00:46:45 +05:30
|
|
|
{' | '}
|
|
|
|
<Link to="/dev">
|
|
|
|
<Message {...messages.forDevelopers} />
|
|
|
|
</Link>
|
2016-05-28 02:08:11 +05:30
|
|
|
|
2017-10-16 00:30:21 +05:30
|
|
|
<div className={styles.langTriggerContainer}>
|
|
|
|
<a href="#" className={styles.langTrigger} onClick={this.onLanguageSwitcher}>
|
|
|
|
<span className={styles.langTriggerIcon} />
|
|
|
|
<Message {...messages.siteLanguage} />
|
|
|
|
</a>
|
|
|
|
</div>
|
2016-05-22 22:55:38 +05:30
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2018-05-05 13:12:29 +05:30
|
|
|
onLanguageSwitcher = (event: SyntheticMouseEvent<HTMLElement>) => {
|
2016-05-22 22:55:38 +05:30
|
|
|
event.preventDefault();
|
2017-10-16 00:30:21 +05:30
|
|
|
|
|
|
|
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-06-30 19:02:50 +05:30
|
|
|
export default connect<Props, OwnProps, _, _, _, _>(null, {
|
|
|
|
createLanguageSwitcherPopup: () => createPopup({ Popup: LanguageSwitcher }),
|
2016-06-28 14:39:15 +05:30
|
|
|
}, null, {pure: false})(FooterMenu);
|