Skip to content

Commit

Permalink
fix(web): Better message when signups are disabled (#374)
Browse files Browse the repository at this point in the history
* Clear disabled signups message

* Change the message and center it

---------

Co-authored-by: MohamedBassem <me@mbassem.com>
  • Loading branch information
nghduc97 and MohamedBassem authored Sep 15, 2024
1 parent b9724b7 commit 34fb5fb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions apps/web/components/signin/CredentialsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ function SignIn() {
}

function SignUp() {
const clientConfig = useClientConfig();
const form = useForm<z.infer<typeof zSignUpSchema>>({
resolver: zodResolver(zSignUpSchema),
});
Expand Down Expand Up @@ -212,11 +211,7 @@ function SignUp() {
);
}}
/>
<ActionButton
type="submit"
loading={form.formState.isSubmitting}
disabled={clientConfig.auth.disableSignups}
>
<ActionButton type="submit" loading={form.formState.isSubmitting}>
Sign Up
</ActionButton>
</div>
Expand All @@ -226,6 +221,8 @@ function SignUp() {
}

export default function CredentialsForm() {
const clientConfig = useClientConfig();

return (
<Tabs defaultValue="signin" className="w-full">
<TabsList className="grid w-full grid-cols-2">
Expand All @@ -236,7 +233,11 @@ export default function CredentialsForm() {
<SignIn />
</TabsContent>
<TabsContent value="signup">
<SignUp />
{clientConfig.auth.disableSignups ? (
<p className="text-center">Signups are currently disabled.</p>
) : (
<SignUp />
)}
</TabsContent>
</Tabs>
);
Expand Down

0 comments on commit 34fb5fb

Please sign in to comment.