website refactor

This commit is contained in:
2026-01-18 13:26:35 +01:00
parent 350c78504d
commit 0b301feb61
225 changed files with 1678 additions and 26666 deletions

View File

@@ -9,6 +9,9 @@ import { GlobalSidebarTemplate } from './GlobalSidebarTemplate';
import { GlobalFooterTemplate } from './GlobalFooterTemplate';
import { HeaderContentTemplate } from './HeaderContentTemplate';
import { Box } from '@/ui/Box';
import { usePathname } from 'next/navigation';
import { useCurrentSession } from '@/hooks/auth/useCurrentSession';
import { routes } from '@/lib/routing/RouteConfig';
export interface RootAppShellViewData {
children: React.ReactNode;
@@ -22,6 +25,14 @@ export interface RootAppShellViewData {
* - ContentViewport = content area
*/
export function RootAppShellTemplate({ children }: RootAppShellViewData) {
const pathname = usePathname();
const { data: session } = useCurrentSession();
const isAuthenticated = !!session;
// Hide sidebar on landing page for unauthenticated users
const isLandingPage = pathname === routes.public.home;
const showSidebar = isAuthenticated && !isLandingPage;
return (
<AppShell>
<ControlBar>
@@ -31,10 +42,10 @@ export function RootAppShellTemplate({ children }: RootAppShellViewData) {
</ControlBar>
<Box display="flex" flexGrow={1} overflow="hidden">
<GlobalSidebarTemplate />
{showSidebar && <GlobalSidebarTemplate />}
<Box display="flex" flexGrow={1} flexDirection="col" overflow="hidden">
<ContentViewport>
<ContentViewport fullWidth={!showSidebar}>
{children}
</ContentViewport>
<GlobalFooterTemplate />