Folder structure #398

Merged
bones7242 merged 76 commits from folder-structure into master 2018-03-20 00:01:08 +01:00
5 changed files with 11 additions and 12 deletions
Showing only changes of commit c4ccc9a361 - Show all commits

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -4,8 +4,13 @@ import { withRouter } from 'react-router-dom';
class GAListener extends React.Component {
componentDidMount () {
this.sendPageView(this.props.history.location);
this.props.history.listen(this.sendPageView);
// initiate analytics
const { googleAnalyticsId } = this.props;
if (googleAnalyticsId) {
GoogleAnalytics.initialize(googleAnalyticsId);
this.sendPageView(this.props.history.location);
this.props.history.listen(this.sendPageView);
}
}
sendPageView (location) {
@ -14,12 +19,6 @@ class GAListener extends React.Component {
}
render () {
// initiate analytics
const { googleAnalyticsId } = this.props;
if (googleAnalyticsId) {
GoogleAnalytics.initialize(googleAnalyticsId);
}
// return children
return this.props.children;
}
}