From 207e120d66f9a7d63e0a5f4e4781cafc6cc922ef Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Mon, 16 Jan 2023 13:59:54 +0000 Subject: [PATCH] Bring back PublicShell (#6505) --- packages/features/shell/Shell.tsx | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/packages/features/shell/Shell.tsx b/packages/features/shell/Shell.tsx index c2df8660d7..78aa12993c 100644 --- a/packages/features/shell/Shell.tsx +++ b/packages/features/shell/Shell.tsx @@ -184,19 +184,30 @@ const KBarWrapper = ({ children, withKBar = false }: { withKBar: boolean; childr <>{children} ); -export default function Shell(props: LayoutProps) { +const PublicShell = (props: LayoutProps) => { const { status } = useSession(); - // if a page is unauthed and isPublic is true, the redirect does not happen. - useRedirectToLoginIfUnauthenticated(props.isPublic); - useRedirectToOnboardingIfNeeded(); - useTheme("light"); - return ( ); +}; + +export default function Shell(props: LayoutProps) { + // if a page is unauthed and isPublic is true, the redirect does not happen. + useRedirectToLoginIfUnauthenticated(props.isPublic); + useRedirectToOnboardingIfNeeded(); + useTheme("light"); + + return !props.isPublic ? ( + + + + + ) : ( + + ); } function UserDropdown({ small }: { small?: boolean }) {