From d98c3720e804fd53bb53ec75200d41b1db6f043e Mon Sep 17 00:00:00 2001 From: Vishnu Date: Sun, 8 Jun 2025 18:55:46 +0530 Subject: [PATCH] little FE change --- apps/Frontend/src/pages/auth-page.tsx | 108 +++++++++++++++++--------- 1 file changed, 70 insertions(+), 38 deletions(-) diff --git a/apps/Frontend/src/pages/auth-page.tsx b/apps/Frontend/src/pages/auth-page.tsx index 13fdb3e..b30c523 100644 --- a/apps/Frontend/src/pages/auth-page.tsx +++ b/apps/Frontend/src/pages/auth-page.tsx @@ -21,7 +21,9 @@ import { Card, CardContent } from "@/components/ui/card"; import { BriefcaseMedical, CheckCircle, Torus } from "lucide-react"; import { CheckedState } from "@radix-ui/react-checkbox"; -const insertUserSchema = (UserUncheckedCreateInputObjectSchema as unknown as z.ZodObject).pick({ +const insertUserSchema = ( + UserUncheckedCreateInputObjectSchema as unknown as z.ZodObject +).pick({ username: true, password: true, }); @@ -30,18 +32,21 @@ const loginSchema = (insertUserSchema as unknown as z.ZodObject).extend({ rememberMe: z.boolean().optional(), }); - -const registerSchema = (insertUserSchema as unknown as z.ZodObject).extend({ - confirmPassword: z.string().min(6, { - message: "Password must be at least 6 characters long", - }), - agreeTerms: z.literal(true, { - errorMap: () => ({ message: "You must agree to the terms and conditions" }), - }), -}).refine((data:any) => data.password === data.confirmPassword, { - message: "Passwords don't match", - path: ["confirmPassword"], -}); +const registerSchema = (insertUserSchema as unknown as z.ZodObject) + .extend({ + confirmPassword: z.string().min(6, { + message: "Password must be at least 6 characters long", + }), + agreeTerms: z.literal(true, { + errorMap: () => ({ + message: "You must agree to the terms and conditions", + }), + }), + }) + .refine((data: any) => data.password === data.confirmPassword, { + message: "Passwords don't match", + path: ["confirmPassword"], + }); type LoginFormValues = z.infer; type RegisterFormValues = z.infer; @@ -49,7 +54,7 @@ type RegisterFormValues = z.infer; export default function AuthPage() { const [activeTab, setActiveTab] = useState("login"); const { user, loginMutation, registerMutation } = useAuth(); - + const loginForm = useForm({ resolver: zodResolver(loginSchema), defaultValues: { @@ -94,11 +99,17 @@ export default function AuthPage() { {/* Auth Forms */}
-

DentalConnect

+

+ DentalConnect +

Patient Management System

- + Login Register @@ -106,7 +117,10 @@ export default function AuthPage() {
- + Username - + @@ -162,12 +173,19 @@ export default function AuthPage() { )} /> - + Forgot password? - @@ -176,7 +194,10 @@ export default function AuthPage() {
- + Username - + @@ -223,8 +241,9 @@ export default function AuthPage() { placeholder="••••••••" type="password" {...field} - value={typeof field.value === 'string' ? field.value : ''} - + value={ + typeof field.value === "string" ? field.value : "" + } /> @@ -236,16 +255,20 @@ export default function AuthPage() { control={registerForm.control} name="agreeTerms" render={({ field }) => ( - + -
- - I agree to the Terms and Conditions +
+ + I agree to the{" "} + + Terms and Conditions +
@@ -253,8 +276,14 @@ export default function AuthPage() { )} /> - @@ -269,9 +298,12 @@ export default function AuthPage() {
-

Welcome to DentalConnect

+

+ Welcome to DentalConnect +

- The complete solution for dental practice management. Streamline your patient records, appointments, and more. + The complete solution for dental practice management. Streamline + your patient records, appointments, and more.