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

45 lines
1.6 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 = () => {
2020-05-24 04:38:24 +05:30
const dispatch = useDispatch();
const onLanguageSwitcherClick = useCallback<MouseEventHandler<HTMLAnchorElement>>(
(event) => {
event.preventDefault();
dispatch(createPopup({ Popup: LanguageSwitcher }));
},
[dispatch],
);
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>
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>
);
};
2016-05-22 22:55:38 +05:30
export default FooterMenu;