The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update email verification page
Tim Wilsona237eb67231e
diff --git a/apps/web/app/app.dub.co/(auth)/register/page-client.tsx b/apps/web/app/app.dub.co/(auth)/register/page-client.tsxindex ced8449870..5c41859dae 100644--- a/apps/web/app/app.dub.co/(auth)/register/page-client.tsx+++ b/apps/web/app/app.dub.co/(auth)/register/page-client.tsx@@ -46,29 +46,22 @@ function Verify() {return (<>- <div className="w-full max-w-md overflow-hidden border-y border-neutral-200 sm:rounded-2xl sm:border sm:shadow-sm">- <div className="flex flex-col items-center justify-center gap-3 border-b border-neutral-200 bg-white px-4 pb-6 pt-8 text-center sm:px-16">- <h3 className="text-xl font-semibold">Verify your email address</h3>- <p className="text-sm text-neutral-500">+ <div className="w-full max-w-sm">+ <div className="flex flex-col items-center gap-1 text-center">+ <h3 className="text-center text-xl font-semibold">+ Verify your email address+ </h3>+ <p className="text-base font-medium text-neutral-500">Enter the six digit verification code sent to{" "}- <strong className="font-medium text-neutral-600" title={email}>+ <strong className="font-semibold text-neutral-600" title={email}>{truncate(email, 30)}</strong></p></div>- <div className="bg-neutral-50 px-4 py-8 sm:px-16">+ <div className="mt-12"><VerifyEmailForm /></div></div>- <p className="mt-4 text-center text-sm text-neutral-500">- Already have an account? - <Link- href="/login"- className="font-semibold text-neutral-500 underline underline-offset-2 transition-colors hover:text-black"- >- Sign in- </Link>- </p></>);}diff --git a/apps/web/ui/auth/register/resend-otp.tsx b/apps/web/ui/auth/register/resend-otp.tsxindex 668c3168f2..77971e3c95 100644--- a/apps/web/ui/auth/register/resend-otp.tsx+++ b/apps/web/ui/auth/register/resend-otp.tsx@@ -39,7 +39,7 @@ export const ResendOtp = ({ email }: { email: string }) => {}, [delaySeconds]);return (- <div className="relative mt-4 text-center text-sm text-neutral-500">+ <div className="relative mt-4 text-center text-sm font-medium text-neutral-500">{state === "default" && (<>{isPending && (@@ -53,7 +53,7 @@ export const ResendOtp = ({ email }: { email: string }) => {<buttononClick={() => executeAsync({ email })}className={cn(- "font-semibold text-neutral-500 underline underline-offset-2 transition-colors hover:text-black",+ "font-semibold text-neutral-700 transition-colors hover:text-neutral-900",isPending && "pointer-events-none",)}>diff --git a/apps/web/ui/auth/register/verify-email-form.tsx b/apps/web/ui/auth/register/verify-email-form.tsxindex e90119145c..ef6c0d4ff4 100644--- a/apps/web/ui/auth/register/verify-email-form.tsx+++ b/apps/web/ui/auth/register/verify-email-form.tsx@@ -53,69 +53,67 @@ export const VerifyEmailForm = () => {return (<div className="flex flex-col gap-3">- <AnimatedSizeContainer height>- <form- onSubmit={(e) => {- e.preventDefault();- executeAsync({ email, password, code });- }}- >- <div>- <OTPInput- maxLength={6}- value={code}- onChange={(code) => {- setIsInvalidCode(false);- setCode(code);- }}- autoFocus={!isMobile}- containerClassName="group flex items-center justify-center"- render={({ slots }) => (- <div className="flex items-center">- {slots.map(({ char, isActive, hasFakeCaret }, idx) => (- <div- key={idx}- className={cn(- "relative flex h-14 w-10 items-center justify-center text-xl",- "border-y border-r border-neutral-200 bg-white first:rounded-l-lg first:border-l last:rounded-r-lg",- "ring-0 transition-all",- isActive &&- "z-10 border border-neutral-500 ring-2 ring-neutral-200",- isInvalidCode && "border-red-500 ring-red-200",- )}- >- {char}- {hasFakeCaret && (- <div className="animate-caret-blink pointer-events-none absolute inset-0 flex items-center justify-center">- <div className="h-5 w-px bg-black" />- </div>- )}- </div>- ))}- </div>- )}- onComplete={() => {- executeAsync({ email, password, code });- }}- />+ <form+ onSubmit={(e) => {+ e.preventDefault();+ executeAsync({ email, password, code });+ }}+ >+ <div>+ <OTPInput+ maxLength={6}+ value={code}+ onChange={(code) => {+ setIsInvalidCode(false);+ setCode(code);+ }}+ autoFocus={!isMobile}+ render={({ slots }) => (+ <div className="flex w-full items-center justify-between">+ {slots.map(({ char, isActive, hasFakeCaret }, idx) => (+ <div+ key={idx}+ className={cn(+ "relative flex h-14 w-12 items-center justify-center text-xl",+ "rounded-lg border border-neutral-200 bg-white ring-0 transition-all",+ isActive &&+ "z-10 border border-neutral-800 ring-2 ring-neutral-200",+ isInvalidCode && "border-red-500 ring-red-200",+ )}+ >+ {char}+ {hasFakeCaret && (+ <div className="animate-caret-blink pointer-events-none absolute inset-0 flex items-center justify-center">+ <div className="h-5 w-px bg-black" />+ </div>+ )}+ </div>+ ))}+ </div>+ )}+ onComplete={() => {+ executeAsync({ email, password, code });+ }}+ />+ <AnimatedSizeContainer height>{isInvalidCode && (- <p className="mt-2 text-center text-sm text-red-500">+ <p className="pt-3 text-center text-xs font-medium text-red-500">Invalid code. Please try again.</p>)}+ </AnimatedSizeContainer>- <Button- className="mt-8"- text={isPending ? "Verifying..." : "Continue"}- type="submit"- loading={isPending || isRedirecting}- disabled={!code || code.length < 6}- />- </div>- </form>+ <Button+ className="mt-8"+ text={isPending ? "Verifying..." : "Continue"}+ type="submit"+ loading={isPending || isRedirecting}+ disabled={!code || code.length < 6}+ />+ </div>+ </form>- <ResendOtp email={email} />- </AnimatedSizeContainer>+ <ResendOtp email={email} /></div>);};