2020-01-16 00:44:35 +05:30
|
|
|
import React, { ComponentType, MouseEventHandler, useCallback } from 'react';
|
|
|
|
import { useDispatch } 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';
|
|
|
|
|
2020-01-16 00:44:35 +05:30
|
|
|
const FooterMenu: ComponentType = () => {
|
2020-05-24 04:38:24 +05:30
|
|
|
const dispatch = useDispatch();
|
|
|
|
const onLanguageSwitcherClick = useCallback<MouseEventHandler<HTMLAnchorElement>>(
|
|
|
|
(event) => {
|
|
|
|
event.preventDefault();
|
|
|
|
dispatch(createPopup({ Popup: LanguageSwitcher }));
|
|
|
|
},
|
|
|
|
[dispatch],
|
|
|
|
);
|
2019-06-30 19:02:50 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
return (
|
|
|
|
<div className={styles.footerMenu} data-testid="footer">
|
|
|
|
<Link to="/rules" className={styles.footerItem}>
|
|
|
|
<Message {...messages.rules} />
|
|
|
|
</Link>
|
|
|
|
<ContactLink className={styles.footerItem}>
|
|
|
|
<Message {...messages.contactUs} />
|
|
|
|
</ContactLink>
|
|
|
|
<Link to="/dev" className={styles.footerItem}>
|
|
|
|
<Message {...messages.forDevelopers} />
|
|
|
|
</Link>
|
2019-11-27 14:33:32 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
<div className={styles.langTriggerContainer}>
|
|
|
|
<a href="#" className={styles.langTrigger} onClick={onLanguageSwitcherClick}>
|
|
|
|
<span className={styles.langTriggerIcon} />
|
|
|
|
<Message {...messages.siteLanguage} />
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
2020-01-16 00:44:35 +05:30
|
|
|
};
|
2016-05-22 22:55:38 +05:30
|
|
|
|
2020-01-16 00:44:35 +05:30
|
|
|
export default FooterMenu;
|