-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathlayout.tsx
118 lines (101 loc) · 3.35 KB
/
layout.tsx
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import Script from 'next/script';
import ProviderLayout from './ProviderLayout';
import appData from "@/data/app.json";
import type { Metadata } from 'next';
import type { Viewport } from 'next';
import { Suspense } from 'react';
import { NavigationEvents } from './components/navigation-events';
import Loader from '@/components/Loader';
// =========================================
// global styles
// =========================================
import '@/styles/globals.scss';
// =========================================
// global metadata
// =========================================
export const viewport: Viewport = {
width: 'device-width',
initialScale: 1,
maximumScale: 1
}
export const metadata: Metadata = {
title: `${appData.siteName}`,
description: 'A whole-website building solution based on Next.js. It serves as a case to sort out the thinking.',
openGraph: {
title: `${appData.siteName}`,
description: 'A whole-website building solution based on Next.js. It serves as a case to sort out the thinking.',
url: `${appData.siteUrl}/`,
siteName: `${appData.siteName}`,
images: [
{
url: `${appData.siteUrl}/assets/images/logo-black.png`, // Must be an absolute URL
width: 800,
height: 600,
}
],
type: 'website',
},
icons: [
{
rel: 'icon',
type: 'image/x-icon',
url: '/assets/images/favicon/favicon-32x32.png',
},
{
rel: 'shortcut icon',
sizes: '32x32',
url: '/assets/images/favicon/favicon-32x32.png',
},
{
rel: 'apple-touch-icon',
sizes: '57x57',
url: '/assets/images/favicon/apple-touch-icon-57x57.png',
},
{
rel: 'apple-touch-icon',
sizes: '72x72',
url: '/assets/images/favicon/apple-touch-icon-72x72.png',
},
{
rel: 'apple-touch-icon',
sizes: '114x114',
url: '/assets/images/favicon/apple-touch-icon-114x114.png',
},
],
}
// =========================================
// root layout
// =========================================
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en-US" dir="ltr">
<body suppressHydrationWarning={true}>
<ProviderLayout>
{children}
</ProviderLayout>
{/* Router events & Loading */}
<Loader />
<Suspense fallback={null}>
<NavigationEvents />
</Suspense>
{/*
<Script
strategy="beforeInteractive"
id="myjs-file"
src="/assets/js/xxxx.js"
></Script>
*/}
{/* Global variables can be used anywhere (plugins, subpages, etc.) */}
<Script
id="global-vars"
strategy="beforeInteractive"
dangerouslySetInnerHTML={{
__html: `
window['NODE_ENV'] = '${process.env.NODE_ENV}';
`,
}}
/>
</body>
</html>
)
}