@@ -88,8 +100,13 @@ export default function StepOne() {
const { signUp, isLoaded } = useSignUp();
const [pendingVerification, setPendingVerification] = useState(false);
+ const [emailJoinLoading, setEmailJoinLoading] = useState(false);
+
const handleSignUp = form.handleSubmit(async (formData) => {
if (!isLoaded) return;
+
+ setEmailJoinLoading(true);
+
try {
await signUp.create(formData);
await signUp.prepareEmailAddressVerification({ strategy: 'email_code' });
@@ -111,6 +128,8 @@ export default function StepOne() {
},
]);
}
+
+ setEmailJoinLoading(false);
});
const handleGoogleSignUp = async () => {
@@ -152,7 +171,12 @@ export default function StepOne() {
name="password"
/>
-
diff --git a/src/app/(account)/signin/page.tsx b/src/app/(account)/signin/page.tsx
index fb111125..cfe5d786 100644
--- a/src/app/(account)/signin/page.tsx
+++ b/src/app/(account)/signin/page.tsx
@@ -6,6 +6,7 @@ import FancyRectangle from '@/components/FancyRectangle';
import { useSignIn } from '@clerk/clerk-react';
import { zodResolver } from '@hookform/resolvers/zod';
import Link from 'next/link';
+import { useState } from 'react';
import { useForm } from 'react-hook-form';
import { FcGoogle } from 'react-icons/fc';
import { z } from 'zod';
@@ -25,8 +26,13 @@ export default function SignInPage() {
resolver: zodResolver(signInSchema),
});
+ const [signInLoading, setSignInLoading] = useState(false);
+
const handleSignIn = form.handleSubmit(async ({ email, password }) => {
if (!isLoaded) return;
+
+ setSignInLoading(true);
+
try {
const result = await signIn.create({
identifier: email,
@@ -59,6 +65,8 @@ export default function SignInPage() {
},
]);
}
+
+ setSignInLoading(false);
});
const handleGoogleSignIn = async () => {
@@ -110,7 +118,12 @@ export default function SignInPage() {
>
Forgot password?
-
+
Sign In