Bring back PublicShell (#6505)
This commit is contained in:
1 parent
b25d04da1c
commit
207e120d66
1 file changed
+17
-6
@@ -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 }) {
|
||||
|
||||
Reference in new issue
Block a user