diff options
| author | Nguyễn Hoàng Đức <lazyc97@protonmail.com> | 2024-09-16 00:16:21 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-15 18:16:21 +0100 |
| commit | 34fb5fba79ce354191cebdc44883b71c550f4323 (patch) | |
| tree | 8cec246cd2da6010f7923f13b0c4ac8545fcc4d9 /apps | |
| parent | b9724b71d71433e63013e5bf641889a4ba3d461b (diff) | |
| download | karakeep-34fb5fba79ce354191cebdc44883b71c550f4323.tar.zst | |
fix(web): Better message when signups are disabled (#374)
* Clear disabled signups message
* Change the message and center it
---------
Co-authored-by: MohamedBassem <me@mbassem.com>
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/web/components/signin/CredentialsForm.tsx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/apps/web/components/signin/CredentialsForm.tsx b/apps/web/components/signin/CredentialsForm.tsx index 65fec6a8..a505f699 100644 --- a/apps/web/components/signin/CredentialsForm.tsx +++ b/apps/web/components/signin/CredentialsForm.tsx @@ -108,7 +108,6 @@ function SignIn() { } function SignUp() { - const clientConfig = useClientConfig(); const form = useForm<z.infer<typeof zSignUpSchema>>({ resolver: zodResolver(zSignUpSchema), }); @@ -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> @@ -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"> @@ -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> ); |
