Skip to content

Commit 273f2db

Browse files
authored
disabled states (#1086)
1 parent 68ff0f1 commit 273f2db

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

apps/web/app/(org)/login/form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ const NormalLogin = ({
464464
type="button"
465465
className="flex gap-2 justify-center items-center w-full text-sm"
466466
onClick={handleGoogleSignIn}
467-
disabled={loading}
467+
disabled={loading || emailSent}
468468
>
469469
<Image src="/google.svg" alt="Google" width={16} height={16} />
470470
Login with Google
@@ -489,7 +489,7 @@ const NormalLogin = ({
489489
className="w-full"
490490
layout
491491
onClick={() => setShowOrgInput(true)}
492-
disabled={loading}
492+
disabled={loading || emailSent}
493493
>
494494
<LucideArrowUpRight size={20} />
495495
Login with SAML SSO

apps/web/app/s/[videoId]/_components/AuthOverlay.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ const StepOne = ({
137137
emailId: string;
138138
}) => {
139139
const videoId = useParams().videoId;
140+
const handleGoogleSignIn = () => {
141+
trackEvent("auth_started", { method: "google", is_signup: true });
142+
setLoading(true);
143+
signIn("google", {
144+
redirect: false,
145+
callbackUrl: `${window.location.origin}/s/${videoId}`,
146+
});
147+
};
140148
return (
141149
<form
142150
onSubmit={async (e) => {
@@ -178,7 +186,7 @@ const StepOne = ({
178186
autoComplete="email"
179187
required
180188
value={email}
181-
disabled={emailSent}
189+
disabled={emailSent || loading}
182190
onChange={(e) => {
183191
setEmail(e.target.value);
184192
}}
@@ -205,15 +213,7 @@ const StepOne = ({
205213
variant="gray"
206214
type="button"
207215
className="flex gap-2 justify-center items-center my-1 w-full text-sm"
208-
onClick={() => {
209-
trackEvent("auth_started", { method: "google", is_signup: true });
210-
setLoading(true);
211-
signIn("google", {
212-
redirect: false,
213-
callbackUrl: `${window.location.origin}/s/${videoId}`,
214-
});
215-
setLoading(false);
216-
}}
216+
onClick={handleGoogleSignIn}
217217
disabled={loading}
218218
>
219219
<Image src="/google.svg" alt="Google" width={16} height={16} />

0 commit comments

Comments
 (0)