Feature(analytics): Add redux logic for analytics

Add(nav): Add event tracking to nav bar
Add(Drawer): Add event tracking to chat/map drawer
This commit is contained in:
Berkeley Martinez
2016-07-21 16:35:37 -07:00
parent 63a260ae86
commit 5381b0660c
10 changed files with 192 additions and 17 deletions

View File

@@ -10,7 +10,8 @@ import {
updateNavHeight,
toggleMapDrawer,
toggleMainChat,
updateAppLang
updateAppLang,
trackEvent
} from './redux/actions';
import { submitChallenge } from './routes/challenges/redux/actions';
@@ -26,7 +27,8 @@ const bindableActions = {
submitChallenge,
toggleMapDrawer,
toggleMainChat,
updateAppLang
updateAppLang,
trackEvent
};
const mapStateToProps = createSelector(
@@ -77,7 +79,8 @@ export class FreeCodeCamp extends React.Component {
fetchUser: PropTypes.func,
shouldShowSignIn: PropTypes.bool,
params: PropTypes.object,
updateAppLang: PropTypes.func.isRequired
updateAppLang: PropTypes.func.isRequired,
trackEvent: PropTypes.func.isRequired
};
componentWillReceiveProps(nextProps) {
@@ -120,7 +123,8 @@ export class FreeCodeCamp extends React.Component {
toggleMapDrawer,
toggleMainChat,
shouldShowSignIn,
params: { lang }
params: { lang },
trackEvent
} = this.props;
const navProps = {
isOnMap: router.isActive(`/${lang}/map`),
@@ -130,7 +134,8 @@ export class FreeCodeCamp extends React.Component {
updateNavHeight,
toggleMapDrawer,
toggleMainChat,
shouldShowSignIn
shouldShowSignIn,
trackEvent
};
return (