diff --git a/packages/app/features/auth/layout.web.tsx b/packages/app/features/auth/layout.web.tsx index 35f5ea53f..8745dd862 100644 --- a/packages/app/features/auth/layout.web.tsx +++ b/packages/app/features/auth/layout.web.tsx @@ -25,13 +25,13 @@ export function AuthLayout({ children }: { children: React.ReactNode }) { return ( - + - + {children} diff --git a/packages/app/features/auth/onboarding/__snapshots__/screen.test.tsx.snap b/packages/app/features/auth/onboarding/__snapshots__/screen.test.tsx.snap index 82074f566..5f1a4fc6b 100644 --- a/packages/app/features/auth/onboarding/__snapshots__/screen.test.tsx.snap +++ b/packages/app/features/auth/onboarding/__snapshots__/screen.test.tsx.snap @@ -83,21 +83,6 @@ exports[`OnboardingScreen 1`] = ` } } > - - Passkey Name - Why Passkey? + + + diff --git a/packages/app/features/auth/onboarding/onboarding-form.tsx b/packages/app/features/auth/onboarding/onboarding-form.tsx index e367583e7..e2a1d39ae 100644 --- a/packages/app/features/auth/onboarding/onboarding-form.tsx +++ b/packages/app/features/auth/onboarding/onboarding-form.tsx @@ -5,6 +5,7 @@ import { ButtonText, H3, Paragraph, + Stack, SubmitButton, Theme, XStack, @@ -39,7 +40,7 @@ export const OnboardingForm = () => { ? Device.deviceName : `My ${Device.modelName ?? 'Send Account'}` - const [attempts, setAttempts] = useState(0) + const [errorMessage, setErrorMessage] = useState() async function createAccount({ accountName }: z.infer) { try { @@ -78,12 +79,13 @@ export const OnboardingForm = () => { replace('/') return } - setAttempts((a) => a + 1) + setErrorMessage('Account not created. Please try again.') form.setError('accountName', { type: 'custom' }) }) } catch (error) { console.error('Error creating account', error) - setAttempts((a) => a + 1) + const message = error?.message.split('.')[0] ?? 'Unknown error' + setErrorMessage(message) form.setError('accountName', { type: 'custom' }) } } @@ -124,56 +126,58 @@ export const OnboardingForm = () => { }, }} renderAfter={({ submit }) => ( - - - Why Passkey? - - - 0 ? 'yellow_active' : 'green'} - mb="auto" - als="auto" - r - br="$4" - mx="auto" + <> + - - {attempts > 0 ? 'Try again' : 'CREATE PASSKEY'} - - - + Why Passkey? + + + + + {errorMessage ? 'Try again' : 'CREATE PASSKEY'} + + + + )} > {(fields) => ( @@ -193,11 +197,6 @@ export const OnboardingForm = () => { time - - - Passkey Name - - {Object.values(fields)} { > Why Passkey? + + + {errorMessage} + +