Skip to content

Commit

Permalink
style: move functions into bottom sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
MuckT committed Jul 8, 2024
1 parent 32b452a commit 685f385
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions src/keylessBackup/SignInWithEmail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,35 @@ import Logger from 'src/utils/Logger'
const TAG = 'keylessBackup/SignInWithEmail'

function SignInWithEmailBottomSheet({
onPressContinue,
onPressSkip,
keylessBackupFlow,
origin,
bottomSheetRef,
}: {
onPressContinue: () => void
onPressSkip: () => void
keylessBackupFlow: KeylessBackupFlow
origin: KeylessBackupOrigin
bottomSheetRef: React.RefObject<BottomSheetRefType>
}) {
const { t } = useTranslation()
const onboardingProps = useSelector(onboardingPropsSelector)
const onPressContinue = () => {
ValoraAnalytics.track(KeylessBackupEvents.cab_setup_recovery_phrase)
bottomSheetRef.current?.close()
goToNextOnboardingScreen({
firstScreenInCurrentStep: Screens.SignInWithEmail,
onboardingProps: { ...onboardingProps, showRecoveryPhraseEducation: true },
})
}

const onPressSkip = () => {
ValoraAnalytics.track(KeylessBackupEvents.cab_sign_in_with_email_screen_skip, {
keylessBackupFlow,
origin,
})
goToNextOnboardingScreen({
firstScreenInCurrentStep: Screens.SignInWithEmail,
onboardingProps,
})
}

return (
<BottomSheet
Expand Down Expand Up @@ -102,26 +122,6 @@ function SignInWithEmail({ route }: Props) {
bottomSheetRef.current?.snapToIndex(0)
}

const onPressContinue = () => {
ValoraAnalytics.track(KeylessBackupEvents.cab_setup_recovery_phrase)
bottomSheetRef.current?.close()
goToNextOnboardingScreen({
firstScreenInCurrentStep: Screens.SignInWithEmail,
onboardingProps: { ...onboardingProps, showRecoveryPhraseEducation: true },
})
}

const onPressSkip = () => {
ValoraAnalytics.track(KeylessBackupEvents.cab_sign_in_with_email_screen_skip, {
keylessBackupFlow,
origin,
})
goToNextOnboardingScreen({
firstScreenInCurrentStep: Screens.SignInWithEmail,
onboardingProps,
})
}

const onPressGoogle = async () => {
setLoading(true)
dispatch(
Expand Down Expand Up @@ -227,8 +227,8 @@ function SignInWithEmail({ route }: Props) {
</View>
{isSetupInOnboarding && (
<SignInWithEmailBottomSheet
onPressContinue={onPressContinue}
onPressSkip={onPressSkip}
keylessBackupFlow={keylessBackupFlow}
origin={origin}
bottomSheetRef={bottomSheetRef}
/>
)}
Expand Down

0 comments on commit 685f385

Please sign in to comment.