-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayout.tsx
66 lines (60 loc) · 1.83 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
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import './globals.css';
import Script from 'next/script';
import { headers } from 'next/headers';
import WagmiContextProvider from '@/contexts/WagmiContextProvider';
const inter = Inter({ subsets: ['latin'] });
export const metadata: Metadata = {
title: 'Swapscout',
description: 'Swap between chains fast and easy. Powered by Blockscout',
icons: [
{ rel: 'icon', url: '/favicon-32x32.png', sizes: '32x32', type: 'image/png' },
{ rel: 'apple-touch-icon', url: '/favicon-256x256.png' },
],
openGraph: {
title: 'Swapscout',
description: 'Swap between chains fast and easy. Powered by Blockscout',
images: [{ url: '/og-image.png', width: 1200, height: 600 }],
type: 'website',
},
};
const GoogleAnalytics = () => {
return (
<>
<Script
src={`https://www.googletagmanager.com/gtag/js?id=${process.env.NEXT_PUBLIC_GA_ID}`}
strategy="afterInteractive"
/>
<Script id="google-analytics" strategy="afterInteractive">
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${process.env.NEXT_PUBLIC_GA_ID}');
`}
</Script>
</>
);
};
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
const cookies = headers().get('cookie');
return (
<html lang="en">
<head>
<GoogleAnalytics />
<link rel="icon" href="/favicon-32x32.png" type="image/png" sizes="32x32" />
<link rel="apple-touch-icon" href="/favicon-256x256.png" />
</head>
<body className={inter.className}>
<WagmiContextProvider cookies={cookies}>
{children}
</WagmiContextProvider>
</body>
</html>
);
}