2017-08-22 21:49:50 +03:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React, { Component } 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';
|
2017-12-30 23:38:54 +02:00
|
|
|
import ContactForm from 'components/contact/ContactForm';
|
|
|
|
import LanguageSwitcher from 'components/languageSwitcher';
|
|
|
|
import { create as createPopup } from 'components/ui/popup/actions';
|
2016-05-22 20:25:38 +03:00
|
|
|
|
|
|
|
import styles from './footerMenu.scss';
|
|
|
|
import messages from './footerMenu.intl.json';
|
|
|
|
|
2016-05-28 00:36:22 +03:00
|
|
|
class FooterMenu extends Component {
|
2016-05-22 20:25:38 +03:00
|
|
|
static displayName = 'FooterMenu';
|
|
|
|
|
|
|
|
static propTypes = {
|
2017-10-15 22:00:21 +03:00
|
|
|
createContactPopup: PropTypes.func.isRequired,
|
|
|
|
createLanguageSwitcherPopup: PropTypes.func.isRequired,
|
2016-05-22 20:25:38 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className={styles.footerMenu}>
|
|
|
|
<Link to="/rules">
|
|
|
|
<Message {...messages.rules} />
|
|
|
|
</Link>
|
|
|
|
{' | '}
|
|
|
|
<a href="#" onClick={this.onContact}>
|
|
|
|
<Message {...messages.contactUs} />
|
|
|
|
</a>
|
2016-05-27 23:38:11 +03:00
|
|
|
|
2017-10-15 22:00:21 +03:00
|
|
|
<div className={styles.langTriggerContainer}>
|
|
|
|
<a href="#" className={styles.langTrigger} onClick={this.onLanguageSwitcher}>
|
|
|
|
<span className={styles.langTriggerIcon} />
|
|
|
|
<Message {...messages.siteLanguage} />
|
|
|
|
</a>
|
|
|
|
</div>
|
2016-05-22 20:25:38 +03:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
onContact = (event) => {
|
|
|
|
event.preventDefault();
|
2017-10-15 22:00:21 +03:00
|
|
|
this.props.createContactPopup();
|
|
|
|
};
|
|
|
|
|
|
|
|
onLanguageSwitcher = (event) => {
|
|
|
|
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
|
2016-05-22 20:25:38 +03:00
|
|
|
export default connect(null, {
|
2017-10-15 22:00:21 +03:00
|
|
|
createContactPopup: () => createPopup(ContactForm),
|
|
|
|
createLanguageSwitcherPopup: () => createPopup(LanguageSwitcher),
|
2016-06-28 12:09:15 +03:00
|
|
|
}, null, {pure: false})(FooterMenu);
|