import { t } from "@lingui/macro"; import { cn } from "@reactive-resume/utils"; import { useMemo } from "react"; import { Link, matchRoutes, Outlet, useLocation } from "react-router"; import { LocaleSwitch } from "@/client/components/locale-switch"; import { Logo } from "@/client/components/logo"; import { ThemeSwitch } from "@/client/components/theme-switch"; import { useAuthProviders } from "@/client/services/auth/providers"; import { SocialAuth } from "./_components/social-auth"; const authRoutes = [{ path: "/auth/login" }, { path: "/auth/register" }]; export const AuthLayout = () => { const location = useLocation(); const { providers } = useAuthProviders(); const isAuthRoute = useMemo(() => matchRoutes(authRoutes, location) !== null, [location]); if (!providers) return null; // Condition (providers.length === 1) hides the divider if providers[] includes only "email" const hideDivider = !providers.includes("email") || providers.length === 1; return ( // eslint-disable-next-line tailwindcss/enforces-shorthand -- size-screen not implemented yet
{isAuthRoute && ( <>

{t({ message: "or continue with", context: "The user can either login with email/password, or continue with GitHub or Google.", })}
)}
Open books on a table
{t`Photograph by Patrick Tomasso`}
); };