2019-12-07 13:28:52 +02:00
|
|
|
import React from 'react';
|
2017-12-30 23:38:54 +02:00
|
|
|
import { connect } from 'react-redux';
|
2017-05-25 22:11:57 +03:00
|
|
|
import { Link } from 'react-router-dom';
|
2016-05-22 20:25:38 +03:00
|
|
|
import { FormattedMessage as Message } from 'react-intl';
|
2019-12-07 21:02:00 +02:00
|
|
|
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 20:25:38 +03:00
|
|
|
|
|
|
|
import styles from './footerMenu.scss';
|
|
|
|
import messages from './footerMenu.intl.json';
|
|
|
|
|
2019-06-30 16:32:50 +03:00
|
|
|
type Props = {
|
2019-12-07 13:28:52 +02:00
|
|
|
createLanguageSwitcherPopup: () => void;
|
2019-06-30 16:32:50 +03:00
|
|
|
};
|
|
|
|
|
2019-12-07 13:28:52 +02:00
|
|
|
class FooterMenu extends React.Component<Props> {
|
2019-11-27 11:03:32 +02:00
|
|
|
render() {
|
|
|
|
return (
|
2019-12-28 12:05:41 +02:00
|
|
|
<div className={styles.footerMenu} data-testid="footer">
|
2019-11-27 11:03:32 +02:00
|
|
|
<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 13:28:52 +02:00
|
|
|
onLanguageSwitcher = (event: React.MouseEvent<HTMLElement>) => {
|
2019-11-27 11:03:32 +02:00
|
|
|
event.preventDefault();
|
|
|
|
|
|
|
|
this.props.createLanguageSwitcherPopup();
|
|
|
|
};
|
2016-05-22 20:25:38 +03:00
|
|
|
}
|
|
|
|
|
2016-06-28 12:09:15 +03:00
|
|
|
// mark this component, as not pure, because it is stateless,
|
|
|
|
// but should be re-rendered, if current lang was changed
|
2019-12-07 13:28:52 +02:00
|
|
|
export default connect(
|
2019-11-27 11:03:32 +02:00
|
|
|
null,
|
|
|
|
{
|
2019-06-30 16:32:50 +03:00
|
|
|
createLanguageSwitcherPopup: () => createPopup({ Popup: LanguageSwitcher }),
|
2019-11-27 11:03:32 +02:00
|
|
|
},
|
|
|
|
null,
|
|
|
|
{ pure: false },
|
|
|
|
)(FooterMenu);
|