Bring back PublicShell (#6505)

This commit is contained in:
Alex van Andel authored and GitHub committed 2023-01-16 14:59:54 +01:00
1 parent b25d04da1c
commit 207e120d66
1 file changed
+17 -6
+17 -6
View File
@@ -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 (
<KBarWrapper withKBar={status === "authenticated"}>
<CustomBrandingContainer />
<Layout {...props} />
</KBarWrapper>
);
};
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 ? (
<KBarWrapper withKBar>
<CustomBrandingContainer />
<Layout {...props} />
</KBarWrapper>
) : (
<PublicShell {...props} />
);
}
function UserDropdown({ small }: { small?: boolean }) {