Migrate remaining tricky spot
This commit is contained in:
@@ -2,6 +2,7 @@ import {useCallback, useState} from 'react'
|
|||||||
import {LayoutAnimationConfig} from 'react-native-reanimated'
|
import {LayoutAnimationConfig} from 'react-native-reanimated'
|
||||||
import {SafeAreaView} from 'react-native-safe-area-context'
|
import {SafeAreaView} from 'react-native-safe-area-context'
|
||||||
|
|
||||||
|
import {useRunCallbackOnce} from '#/lib/runCallbackOnce'
|
||||||
import {FindContactsFlow} from '#/components/contacts/FindContactsFlow'
|
import {FindContactsFlow} from '#/components/contacts/FindContactsFlow'
|
||||||
import {type Action, type State} from '#/components/contacts/state'
|
import {type Action, type State} from '#/components/contacts/state'
|
||||||
import {ScreenTransition} from '#/components/ScreenTransition'
|
import {ScreenTransition} from '#/components/ScreenTransition'
|
||||||
@@ -18,6 +19,10 @@ export function StepFindContacts({
|
|||||||
const {dispatch} = useOnboardingInternalState()
|
const {dispatch} = useOnboardingInternalState()
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
|
|
||||||
|
useRunCallbackOnce(() => {
|
||||||
|
ax.metric('onboarding:contacts:begin', {})
|
||||||
|
})
|
||||||
|
|
||||||
const [transitionDirection, setTransitionDirection] = useState<
|
const [transitionDirection, setTransitionDirection] = useState<
|
||||||
'Forward' | 'Backward'
|
'Forward' | 'Backward'
|
||||||
>('Forward')
|
>('Forward')
|
||||||
|
|||||||
@@ -5,11 +5,13 @@ import {useLingui} from '@lingui/react'
|
|||||||
import {useQuery} from '@tanstack/react-query'
|
import {useQuery} from '@tanstack/react-query'
|
||||||
|
|
||||||
import {urls} from '#/lib/constants'
|
import {urls} from '#/lib/constants'
|
||||||
|
import {useRunCallbackOnce} from '#/lib/runCallbackOnce'
|
||||||
import {atoms as a} from '#/alf'
|
import {atoms as a} from '#/alf'
|
||||||
import {Admonition} from '#/components/Admonition'
|
import {Admonition} from '#/components/Admonition'
|
||||||
import {Button, ButtonText} from '#/components/Button'
|
import {Button, ButtonText} from '#/components/Button'
|
||||||
import {ContactsHeroImage} from '#/components/contacts/components/HeroImage'
|
import {ContactsHeroImage} from '#/components/contacts/components/HeroImage'
|
||||||
import {InlineLinkText} from '#/components/Link'
|
import {InlineLinkText} from '#/components/Link'
|
||||||
|
import {useAnalytics} from '#/analytics'
|
||||||
import {
|
import {
|
||||||
OnboardingControls,
|
OnboardingControls,
|
||||||
OnboardingDescriptionText,
|
OnboardingDescriptionText,
|
||||||
@@ -19,9 +21,14 @@ import {
|
|||||||
import {useOnboardingInternalState} from '../state'
|
import {useOnboardingInternalState} from '../state'
|
||||||
|
|
||||||
export function StepFindContactsIntro() {
|
export function StepFindContactsIntro() {
|
||||||
|
const ax = useAnalytics()
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const {dispatch} = useOnboardingInternalState()
|
const {dispatch} = useOnboardingInternalState()
|
||||||
|
|
||||||
|
useRunCallbackOnce(() => {
|
||||||
|
ax.metric('onboarding:contacts:presented', {})
|
||||||
|
})
|
||||||
|
|
||||||
const {data: isAvailable, isSuccess} = useQuery({
|
const {data: isAvailable, isSuccess} = useQuery({
|
||||||
queryKey: ['contacts-available'],
|
queryKey: ['contacts-available'],
|
||||||
queryFn: async () => await Contacts.isAvailableAsync(),
|
queryFn: async () => await Contacts.isAvailableAsync(),
|
||||||
|
|||||||
@@ -172,15 +172,6 @@ export function reducer(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (a.type === 'next') {
|
|
||||||
if (next.activeStep === 'find-contacts-intro') {
|
|
||||||
logger.metric('onboarding:contacts:presented', {})
|
|
||||||
}
|
|
||||||
if (next.activeStep === 'find-contacts') {
|
|
||||||
logger.metric('onboarding:contacts:begin', {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const state = {
|
const state = {
|
||||||
...next,
|
...next,
|
||||||
hasPrev: next.activeStep !== 'profile',
|
hasPrev: next.activeStep !== 'profile',
|
||||||
|
|||||||
Reference in New Issue
Block a user