From 95fc3a0825795b15a387707ac8cb2cb0df3f4c27 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Fri, 22 Mar 2024 15:31:55 +0000
Subject: feature: Add an option to disable new signups

---
 apps/web/components/signin/CredentialsForm.tsx | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'apps/web/components/signin/CredentialsForm.tsx')

diff --git a/apps/web/components/signin/CredentialsForm.tsx b/apps/web/components/signin/CredentialsForm.tsx
index 8e1423eb..5e3b4de9 100644
--- a/apps/web/components/signin/CredentialsForm.tsx
+++ b/apps/web/components/signin/CredentialsForm.tsx
@@ -13,6 +13,7 @@ import {
 } from "@/components/ui/form";
 import { Input } from "@/components/ui/input";
 import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
+import { useClientConfig } from "@/lib/clientConfig";
 import { api } from "@/lib/trpc";
 import { zodResolver } from "@hookform/resolvers/zod";
 import { TRPCClientError } from "@trpc/client";
@@ -100,6 +101,7 @@ function SignIn() {
 }
 
 function SignUp() {
+  const clientConfig = useClientConfig();
   const form = useForm<z.infer<typeof zSignUpSchema>>({
     resolver: zodResolver(zSignUpSchema),
   });
@@ -201,7 +203,11 @@ function SignUp() {
               );
             }}
           />
-          <ActionButton type="submit" loading={form.formState.isSubmitting}>
+          <ActionButton
+            type="submit"
+            loading={form.formState.isSubmitting}
+            disabled={clientConfig.auth.disableSignups}
+          >
             Sign Up
           </ActionButton>
         </div>
-- 
cgit v1.2.3-70-g09d2

