diff --git a/apps/web/src/app/(unauthenticated)/layout.tsx b/apps/web/src/app/(unauthenticated)/layout.tsx index 03a73278f..05055d508 100644 --- a/apps/web/src/app/(unauthenticated)/layout.tsx +++ b/apps/web/src/app/(unauthenticated)/layout.tsx @@ -10,7 +10,7 @@ type UnauthenticatedLayoutProps = { export default function UnauthenticatedLayout({ children }: UnauthenticatedLayoutProps) { return ( -
+
diff --git a/apps/web/src/components/forms/v2/signup.tsx b/apps/web/src/components/forms/v2/signup.tsx index a7e33a759..b3b502993 100644 --- a/apps/web/src/components/forms/v2/signup.tsx +++ b/apps/web/src/components/forms/v2/signup.tsx @@ -108,17 +108,6 @@ export const SignUpFormV2 = ({ const name = form.watch('name'); const url = form.watch('url'); - // To continue we need to make sure name, email, password and signature are valid - const canContinue = - form.formState.dirtyFields.name && - form.formState.errors.name === undefined && - form.formState.dirtyFields.email && - form.formState.errors.email === undefined && - form.formState.dirtyFields.password && - form.formState.errors.password === undefined && - form.formState.dirtyFields.signature && - form.formState.errors.signature === undefined; - const { mutateAsync: signup } = trpc.auth.signup.useMutation(); const onFormSubmit = async ({ name, email, password, signature, url }: TSignUpFormV2Schema) => { @@ -169,6 +158,14 @@ export const SignUpFormV2 = ({ } }; + const onNextClick = async () => { + const valid = await form.trigger(['name', 'email', 'password', 'signature']); + + if (valid) { + setStep('CLAIM_USERNAME'); + } + }; + const onSignUpWithGoogleClick = async () => { try { await signIn('google', { callbackUrl: SIGN_UP_REDIRECT_PATH }); @@ -224,7 +221,7 @@ export const SignUpFormV2 = ({
-
+
{step === 'BASIC_DETAILS' && (

Create a new account

@@ -257,8 +254,8 @@ export const SignUpFormV2 = ({ {step === 'BASIC_DETAILS' && (
@@ -360,8 +357,8 @@ export const SignUpFormV2 = ({ {step === 'CLAIM_USERNAME' && (
@@ -431,9 +428,8 @@ export const SignUpFormV2 = ({ type="button" size="lg" className="flex-1 disabled:cursor-not-allowed" - disabled={!canContinue} loading={form.formState.isSubmitting} - onClick={() => setStep('CLAIM_USERNAME')} + onClick={onNextClick} > Next