refactor: extract dashboard layout (#952)
* refactor: extract dashboard layout * fix formattingsupport-auth-token
parent
5cbb2b3a4c
commit
c54091d4bc
|
|
@ -1,5 +1,6 @@
|
||||||
import { Metadata } from 'next'
|
import { Metadata } from 'next'
|
||||||
import Sidebar from './components/sidebar'
|
import Sidebar from './components/sidebar'
|
||||||
|
import { Header } from '@/components/header'
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: 'Dashboard'
|
title: 'Dashboard'
|
||||||
|
|
@ -10,5 +11,12 @@ interface DashboardLayoutProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function RootLayout({ children }: DashboardLayoutProps) {
|
export default function RootLayout({ children }: DashboardLayoutProps) {
|
||||||
return <Sidebar className="flex-1">{children}</Sidebar>
|
return (
|
||||||
|
<>
|
||||||
|
<Header />
|
||||||
|
<main className="bg-muted/50 flex flex-1 flex-col">
|
||||||
|
<Sidebar className="flex-1">{children}</Sidebar>
|
||||||
|
</main>
|
||||||
|
</>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import { fontMono, fontSans } from '@/lib/fonts'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
import { TailwindIndicator } from '@/components/tailwind-indicator'
|
import { TailwindIndicator } from '@/components/tailwind-indicator'
|
||||||
import { Providers } from '@/components/providers'
|
import { Providers } from '@/components/providers'
|
||||||
import { Header } from '@/components/header'
|
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: {
|
title: {
|
||||||
|
|
@ -38,10 +37,7 @@ export default function RootLayout({ children }: RootLayoutProps) {
|
||||||
>
|
>
|
||||||
<Toaster />
|
<Toaster />
|
||||||
<Providers attribute="class" defaultTheme="system" enableSystem>
|
<Providers attribute="class" defaultTheme="system" enableSystem>
|
||||||
<div className="flex min-h-screen flex-col">
|
<div className="flex min-h-screen flex-col">{children}</div>
|
||||||
<Header />
|
|
||||||
<main className="bg-muted/50 flex flex-1 flex-col">{children}</main>
|
|
||||||
</div>
|
|
||||||
<TailwindIndicator />
|
<TailwindIndicator />
|
||||||
</Providers>
|
</Providers>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue