diff --git a/app/components/forms.tsx b/app/components/forms.tsx index 61ebb850..56513d99 100644 --- a/app/components/forms.tsx +++ b/app/components/forms.tsx @@ -114,12 +114,20 @@ export function OTPField({ errors, className, type, + slotClassName, + groupClassName, + separatorClassName, + showSeparator = true, }: { labelProps: React.LabelHTMLAttributes inputProps: Partial errors?: ListOfErrors className?: string type: 'digits' | 'digits-and-characters' + slotClassName?: string + groupClassName?: string + separatorClassName?: string + showSeparator?: boolean }) { const fallbackId = useId() const id = inputProps.id ?? fallbackId @@ -138,17 +146,19 @@ export function OTPField({ aria-describedby={errorId} {...inputProps} > - - - - - - - - - - - + + + + + + {showSeparator ? ( + + ) : null} + + + + +
{errorId ? : null} diff --git a/app/routes/_app+/_auth+/verify.tsx b/app/routes/_app+/_auth+/verify.tsx index b62247e1..85b7668c 100644 --- a/app/routes/_app+/_auth+/verify.tsx +++ b/app/routes/_app+/_auth+/verify.tsx @@ -11,7 +11,7 @@ import { HoneypotInputs } from 'remix-utils/honeypot/react' import { z } from 'zod' import { GeneralErrorBoundary } from '#app/components/error-boundary.tsx' import { ErrorList, OTPField } from '#app/components/forms.tsx' -import { Spacer } from '#app/components/spacer.tsx' +import { Icon } from '#app/components/ui/icon.tsx' import { StatusButton } from '#app/components/ui/status-button.tsx' import { checkHoneypot } from '#app/utils/honeypot.server.ts' import { useIsPending } from '#app/utils/misc.tsx' @@ -53,36 +53,32 @@ export default function VerifyRoute() { ) const type = parseWithZoddType.success ? parseWithZoddType.data : null - const checkPhoneNumber = ( + const headingClasses = 'text-h2 sm:text-h1' + const bodyClasses = 'text-body-md text-muted-foreground mt-4' + const buildHeading = (title: string, description: string) => ( <> -

Check your texts

-

- We've texted you a code to verify your phone number. -

+

{title}

+

{description}

) + const checkPhoneNumber = buildHeading( + 'Check Your Texts', + "We've texted you a code to verify your phone number", + ) const headings: Record = { onboarding: checkPhoneNumber, 'reset-password': checkPhoneNumber, 'change-phone-number': checkPhoneNumber, 'validate-recipient': ( - <> -

Check your texts

-

- We've texted you a code to verify the phone number you gave us. Please - inform your recipient of what you're up to and ask your recipient to - provide you with that code. -

- + buildHeading( + 'Check Your Texts', + "We've texted you a code to verify the phone number you gave us. Please inform your recipient of what you're up to and ask your recipient to provide you with that code.", + ) ), - '2fa': ( - <> -

Check your 2FA app

-

- Please enter your 2FA code to verify your identity. -

- + '2fa': buildHeading( + 'Check Your 2FA App', + 'Please enter your 2FA code to verify your identity.', ), } @@ -110,40 +106,41 @@ export default function VerifyRoute() { }) return ( -
-
-

- GratiText -

+
+
{type ? headings[type] : 'Invalid Verification Type'}
- - -
- -
+
+ -
- -
-
- Didn't get it? + + +
+ No text after 5 minutes? Resend the Code @@ -160,12 +157,16 @@ export default function VerifyRoute() { })} /> - Continue + + Continue +