Skip to content

Commit

Permalink
move auth error above submit button
Browse files Browse the repository at this point in the history
  • Loading branch information
xvvvyz committed Mar 14, 2024
1 parent 0dd8efb commit 054cdd8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/_components/change-password-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ const ChangePasswordForm = () => {
required
type="password"
/>
{state?.error && <p className="text-center">{state.error}</p>}
<Button
className="mt-8 w-full"
loadingText="Changing password…"
type="submit"
>
Change password
</Button>
{state?.error && <p className="text-center">{state.error}</p>}
</form>
);
};
Expand Down
2 changes: 1 addition & 1 deletion app/_components/forgot-password-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const ForgotPasswordForm = () => {
return (
<form action={action} className="flex flex-col gap-6">
<Input label="Email address" name="email" required type="email" />
{state?.error && <p className="text-center">{state.error}</p>}
<Button className="mt-8 w-full" loadingText="Sending link…" type="submit">
Send reset link
</Button>
{state?.error && <p className="text-center">{state.error}</p>}
</form>
);
};
Expand Down
2 changes: 1 addition & 1 deletion app/_components/sign-in-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ const SignInForm = ({ next }: SignInFormProps) => {
Forgot password?
</Button>
</div>
{state?.error && <p className="text-center">{state.error}</p>}
<Button className="mt-8 w-full" loadingText="Signing in…" type="submit">
Sign in
</Button>
{state?.error && <p className="text-center">{state.error}</p>}
</form>
);
};
Expand Down
2 changes: 1 addition & 1 deletion app/_components/sign-up-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ const SignUpForm = ({ next }: SignUpFormProps) => {
required
type="password"
/>
{state?.error && <p className="text-center">{state.error}</p>}
<Button
className="mt-8 w-full"
loadingText="Creating account…"
type="submit"
>
Create account
</Button>
{state?.error && <p className="text-center">{state.error}</p>}
</form>
);
};
Expand Down

0 comments on commit 054cdd8

Please sign in to comment.