Skip to content

Commit

Permalink
feat: log is expert mode in amplitude user model (Uniswap#4284)
Browse files Browse the repository at this point in the history
* log is expert mode in amplitude user model

* remove extra
  • Loading branch information
lynnshaoyu authored Aug 4, 2022
1 parent eb71b08 commit 68733e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/AmplitudeAnalytics/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export enum CUSTOM_USER_PROPERTIES {
ALL_WALLET_CHAIN_IDS = 'all_wallet_chain_ids',
BROWSER = 'browser',
DARK_MODE = 'is_dark_mode',
EXPERT_MODE = 'is_expert_mode',
SCREEN_RESOLUTION_HEIGHT = 'screen_resolution_height',
SCREEN_RESOLUTION_WIDTH = 'screen_resolution_width',
WALLET_ADDRESS = 'wallet_address',
Expand Down
6 changes: 6 additions & 0 deletions src/pages/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import ErrorBoundary from '../components/ErrorBoundary'
import Header from '../components/Header'
import Polling from '../components/Header/Polling'
import Popups from '../components/Popups'
import { useIsExpertMode } from '../state/user/hooks'
import DarkModeQueryParamReader from '../theme/DarkModeQueryParamReader'
import AddLiquidity from './AddLiquidity'
import { RedirectDuplicateTokenIds } from './AddLiquidity/redirects'
Expand Down Expand Up @@ -90,6 +91,7 @@ export default function App() {
const { pathname } = useLocation()
const currentPage = getCurrentPageFromLocation(pathname)
const isDarkMode = useIsDarkMode()
const isExpertMode = useIsExpertMode()

useAnalyticsReporter()
initializeAnalytics()
Expand All @@ -110,6 +112,10 @@ export default function App() {
user.set(CUSTOM_USER_PROPERTIES.DARK_MODE, isDarkMode)
}, [isDarkMode])

useEffect(() => {
user.set(CUSTOM_USER_PROPERTIES.EXPERT_MODE, isExpertMode)
}, [isExpertMode])

return (
<ErrorBoundary>
<DarkModeQueryParamReader />
Expand Down

0 comments on commit 68733e0

Please sign in to comment.