From 40636d2d52bfb58f0d8d0ebacfc09b05aa206f4f Mon Sep 17 00:00:00 2001 From: ngc2207 Date: Sat, 1 Feb 2025 10:03:28 +0800 Subject: [PATCH] refactor(auth): update sign-in and sign-up cards to use loading states --- src/features/auth/components/sign-in-card.tsx | 10 ++++++---- src/features/auth/components/sign-up-card.tsx | 12 +++++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/features/auth/components/sign-in-card.tsx b/src/features/auth/components/sign-in-card.tsx index 6817021..4c53564 100644 --- a/src/features/auth/components/sign-in-card.tsx +++ b/src/features/auth/components/sign-in-card.tsx @@ -1,3 +1,5 @@ +"use client"; + import { z } from "zod"; import Link from "next/link"; import { @@ -19,7 +21,7 @@ import { Separator } from "@/components/ui/separator"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; export const SignInCard = () => { - const { mutate } = useLogin(); + const { mutate, isPending } = useLogin(); const form = useForm>({ resolver: zodResolver(loginSchema), @@ -78,7 +80,7 @@ export const SignInCard = () => { )} /> - @@ -89,7 +91,7 @@ export const SignInCard = () => { @@ -124,7 +126,7 @@ export const SignUpCard = () => {