Skip to content

Commit

Permalink
Move sidebar toggle stats into action
Browse files Browse the repository at this point in the history
  • Loading branch information
bluefuton committed Feb 1, 2016
1 parent 7734744 commit 103c5c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
6 changes: 6 additions & 0 deletions client/state/ui/reader/sidebar/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
*/
import { READER_SIDEBAR_LISTS_TOGGLE, READER_SIDEBAR_TAGS_TOGGLE } from 'state/action-types';

const stats = require( 'reader/stats' );

export function toggleReaderSidebarLists() {
stats.recordAction( 'sidebar_toggle_lists_menu' );
stats.recordGaEvent( 'Toggle Lists Menu' );

This comment has been minimized.

Copy link
@blowery

blowery Feb 2, 2016

Contributor

should record a tracks event here too. i'll add it.

return {
type: READER_SIDEBAR_LISTS_TOGGLE
};
}

export function toggleReaderSidebarTags() {
stats.recordAction( 'sidebar_toggle_tags_menu' );
stats.recordGaEvent( 'Toggle Tags Menu' );
return {
type: READER_SIDEBAR_TAGS_TOGGLE
};
Expand Down
16 changes: 0 additions & 16 deletions client/state/ui/reader/sidebar/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,10 @@ import { combineReducers } from 'redux';
*/
import { READER_SIDEBAR_LISTS_TOGGLE, READER_SIDEBAR_TAGS_TOGGLE } from 'state/action-types';

const stats = require( 'reader/stats' );

function isListsOpen( state = false, action ) {
switch ( action.type ) {
case READER_SIDEBAR_LISTS_TOGGLE:
state = ! state;
if ( state ) {
stats.recordAction( 'sidebar_open_lists_menu' );
stats.recordGaEvent( 'Clicked Open Lists Menu' );
} else {
stats.recordAction( 'sidebar_close_lists_menu' );
stats.recordGaEvent( 'Clicked Close Lists Menu' );
}
break;
}

Expand All @@ -31,13 +22,6 @@ function isTagsOpen( state = false, action ) {
switch ( action.type ) {
case READER_SIDEBAR_TAGS_TOGGLE:
state = ! state;
if ( state ) {
stats.recordAction( 'sidebar_open_tags_menu' );
stats.recordGaEvent( 'Clicked Open Tags Menu' );
} else {
stats.recordAction( 'sidebar_close_tags_menu' );
stats.recordGaEvent( 'Clicked Close Tags Menu' );
}
break;
}

Expand Down

0 comments on commit 103c5c8

Please sign in to comment.