fix: Signup options are not disabled (#12610)

* fix: Signup options are not disabled

* fixes/signup disabling suggested changes done

* chore: signup and login improvements

---------

Co-authored-by: Udit Takkar <udit222001@gmail.com>
This commit is contained in:
Pratik Kumar 2023-12-01 16:39:34 +05:30 committed by GitHub
parent 252ce07861
commit 3d89809e67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -251,6 +251,7 @@ inferSSRProps<typeof _getServerSideProps> & WithNonceProps<{}>) {
<Button
color="secondary"
className="w-full justify-center"
disabled={formState.isSubmitting}
data-testid="google"
StartIcon={FaGoogle}
onClick={async (e) => {

View File

@ -323,6 +323,7 @@ export default function Signup({
!!formMethods.formState.errors.email ||
!formMethods.getValues("email") ||
!formMethods.getValues("password") ||
isSubmitting ||
usernameTaken
}>
{premiumUsername && !usernameTaken
@ -387,7 +388,9 @@ export default function Signup({
disabled={
!!formMethods.formState.errors.username ||
!!formMethods.formState.errors.email ||
premiumUsername
premiumUsername ||
isSubmitting ||
isGoogleLoading
}
className={classNames(
"w-full justify-center rounded-md text-center",
@ -401,6 +404,7 @@ export default function Signup({
}
if (!formMethods.getValues("email")) {
formMethods.trigger("email");
return;
}
const username = formMethods.getValues("username");