This repository has been archived by the owner on Oct 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
[PAY-1457] Add amplitude analytics to chat features #3627
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
8e1a08a
add metric names
rickyrombo 1675820
report to sentry
rickyrombo 56be257
more sentry reporting
rickyrombo dacc9d3
Fix potentially undefined otherUser
rickyrombo 9fcc25c
Add amplitude models for chat stuff
rickyrombo f7ab1d7
Make a make() for common to use
rickyrombo 2637a5e
Add amplitude analytics to chat stuff
rickyrombo c011988
Merge remote-tracking branch 'origin/main' into mjp-dms-amp
rickyrombo 3a2287e
Add more data to analytics
rickyrombo f1ad64f
Typo
rickyrombo fb97e1b
Add tip to unlock analytics tracking
rickyrombo 2415640
fix typecheck
rickyrombo a9d674e
Add appContext with analytics
rickyrombo ce1f57f
Add amp metrics for inbox settings
rickyrombo bb036d7
Add logging and await to track
rickyrombo 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { createContext, useContext } from 'react' | ||
|
||
import { AnalyticsEvent, AllTrackingEvents } from 'models/Analytics' | ||
|
||
type AppContextType = { | ||
analytics: { | ||
track: (event: AnalyticsEvent, callback?: () => void) => Promise<void> | ||
make: <T extends AllTrackingEvents>( | ||
event: T | ||
) => { | ||
eventName: string | ||
properties: any | ||
} | ||
} | ||
} | ||
|
||
export const AppContext = createContext<AppContextType | null>(null) | ||
|
||
export const useAppContext = () => { | ||
const context = useContext(AppContext) | ||
if (!context) { | ||
throw new Error('useAppContext has to be used within <AppContext.Provider>') | ||
} | ||
|
||
return context | ||
} |
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 @@ | ||
export * from './appContext' |
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
Oops, something went wrong.
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.
Might be able to avoid the returntype with
const firstOtherUser = users[0] as User | undefined