Fix for participe btn

This commit is contained in:
vjrj 2018-02-12 14:57:13 +01:00
parent bbe9b1b40e
commit 8a6584acb9
3 changed files with 10 additions and 6 deletions

View file

@ -182,7 +182,7 @@ class Index extends Component {
<section className="sect3">
<div className="container">
<SubscriptionsMap />
<SubscriptionsMap {...this.props} />
</div>
</section>

View file

@ -81,6 +81,8 @@ class SubscriptionsMap extends React.Component {
const element = document.querySelector('#participe');
if (element) {
element.scrollIntoView();
} else {
this.props.history.push('/subscriptions');
}
}
@ -153,6 +155,7 @@ class SubscriptionsMap extends React.Component {
SubscriptionsMap.propTypes = {
subsready: PropTypes.bool.isRequired,
userSubs: PropTypes.arrayOf(PropTypes.object).isRequired,
history: PropTypes.object.isRequired,
t: PropTypes.func.isRequired
};

View file

@ -1,25 +1,26 @@
/* eslint-disable import/no-absolute-path */
import React, { Fragment } from 'react';
// import PropTypes from 'prop-types';
import PropTypes from 'prop-types';
import { translate } from 'react-i18next';
import SubscriptionsMap from '/imports/ui/pages/Subscriptions/SubscriptionsMap';
class ZonesMap extends React.Component {
componentDidMount() {
// this.setState({init: true});
constructor(props) {
super(props);
this.t = props.t;
}
render() {
return (
<Fragment>
<SubscriptionsMap />
<SubscriptionsMap {...this.props} />
</Fragment>
);
}
}
ZonesMap.propTypes = {
// history: PropTypes.object.isRequired
history: PropTypes.object.isRequired
};
export default translate([], { wait: true })(ZonesMap);