accounts-frontend/packages/app/components/footerMenu/FooterMenu.tsx

49 lines
1.5 KiB
TypeScript
Raw Normal View History

import React, { ComponentType, MouseEventHandler, useCallback } from 'react';
import { useDispatch } from 'react-redux';
import { Link } from 'react-router-dom';
2016-05-22 22:55:38 +05:30
import { FormattedMessage as Message } from 'react-intl';
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';
const FooterMenu: ComponentType = () => {
const dispatch = useDispatch();
const onLanguageSwitcherClick = useCallback<MouseEventHandler>(
event => {
event.preventDefault();
dispatch(createPopup({ Popup: LanguageSwitcher }));
},
[dispatch],
);
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>
<div className={styles.langTriggerContainer}>
<a
href="#"
className={styles.langTrigger}
onClick={onLanguageSwitcherClick}
>
<span className={styles.langTriggerIcon} />
<Message {...messages.siteLanguage} />
</a>
</div>
</div>
);
};
2016-05-22 22:55:38 +05:30
export default FooterMenu;