forked from BeOnAuto/auto-engineer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayout.tsx
More file actions
103 lines (99 loc) · 3.28 KB
/
layout.tsx
File metadata and controls
103 lines (99 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import type { Metadata } from 'next';
import { META_THEME_COLORS, siteConfig } from '@/lib/config';
import { cn } from '@/lib/utils';
import { LayoutProvider } from '@/hooks/use-layout';
import { ActiveThemeProvider } from '@/components/common/active-theme';
import { Analytics } from '@/components/common/analytics';
import { TailwindIndicator } from '@/components/common/tailwind-indicator';
import { ThemeProvider } from '@/components/common/theme-provider';
import { Toaster } from '@/registry/new-york-v4/ui/sonner';
import '@/styles/globals.css';
export const metadata: Metadata = {
title: {
default: siteConfig.name,
template: `%s - ${siteConfig.name}`,
},
metadataBase: new URL(process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000'),
description: siteConfig.description,
keywords: ['Next.js', 'React', 'Tailwind CSS', 'Components', 'shadcn'],
authors: [
{
name: 'shadcn',
url: 'https://shadcn.com',
},
],
creator: 'shadcn',
openGraph: {
type: 'website',
locale: 'en_US',
url: process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000',
title: siteConfig.name,
description: siteConfig.description,
siteName: siteConfig.name,
images: [
{
url: `${process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000'}/opengraph-image.png`,
width: 1200,
height: 630,
alt: siteConfig.name,
},
],
},
twitter: {
card: 'summary_large_image',
title: siteConfig.name,
description: siteConfig.description,
images: [`${process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000'}/opengraph-image.png`],
creator: '@shadcn',
},
icons: {
icon: '/favicon.ico',
shortcut: '/favicon-16x16.png',
apple: '/apple-touch-icon.png',
},
manifest: `${siteConfig.url}/site.webmanifest`,
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en" suppressHydrationWarning>
<head>
<script
dangerouslySetInnerHTML={{
__html: `
try {
if (localStorage.theme === 'dark' || ((!('theme' in localStorage) || localStorage.theme === 'system') && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '${META_THEME_COLORS.dark}')
}
if (localStorage.layout) {
document.documentElement.classList.add('layout-' + localStorage.layout)
}
} catch (_) {}
`,
}}
/>
<meta name="theme-color" content={META_THEME_COLORS.light} />
</head>
<body
className={cn(
'text-foreground group/body overscroll-none font-sans antialiased [--footer-height:calc(var(--spacing)*14)] [--header-height:calc(var(--spacing)*14)] xl:[--footer-height:calc(var(--spacing)*24)]',
// fontVariables
)}
>
<ThemeProvider>
<LayoutProvider>
<ActiveThemeProvider>
{children}
<TailwindIndicator />
<Toaster position="top-center" />
<Analytics />
</ActiveThemeProvider>
</LayoutProvider>
</ThemeProvider>
</body>
</html>
);
}