diff --git a/apps/app/components/account/email-code-form.tsx b/apps/app/components/account/email-code-form.tsx index ba8c759af..e6b3eeac3 100644 --- a/apps/app/components/account/email-code-form.tsx +++ b/apps/app/components/account/email-code-form.tsx @@ -32,6 +32,7 @@ export const EmailCodeForm = ({ handleSignIn }: any) => { setError, setValue, getValues, + watch, formState: { errors, isSubmitting, isValid, isDirty }, } = useForm({ defaultValues: { @@ -112,43 +113,34 @@ export const EmailCodeForm = ({ handleSignIn }: any) => { return ( <> -
- {(codeSent || codeResent) && ( -
-
-
-
-
-

- {codeResent - ? "Please check your mail for new code." - : "Please check your mail for code."} -

-
-
-
- )} -
+ {(codeSent || codeResent) && ( +

+ We have sent the sign in code. +
+ Please check your inbox at {watch("email")} +

+ )} + +
/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test( value - ) || "Email ID is not valid", + ) || "Email address is not valid", }} error={errors.email} - placeholder="Enter your Email ID" + placeholder="Enter your email address..." />
{codeSent && ( -
+ <> { required: "Code is required", }} error={errors.token} - placeholder="Enter code" + placeholder="Enter code..." /> -
+ + )} + {codeSent ? ( + + {isLoading ? "Signing in..." : "Sign in"} + + ) : ( + { + handleSubmit(onSubmit)().then(() => { + setResendCodeTimer(30); + }); + }} + disabled={!isValid && isDirty} + loading={isSubmitting} + > + {isSubmitting ? "Sending code..." : "Send sign in code"} + )} -
- {codeSent ? ( - - {isLoading ? "Signing in..." : "Sign in"} - - ) : ( - { - handleSubmit(onSubmit)().then(() => { - setResendCodeTimer(30); - }); - }} - loading={isSubmitting || (!isValid && isDirty)} - > - {isSubmitting ? "Sending code..." : "Send code"} - - )} -
); diff --git a/apps/app/components/account/email-password-form.tsx b/apps/app/components/account/email-password-form.tsx index 97da2b9e4..ab902ee96 100644 --- a/apps/app/components/account/email-password-form.tsx +++ b/apps/app/components/account/email-password-form.tsx @@ -8,7 +8,7 @@ import { useForm } from "react-hook-form"; // components import { EmailResetPasswordForm } from "components/account"; // ui -import { Input, SecondaryButton } from "components/ui"; +import { Input, PrimaryButton } from "components/ui"; // types type EmailPasswordFormValues = { email: string; @@ -42,28 +42,38 @@ export const EmailPasswordForm: React.FC = ({ onSubmit }) => { return ( <> +

+ {isResettingPassword + ? "Reset your password" + : isSignUpPage + ? "Sign up on Plane" + : "Sign in to Plane"} +

{isResettingPassword ? ( ) : ( -
-
+ +
/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test( value - ) || "Email ID is not valid", + ) || "Email address is not valid", }} error={errors.email} - placeholder="Enter your email ID" + placeholder="Enter your email address..." />
-
+
= ({ onSubmit }) => { required: "Password is required", }} error={errors.password} - placeholder="Enter your password" + placeholder="Enter your password..." />
-
-
- {isSignUpPage ? ( - - - Already have an account? Sign in. - - - ) : ( - - )} -
+
+ {isSignUpPage ? ( + + + Already have an account? Sign in. + + + ) : ( + + )}
-
- + = ({ onSubmit }) => { {isSignUpPage ? isSubmitting ? "Signing up..." - : "Sign Up" + : "Sign up" : isSubmitting ? "Signing in..." - : "Sign In"} - + : "Sign in"} + {!isSignUpPage && ( - + Don{"'"}t have an account? Sign up. diff --git a/apps/app/components/account/email-reset-password-form.tsx b/apps/app/components/account/email-reset-password-form.tsx index 03ea69042..2fa787a5f 100644 --- a/apps/app/components/account/email-reset-password-form.tsx +++ b/apps/app/components/account/email-reset-password-form.tsx @@ -59,25 +59,28 @@ export const EmailResetPasswordForm: React.FC = ({ setIsResettingPassword }; return ( - -
+ +
/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test( value - ) || "Email ID is not valid", + ) || "Email address is not valid", }} error={errors.email} - placeholder="Enter registered Email ID" + placeholder="Enter registered email address.." />
-
+
setIsResettingPassword(false)} diff --git a/apps/app/components/account/github-login-button.tsx b/apps/app/components/account/github-login-button.tsx index 889d46405..844f32355 100644 --- a/apps/app/components/account/github-login-button.tsx +++ b/apps/app/components/account/github-login-button.tsx @@ -1,9 +1,14 @@ import { useEffect, useState, FC } from "react"; + import Link from "next/link"; import Image from "next/image"; import { useRouter } from "next/router"; + +// next-themes +import { useTheme } from "next-themes"; // images -import githubImage from "/public/logos/github-black.png"; +import githubBlackImage from "/public/logos/github-black.png"; +import githubWhiteImage from "/public/logos/github-white.png"; const { NEXT_PUBLIC_GITHUB_ID } = process.env; @@ -11,15 +16,15 @@ export interface GithubLoginButtonProps { handleSignIn: React.Dispatch; } -export const GithubLoginButton: FC = (props) => { - const { handleSignIn } = props; - // router +export const GithubLoginButton: FC = ({ handleSignIn }) => { + const [loginCallBackURL, setLoginCallBackURL] = useState(undefined); + const [gitCode, setGitCode] = useState(null); + const { query: { code }, } = useRouter(); - // states - const [loginCallBackURL, setLoginCallBackURL] = useState(undefined); - const [gitCode, setGitCode] = useState(null); + + const { theme } = useTheme(); useEffect(() => { if (code && !gitCode) { @@ -35,13 +40,18 @@ export const GithubLoginButton: FC = (props) => { }, []); return ( -
+
-
diff --git a/apps/app/components/account/google-login.tsx b/apps/app/components/account/google-login.tsx index c12fb4e24..a2cdb7750 100644 --- a/apps/app/components/account/google-login.tsx +++ b/apps/app/components/account/google-login.tsx @@ -27,7 +27,7 @@ export const GoogleLoginButton: FC = (props) => { theme: "outline", size: "large", logo_alignment: "center", - width: "410", + width: "360", text: "continue_with", } as GsiButtonConfiguration // customization attributes ); @@ -48,7 +48,7 @@ export const GoogleLoginButton: FC = (props) => { <>