import { useEffect } from "react"; import { observer } from "mobx-react"; import Image from "next/image"; import Link from "next/link"; // ui import { useTheme } from "next-themes"; import { Spinner } from "@plane/ui"; // components import { SignInAuthRoot } from "@/components/account"; import { PageHead } from "@/components/core"; // constants import { NAVIGATE_TO_SIGNUP } from "@/constants/event-tracker"; // helpers import { EPageTypes } from "@/helpers/authentication.helper"; // hooks import { useEventTracker, useInstance, useUser } from "@/hooks/store"; import useAuthRedirection from "@/hooks/use-auth-redirection"; // layouts import DefaultLayout from "@/layouts/default-layout"; // types import { NextPageWithLayout } from "@/lib/types"; // wrappers import { AuthenticationWrapper } from "@/lib/wrappers"; // assets import PlaneBackgroundPatternDark from "public/onboarding/background-pattern-dark.svg"; import PlaneBackgroundPattern from "public/onboarding/background-pattern.svg"; import BluePlaneLogoWithoutText from "public/plane-logos/blue-without-text.png"; export type AuthType = "sign-in" | "sign-up"; const SignInPage: NextPageWithLayout = observer(() => { // store hooks const { instance } = useInstance(); const { data: currentUser } = useUser(); const { captureEvent } = useEventTracker(); // hooks const { resolvedTheme } = useTheme(); // login redirection hook const { isRedirecting, handleRedirection } = useAuthRedirection(); useEffect(() => { handleRedirection(); }, [handleRedirection]); if (isRedirecting || currentUser || !instance?.config) return (
); return (
Plane background pattern
Plane Logo Plane
New to Plane?{" "} captureEvent(NAVIGATE_TO_SIGNUP, {})} className="font-semibold text-custom-primary-100 hover:underline" > Create an account
); }); SignInPage.getLayout = function getLayout(page: React.ReactElement) { return ( {page} ); }; export default SignInPage;