website refactor
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user