2019-12-07 16:58:52 +05:30
|
|
|
import React 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';
|
2019-12-08 00:32:00 +05:30
|
|
|
import LanguageSwitcher from 'app/components/languageSwitcher';
|
|
|
|
import { create as createPopup } from 'app/components/ui/popup/actions';
|
|
|
|
import { ContactLink } from 'app/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 Props = {
|
2019-12-07 16:58:52 +05:30
|
|
|
createLanguageSwitcherPopup: () => void;
|
2019-06-30 19:02:50 +05:30
|
|
|
};
|
|
|
|
|
2019-12-07 16:58:52 +05:30
|
|
|
class FooterMenu extends React.Component<Props> {
|
2019-11-27 14:33:32 +05:30
|
|
|
render() {
|
|
|
|
return (
|
2019-12-28 15:35:41 +05:30
|
|
|
<div className={styles.footerMenu} data-testid="footer">
|
2019-11-27 14:33:32 +05:30
|
|
|
<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>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2019-12-07 16:58:52 +05:30
|
|
|
onLanguageSwitcher = (event: React.MouseEvent<HTMLElement>) => {
|
2019-11-27 14:33:32 +05:30
|
|
|
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-12-07 16:58:52 +05:30
|
|
|
export default connect(
|
2019-11-27 14:33:32 +05:30
|
|
|
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);
|