-
Notifications
You must be signed in to change notification settings - Fork 483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Google Analytics tracking #81
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
[include] | ||
|
||
[libs] | ||
./flow-typed/npm | ||
|
||
[options] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
// flow-typed signature: 4d8e947f2e396ef2f26ecbd1ed7f04ab | ||
// flow-typed version: 97d98ab83e/react-router-dom_v4.x.x/flow_>=v0.53.x | ||
|
||
declare module 'react-router-dom' { | ||
declare export class BrowserRouter extends React$Component<{ | ||
basename?: string, | ||
forceRefresh?: boolean, | ||
getUserConfirmation?: GetUserConfirmation, | ||
keyLength?: number, | ||
children?: React$Node, | ||
}> {} | ||
|
||
declare export class HashRouter extends React$Component<{ | ||
basename?: string, | ||
getUserConfirmation?: GetUserConfirmation, | ||
hashType?: 'slash' | 'noslash' | 'hashbang', | ||
children?: React$Node, | ||
}> {} | ||
|
||
declare export class Link extends React$Component<{ | ||
to: string | LocationShape, | ||
replace?: boolean, | ||
children?: React$Node, | ||
}> {} | ||
|
||
declare export class NavLink extends React$Component<{ | ||
to: string | LocationShape, | ||
activeClassName?: string, | ||
className?: string, | ||
activeStyle?: Object, | ||
style?: Object, | ||
isActive?: (match: Match, location: Location) => boolean, | ||
children?: React$Node, | ||
exact?: boolean, | ||
strict?: boolean, | ||
}> {} | ||
|
||
// NOTE: Below are duplicated from react-router. If updating these, please | ||
// update the react-router and react-router-native types as well. | ||
declare export type Location = { | ||
pathname: string, | ||
search: string, | ||
hash: string, | ||
state?: any, | ||
key?: string, | ||
}; | ||
|
||
declare export type LocationShape = { | ||
pathname?: string, | ||
search?: string, | ||
hash?: string, | ||
state?: any, | ||
}; | ||
|
||
declare export type HistoryAction = 'PUSH' | 'REPLACE' | 'POP'; | ||
|
||
declare export type RouterHistory = { | ||
length: number, | ||
location: Location, | ||
action: HistoryAction, | ||
listen(callback: (location: Location, action: HistoryAction) => void): () => void, | ||
push(path: string | LocationShape, state?: any): void, | ||
replace(path: string | LocationShape, state?: any): void, | ||
go(n: number): void, | ||
goBack(): void, | ||
goForward(): void, | ||
canGo?: (n: number) => boolean, | ||
block(callback: (location: Location, action: HistoryAction) => boolean): void, | ||
// createMemoryHistory | ||
index?: number, | ||
entries?: Array<Location>, | ||
}; | ||
|
||
declare export type Match = { | ||
params: { [key: string]: ?string }, | ||
isExact: boolean, | ||
path: string, | ||
url: string, | ||
}; | ||
|
||
declare export type ContextRouter = {| | ||
history: RouterHistory, | ||
location: Location, | ||
match: Match, | ||
|}; | ||
|
||
declare export type GetUserConfirmation = (message: string, callback: (confirmed: boolean) => void) => void; | ||
|
||
declare type StaticRouterContext = { | ||
url?: string, | ||
}; | ||
|
||
declare export class StaticRouter extends React$Component<{ | ||
basename?: string, | ||
location?: string | Location, | ||
context: StaticRouterContext, | ||
children?: React$Node, | ||
}> {} | ||
|
||
declare export class MemoryRouter extends React$Component<{ | ||
initialEntries?: Array<LocationShape | string>, | ||
initialIndex?: number, | ||
getUserConfirmation?: GetUserConfirmation, | ||
keyLength?: number, | ||
children?: React$Node, | ||
}> {} | ||
|
||
declare export class Router extends React$Component<{ | ||
history: RouterHistory, | ||
children?: React$Node, | ||
}> {} | ||
|
||
declare export class Prompt extends React$Component<{ | ||
message: string | ((location: Location) => string | true), | ||
when?: boolean, | ||
}> {} | ||
|
||
declare export class Redirect extends React$Component<{ | ||
to: string | LocationShape, | ||
push?: boolean, | ||
}> {} | ||
|
||
declare export class Route extends React$Component<{ | ||
component?: React$ComponentType<*>, | ||
render?: (router: ContextRouter) => React$Node, | ||
children?: React$ComponentType<ContextRouter> | React$Node, | ||
path?: string, | ||
exact?: boolean, | ||
strict?: boolean, | ||
}> {} | ||
|
||
declare export class Switch extends React$Component<{ | ||
children?: React$Node, | ||
}> {} | ||
|
||
declare export function withRouter<P>( | ||
Component: React$ComponentType<{| ...ContextRouter, ...P |}> | ||
): React$ComponentType<P>; | ||
|
||
declare type MatchPathOptions = { | ||
path?: string, | ||
exact?: boolean, | ||
sensitive?: boolean, | ||
strict?: boolean, | ||
}; | ||
|
||
declare export function matchPath(pathname: string, options?: MatchPathOptions | string): null | Match; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I think this is more robust.
One comment, given that the GA key will come through the HTTP Config service (async), we need to make sure the key is initialized beforehand so we don't miss any page view events
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I might make a separate ticket for that. Don't want to hold up fixing GA tracking or getting the menu working.