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"> <section className="sect3">
<div className="container"> <div className="container">
<SubscriptionsMap /> <SubscriptionsMap {...this.props} />
</div> </div>
</section> </section>

View file

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

View file

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