From 647874fd44917c5288a4231452ace277c644b039 Mon Sep 17 00:00:00 2001 From: Alex Carpenter Date: Thu, 15 Aug 2024 11:50:35 -0400 Subject: [PATCH] chore(ui): Implement loading scopes --- .../sign-in/steps/reset-password.tsx | 30 +-- .../ui/src/components/sign-in/steps/start.tsx | 2 +- .../sign-in/steps/verifications.tsx | 213 ++++++++---------- .../src/components/sign-up/steps/continue.tsx | 16 +- .../ui/src/components/sign-up/steps/start.tsx | 16 +- .../sign-up/steps/verifications.tsx | 32 +-- 6 files changed, 145 insertions(+), 164 deletions(-) diff --git a/packages/ui/src/components/sign-in/steps/reset-password.tsx b/packages/ui/src/components/sign-in/steps/reset-password.tsx index f30b652978a..5767e3221e9 100644 --- a/packages/ui/src/components/sign-in/steps/reset-password.tsx +++ b/packages/ui/src/components/sign-in/steps/reset-password.tsx @@ -66,32 +66,32 @@ export function SignInResetPassword() { - - {isSubmitting => { - return ( - + + + {isSubmitting => { + return ( + ); + }} + - - {t('backButton')} - - - ); - }} - + + {t('backButton')} + + diff --git a/packages/ui/src/components/sign-in/steps/start.tsx b/packages/ui/src/components/sign-in/steps/start.tsx index 8ea52cf27cc..9808f609085 100644 --- a/packages/ui/src/components/sign-in/steps/start.tsx +++ b/packages/ui/src/components/sign-in/steps/start.tsx @@ -168,7 +168,7 @@ export function SignInStart() { {t('signIn.start.actionLink__use_passkey')} diff --git a/packages/ui/src/components/sign-in/steps/verifications.tsx b/packages/ui/src/components/sign-in/steps/verifications.tsx index 5a8b0914400..97d05c0d645 100644 --- a/packages/ui/src/components/sign-in/steps/verifications.tsx +++ b/packages/ui/src/components/sign-in/steps/verifications.tsx @@ -92,10 +92,10 @@ export function SignInVerifications() { /> - - {isSubmitting => { - return ( - + + + {isSubmitting => { + return ( + ); + }} + - - - {t('signIn.password.actionLink')} - - - - ); - }} - + + {t('signIn.password.actionLink')} + + @@ -155,22 +153,10 @@ export function SignInVerifications() { - - {isSubmitting => { - return ( - - { - // Note: - // 1. Currently this triggers the loading - // spinner for "Continue" which is a little - // confusing. We could use a manual setState - // on click, but we'll need to find a way to - // clean up the state based on `isSubmitting` - // 2. This button doesn't currently work; it's - // being tracked here: - // https://linear.app/clerk/issue/SDKI-172 - } - + + + {isSubmitting => { + return ( - - - - {t('footerActionLink__useAnotherMethod')} - - - - ); - }} - + ); + }} + + + {t('footerActionLink__useAnotherMethod')} + + @@ -217,10 +200,10 @@ export function SignInVerifications() { - - {isSubmitting => { - return ( - + + + {isSubmitting => { + return ( - - - - {t('footerActionLink__useAnotherMethod')} - - - - ); - }} - + ); + }} + + + + {t('footerActionLink__useAnotherMethod')} + + + @@ -307,10 +289,10 @@ export function SignInVerifications() { } /> - - {isSubmitting => { - return ( - + + + {isSubmitting => { + return ( + ); + }} + - - {t('footerActionLink__useAnotherMethod')} - - - ); - }} - + + {t('footerActionLink__useAnotherMethod')} + + @@ -393,10 +375,10 @@ export function SignInVerifications() { /> - - {isSubmitting => { - return ( - + + + {isSubmitting => { + return ( + ); + }} + - - {t('footerActionLink__useAnotherMethod')} - - - ); - }} - + + {t('footerActionLink__useAnotherMethod')} + + @@ -517,10 +499,10 @@ export function SignInVerifications() { /> - - {isSubmitting => { - return ( - + + + {isSubmitting => { + return ( - - ); - }} - + ); + }} + + @@ -561,10 +543,10 @@ export function SignInVerifications() { /> - - {isSubmitting => { - return ( - + + + {isSubmitting => { + return ( - - - {t('footerActionLink__useAnotherMethod')} - - - ); - }} - + ); + }} + + + {t('footerActionLink__useAnotherMethod')} + + diff --git a/packages/ui/src/components/sign-up/steps/continue.tsx b/packages/ui/src/components/sign-up/steps/continue.tsx index 69cbb2e3f4e..37c02d3848a 100644 --- a/packages/ui/src/components/sign-up/steps/continue.tsx +++ b/packages/ui/src/components/sign-up/steps/continue.tsx @@ -97,10 +97,10 @@ export function SignUpContinue() { ) : null} - - {isSubmitting => { - return ( - + + + {isSubmitting => { + return ( - - ); - }} - + ); + }} + + diff --git a/packages/ui/src/components/sign-up/steps/start.tsx b/packages/ui/src/components/sign-up/steps/start.tsx index 466b01f4334..2a37c627bb3 100644 --- a/packages/ui/src/components/sign-up/steps/start.tsx +++ b/packages/ui/src/components/sign-up/steps/start.tsx @@ -133,10 +133,10 @@ export function SignUpStart() { {userSettings.signUp.captcha_enabled ? : null} {hasConnection || hasIdentifier ? ( - - {isSubmitting => { - return ( - + + + {isSubmitting => { + return ( - - ); - }} - + ); + }} + + ) : null} diff --git a/packages/ui/src/components/sign-up/steps/verifications.tsx b/packages/ui/src/components/sign-up/steps/verifications.tsx index 771ac5b0591..4233155075e 100644 --- a/packages/ui/src/components/sign-up/steps/verifications.tsx +++ b/packages/ui/src/components/sign-up/steps/verifications.tsx @@ -120,10 +120,10 @@ export function SignUpVerifications() { } /> - - {isSubmitting => { - return ( - + + + {isSubmitting => { + return ( - - ); - }} - + ); + }} + + @@ -198,10 +198,10 @@ export function SignUpVerifications() { } /> - - {isSubmitting => { - return ( - + + + {isSubmitting => { + return ( - - ); - }} - + ); + }} + +