[APP-1782] Migrate to new analytics APIs (#9735)

* Migrate logEvent to useAnalytics

* Migrate logger.metric to useAnalytics

* Migrate tricky spot, fix types

* Migrate remaining tricky spot

* Missed one

* Remove metric() from logger

* Migrate useGate to useAnalytics

* Remove all other StatSig mentions

* Update event payload

* Update logger tests

* Mock expo method
This commit is contained in:
Eric Bailey
2026-01-21 19:31:39 -06:00
committed by GitHub
parent 82706fbd19
commit 66af8f1fbf
149 changed files with 985 additions and 1112 deletions
+5 -5
View File
@@ -1,11 +1,9 @@
import {useCallback, useImperativeHandle, useRef, useState} from 'react'
import {View} from 'react-native'
import {useWindowDimensions} from 'react-native'
import {useWindowDimensions, View} from 'react-native'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {BSKY_SERVICE} from '#/lib/constants'
import {logger} from '#/logger'
import * as persisted from '#/state/persisted'
import {useSession} from '#/state/session'
import {atoms as a, platform, useBreakpoints, useTheme, web} from '#/alf'
@@ -17,6 +15,7 @@ import * as TextField from '#/components/forms/TextField'
import {Globe_Stroke2_Corner0_Rounded as Globe} from '#/components/icons/Globe'
import {InlineLinkText} from '#/components/Link'
import {Text} from '#/components/Typography'
import {useAnalytics} from '#/analytics'
type SegmentedControlOptions = typeof BSKY_SERVICE | 'custom'
@@ -27,6 +26,7 @@ export function ServerInputDialog({
control: Dialog.DialogOuterProps['control']
onSelect: (url: string) => void
}) {
const ax = useAnalytics()
const {height} = useWindowDimensions()
const formRef = useRef<DialogInnerRef>(null)
@@ -43,10 +43,10 @@ export function ServerInputDialog({
setPreviousCustomAddress(result)
}
}
logger.metric('signin:hostingProviderPressed', {
ax.metric('signin:hostingProviderPressed', {
hostingProviderDidChange: fixedOption !== BSKY_SERVICE,
})
}, [onSelect, fixedOption])
}, [ax, onSelect, fixedOption])
return (
<Dialog.Outer