diff options
author | Hailey <me@haileyok.com> | 2024-10-10 15:02:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-10 15:02:36 -0700 |
commit | 2ebe8f435bf573932c14c06aaa2dc3b55ad363c6 (patch) | |
tree | b99eca3a67ef69d9c56aa830e154d89e7b816b39 /src/view | |
parent | 912b4450b9489b5b7a60ce72323bd083e2a3db46 (diff) | |
download | voidsky-2ebe8f435bf573932c14c06aaa2dc3b55ad363c6.tar.zst |
Update the email verification dialog (#5663)
Diffstat (limited to 'src/view')
-rw-r--r-- | src/view/com/composer/videos/SelectVideoBtn.tsx | 37 | ||||
-rw-r--r-- | src/view/screens/Settings/index.tsx | 6 |
2 files changed, 22 insertions, 21 deletions
diff --git a/src/view/com/composer/videos/SelectVideoBtn.tsx b/src/view/com/composer/videos/SelectVideoBtn.tsx index bbb3d95f2..2ba003a6d 100644 --- a/src/view/com/composer/videos/SelectVideoBtn.tsx +++ b/src/view/com/composer/videos/SelectVideoBtn.tsx @@ -15,10 +15,11 @@ import {useVideoLibraryPermission} from '#/lib/hooks/usePermissions' import {getHostnameFromUrl} from '#/lib/strings/url-helpers' import {isWeb} from '#/platform/detection' import {isNative} from '#/platform/detection' -import {useModalControls} from '#/state/modals' import {useSession} from '#/state/session' import {atoms as a, useTheme} from '#/alf' import {Button} from '#/components/Button' +import {useDialogControl} from '#/components/Dialog' +import {VerifyEmailDialog} from '#/components/dialogs/VerifyEmailDialog' import {VideoClip_Stroke2_Corner0_Rounded as VideoClipIcon} from '#/components/icons/VideoClip' import * as Prompt from '#/components/Prompt' @@ -121,26 +122,24 @@ export function SelectVideoBtn({onSelectVideo, disabled, setError}: Props) { function VerifyEmailPrompt({control}: {control: Prompt.PromptControlProps}) { const {_} = useLingui() - const {openModal} = useModalControls() + const verifyEmailDialogControl = useDialogControl() return ( - <Prompt.Basic - control={control} - title={_(msg`Verified email required`)} - description={_( - msg`To upload videos to Bluesky, you must first verify your email.`, - )} - confirmButtonCta={_(msg`Verify now`)} - confirmButtonColor="primary" - onConfirm={() => { - control.close(() => { - openModal({ - name: 'verify-email', - showReminder: false, - }) - }) - }} - /> + <> + <Prompt.Basic + control={control} + title={_(msg`Verified email required`)} + description={_( + msg`To upload videos to Bluesky, you must first verify your email.`, + )} + confirmButtonCta={_(msg`Verify now`)} + confirmButtonColor="primary" + onConfirm={() => { + verifyEmailDialogControl.open() + }} + /> + <VerifyEmailDialog control={verifyEmailDialogControl} /> + </> ) } diff --git a/src/view/screens/Settings/index.tsx b/src/view/screens/Settings/index.tsx index a2b767097..a40cc4f26 100644 --- a/src/view/screens/Settings/index.tsx +++ b/src/view/screens/Settings/index.tsx @@ -56,6 +56,7 @@ import {DeactivateAccountDialog} from '#/screens/Settings/components/DeactivateA import {atoms as a, useTheme} from '#/alf' import {useDialogControl} from '#/components/Dialog' import {BirthDateSettingsDialog} from '#/components/dialogs/BirthDateSettings' +import {VerifyEmailDialog} from '#/components/dialogs/VerifyEmailDialog' import {Email2FAToggle} from './Email2FAToggle' import {ExportCarDialog} from './ExportCarDialog' @@ -927,7 +928,7 @@ function EmailConfirmationNotice() { const palInverted = usePalette('inverted') const {_} = useLingui() const {isMobile} = useWebMediaQueries() - const {openModal} = useModalControls() + const verifyEmailDialogControl = useDialogControl() return ( <View style={{marginBottom: 20}}> @@ -959,7 +960,7 @@ function EmailConfirmationNotice() { accessibilityRole="button" accessibilityLabel={_(msg`Verify my email`)} accessibilityHint={_(msg`Opens modal for email verification`)} - onPress={() => openModal({name: 'verify-email'})}> + onPress={() => verifyEmailDialogControl.open()}> <FontAwesomeIcon icon="envelope" color={palInverted.colors.text} @@ -974,6 +975,7 @@ function EmailConfirmationNotice() { <Trans>Protect your account by verifying your email.</Trans> </Text> </View> + <VerifyEmailDialog control={verifyEmailDialogControl} /> </View> ) } |