mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 15:02:34 +00:00
dashboard layout (#597)
This commit is contained in:
@ -1,19 +0,0 @@
|
||||
import { AppContent } from '@/components/app-content';
|
||||
import { AppHeader } from '@/components/app-header';
|
||||
import { AppShell } from '@/components/app-shell';
|
||||
import { type BreadcrumbItem } from '@/types';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import { usePoll } from '@inertiajs/react';
|
||||
import { Toaster } from '@/components/ui/sonner';
|
||||
|
||||
export default function AppHeaderLayout({ children }: PropsWithChildren<{ breadcrumbs?: BreadcrumbItem[] }>) {
|
||||
usePoll(10000);
|
||||
|
||||
return (
|
||||
<AppShell>
|
||||
<AppHeader />
|
||||
<AppContent>{children}</AppContent>
|
||||
<Toaster />
|
||||
</AppShell>
|
||||
);
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
import { AppContent } from '@/components/app-content';
|
||||
import { AppShell } from '@/components/app-shell';
|
||||
import { AppSidebar } from '@/components/app-sidebar';
|
||||
import { AppSidebarHeader } from '@/components/app-sidebar-header';
|
||||
import { type BreadcrumbItem } from '@/types';
|
||||
import { type PropsWithChildren } from 'react';
|
||||
|
||||
export default function AppSidebarLayout({ children, breadcrumbs = [] }: PropsWithChildren<{ breadcrumbs?: BreadcrumbItem[] }>) {
|
||||
return (
|
||||
<AppShell variant="sidebar">
|
||||
<AppSidebar />
|
||||
<AppContent variant="sidebar">
|
||||
<AppSidebarHeader breadcrumbs={breadcrumbs} />
|
||||
{children}
|
||||
</AppContent>
|
||||
</AppShell>
|
||||
);
|
||||
}
|
35
resources/js/layouts/app/layout.tsx
Normal file
35
resources/js/layouts/app/layout.tsx
Normal file
@ -0,0 +1,35 @@
|
||||
import { AppSidebar } from '@/components/app-sidebar';
|
||||
import { AppHeader } from '@/components/app-header';
|
||||
import { type BreadcrumbItem, NavItem } from '@/types';
|
||||
import { CSSProperties, type PropsWithChildren } from 'react';
|
||||
import { SidebarInset, SidebarProvider } from '@/components/ui/sidebar';
|
||||
import { usePoll } from '@inertiajs/react';
|
||||
|
||||
export default function Layout({
|
||||
children,
|
||||
secondNavItems,
|
||||
secondNavTitle,
|
||||
}: PropsWithChildren<{
|
||||
breadcrumbs?: BreadcrumbItem[];
|
||||
secondNavItems?: NavItem[];
|
||||
secondNavTitle?: string;
|
||||
}>) {
|
||||
usePoll(10000);
|
||||
|
||||
return (
|
||||
<SidebarProvider
|
||||
style={
|
||||
{
|
||||
'--sidebar-width': '300px',
|
||||
} as CSSProperties
|
||||
}
|
||||
defaultOpen={!!(secondNavItems && secondNavItems.length > 0)}
|
||||
>
|
||||
<AppSidebar secondNavItems={secondNavItems} secondNavTitle={secondNavTitle} />
|
||||
<SidebarInset>
|
||||
<AppHeader />
|
||||
<div className="flex flex-1 flex-col">{children}</div>
|
||||
</SidebarInset>
|
||||
</SidebarProvider>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user