website refactor

This commit is contained in:
2026-01-20 00:10:30 +01:00
parent 92bf97e21a
commit 6df1b50536
14 changed files with 511 additions and 351 deletions

View File

@@ -3,11 +3,8 @@
import { AppFooter } from '@/components/layout/AppFooter';
import { AppHeader } from '@/components/layout/AppHeader';
import { AppSidebar } from '@/components/layout/AppSidebar';
import { useCurrentSession } from '@/hooks/auth/useCurrentSession';
import { routes } from '@/lib/routing/RouteConfig';
import { Layout } from '@/ui/Layout';
import { Container } from '@/ui/Container';
import { usePathname } from 'next/navigation';
import { Box } from '@/ui/Box';
import React from 'react';
export interface RootAppShellViewData {
@@ -16,31 +13,26 @@ export interface RootAppShellViewData {
/**
* RootAppShellTemplate orchestrates the top-level semantic shells of the application.
* It uses the canonical ui/Layout component to define the app frame.
* Redesigned for the "Cockpit" layout.
*/
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 (
<Layout
header={<AppHeader />}
sidebar={showSidebar ? <AppSidebar /> : undefined}
sidebar={<AppSidebar />}
footer={<AppFooter />}
fixedHeader
fixedSidebar
fixedHeader={true}
fixedSidebar={true}
fixedFooter={false}
>
<Container
size={isLandingPage ? 'full' : 'xl'}
py={isLandingPage ? 0 : 8}
<Box
width="full"
className="max-w-[1920px] mx-auto"
px={8}
py={8}
>
{children}
</Container>
</Box>
</Layout>
);
}