-
-
Notifications
You must be signed in to change notification settings - Fork 228
Expand file tree
/
Copy pathlayout.tsx
More file actions
41 lines (36 loc) · 840 Bytes
/
layout.tsx
File metadata and controls
41 lines (36 loc) · 840 Bytes
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
'use client';
import { Geist } from "next/font/google";
import "./globals.css";
import { MetaMaskProvider } from "@metamask/sdk-react";
import { useEffect, useState } from "react";
const geist = Geist({
variable: "--font-geist",
subsets: ["latin"],
});
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const [dappUrl, setDappUrl] = useState("");
useEffect(() => {
setDappUrl(window.location.href);
}, []);
return (
<html lang="en">
<body className={geist.variable}>
<MetaMaskProvider
debug={false}
sdkOptions={{
dappMetadata: {
name: "Simple Web3 Dapp",
url: dappUrl,
}
}}
>
<>{children}</>
</MetaMaskProvider>
</body>
</html>
);
}