2017-08-23 00:19:50 +05:30
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React, { Component } from 'react';
|
2016-05-22 22:55:38 +05:30
|
|
|
|
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';
|
|
|
|
|
|
|
|
import styles from './footerMenu.scss';
|
|
|
|
import messages from './footerMenu.intl.json';
|
|
|
|
|
2016-05-28 03:06:22 +05:30
|
|
|
class FooterMenu extends Component {
|
2016-05-22 22:55:38 +05:30
|
|
|
static displayName = 'FooterMenu';
|
|
|
|
|
|
|
|
static propTypes = {
|
2017-10-16 00:30:21 +05:30
|
|
|
createContactPopup: PropTypes.func.isRequired,
|
|
|
|
createLanguageSwitcherPopup: PropTypes.func.isRequired,
|
2016-05-22 22:55:38 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className={styles.footerMenu}>
|
|
|
|
<Link to="/rules">
|
|
|
|
<Message {...messages.rules} />
|
|
|
|
</Link>
|
|
|
|
{' | '}
|
|
|
|
<a href="#" onClick={this.onContact}>
|
|
|
|
<Message {...messages.contactUs} />
|
|
|
|
</a>
|
2016-05-28 02:08:11 +05:30
|
|
|
|
2017-10-16 00:30:21 +05:30
|
|
|
<div className={styles.langTriggerContainer}>
|
|
|
|
<a href="#" className={styles.langTrigger} onClick={this.onLanguageSwitcher}>
|
|
|
|
<span className={styles.langTriggerIcon} />
|
|
|
|
<Message {...messages.siteLanguage} />
|
|
|
|
</a>
|
|
|
|
</div>
|
2016-05-22 22:55:38 +05:30
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
onContact = (event) => {
|
|
|
|
event.preventDefault();
|
2017-10-16 00:30:21 +05:30
|
|
|
this.props.createContactPopup();
|
|
|
|
};
|
|
|
|
|
|
|
|
onLanguageSwitcher = (event) => {
|
|
|
|
event.preventDefault();
|
|
|
|
this.props.createLanguageSwitcherPopup();
|
2016-05-22 22:55:38 +05:30
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import ContactForm from 'components/contact/ContactForm';
|
2017-10-16 00:30:21 +05:30
|
|
|
import LanguageSwitcher from 'components/languageSwitcher/LanguageSwitcher';
|
2016-05-22 22:55:38 +05:30
|
|
|
import { create as createPopup } from 'components/ui/popup/actions';
|
|
|
|
|
2016-06-28 14:39:15 +05:30
|
|
|
// mark this component, as not pure, because it is stateless,
|
|
|
|
// but should be re-rendered, if current lang was changed
|
2016-05-22 22:55:38 +05:30
|
|
|
export default connect(null, {
|
2017-10-16 00:30:21 +05:30
|
|
|
createContactPopup: () => createPopup(ContactForm),
|
|
|
|
createLanguageSwitcherPopup: () => createPopup(LanguageSwitcher),
|
2016-06-28 14:39:15 +05:30
|
|
|
}, null, {pure: false})(FooterMenu);
|