diff --git a/layouts/AuthLayout.tsx b/layouts/AuthLayout.tsx index 0ab423e..c74b0cb 100644 --- a/layouts/AuthLayout.tsx +++ b/layouts/AuthLayout.tsx @@ -1,16 +1,17 @@ -import FlyingThing from "@/components/FlyingThing"; -import Link from "next/link"; -import { ReactNode, useEffect, useState } from "react"; -import { RiLoader5Fill } from "react-icons/ri"; -import { SiGithub } from "react-icons/si"; -import { useRouter } from "next/router"; -import { toast } from "react-hot-toast"; -import Head from "next/head"; +import FlyingThing from '@/components/FlyingThing'; +import Link from 'next/link'; +import { ReactNode, useEffect, useState } from 'react'; +import { RiLoader5Fill } from 'react-icons/ri'; +import { SiGithub } from 'react-icons/si'; +import { useRouter } from 'next/router'; +import { toast } from 'react-hot-toast'; +import Head from 'next/head'; +import Image from 'next/image'; const AuthLayout = ({ children, text, - type = "login", + type = 'login', hideExtras = false, question, hideFlyingThing = false, @@ -18,7 +19,7 @@ const AuthLayout = ({ }: { children: ReactNode; text: string; - type?: "login" | "signup" | "forgot" | "reset"; + type?: 'login' | 'signup' | 'forgot' | 'reset'; hideExtras?: boolean; question?: { title: string; @@ -32,15 +33,15 @@ const AuthLayout = ({ const [loading, setLoading] = useState(false); const handleKeyPress = (e: KeyboardEvent) => { - e.key === "Enter" && setHide(true); + e.key === 'Enter' && setHide(true); }; const router = useRouter(); useEffect(() => { - if (router.asPath === "/login?status=failed") { + if (router.asPath === '/login?status=failed') { setHide(true); - toast.error("Login failed"); + toast.error('Login failed'); } }, []); @@ -49,10 +50,10 @@ const AuthLayout = ({ handleKeyPress(e as unknown as KeyboardEvent); }; - window.addEventListener("keydown", handleKeyDown); + window.addEventListener('keydown', handleKeyDown); return () => { - window.removeEventListener("keydown", handleKeyDown); + window.removeEventListener('keydown', handleKeyDown); }; //Written by ChatGPT //Modified by @xing0x @@ -60,7 +61,7 @@ const AuthLayout = ({ const loginWithGithub = async () => { setLoading(true); - window.open(`${process.env.NEXT_PUBLIC_AUTH_URL}/github`, "_self"); + window.open(`${process.env.NEXT_PUBLIC_AUTH_URL}/github`, '_self'); }; return ( @@ -68,59 +69,55 @@ const AuthLayout = ({ {pageName} | Uploadfly -
+
- + backgroundImage: 'linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.1)), url(/grid-bg.png)', + backgroundSize: 'cover', + backgroundPosition: 'right', + }}> +
-
-
+
+
-

{text}

- {type === "signup" && ( + {type === 'signup' && (

{`Let's fly`}

)}
{children} - {type === "login" && ( + {type === 'login' && ( + href={'/forgot-password'} + className="text-left w-[380px] mx-auto mt-3 font-semibold text-sm hover:text-uf-accent transition-colors"> Forgot password? )} {!hideExtras && ( <> - {type !== "reset" && ( + {type !== 'reset' && (

{question?.title}

- {question?.text} + {question?.text}
)} - {(type === "login" || type === "signup") && ( + {(type === 'login' || type === 'signup') && (

or

+ setConfirmPassword(e.target.value)} + /> )} @@ -224,16 +224,6 @@ const Signup = () => {
)} - {!showOtpInput && !accountVerified && ( -
- setShowPassword(!showPassword)} - /> -

Show password

-
- )} {(wantsToChangeUsername || !accountVerified) && (