reorganize providers

This commit is contained in:
horsefacts
2024-11-25 14:57:10 -05:00
committed by lucas-neynar
parent a8ba2397bd
commit 530fb860c3
6 changed files with 32 additions and 25 deletions

View File

@@ -1,5 +1,7 @@
import type { Metadata } from "next";
import "./globals.css";
import "~/app/globals.css";
import { Providers } from "~/app/providers";
export const metadata: Metadata = {
title: "Farcaster Frames v2 Demo",
@@ -13,7 +15,9 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<body>{children}</body>
<body>
<Providers>{children}</Providers>
</body>
</html>
);
}

View File

@@ -1,9 +1,15 @@
import { App } from "~/components/App";
"use client";
import dynamic from "next/dynamic";
const Demo = dynamic(() => import("~/components/Demo"), {
ssr: false,
});
export default function Home() {
return (
<main className="min-h-screen flex flex-col p-4">
<App />
<Demo />
</main>
);
}

14
src/app/providers.tsx Normal file
View File

@@ -0,0 +1,14 @@
"use client";
import dynamic from "next/dynamic";
const WagmiProvider = dynamic(
() => import("~/components/providers/WagmiProvider"),
{
ssr: false,
}
);
export function Providers({ children }: { children: React.ReactNode }) {
return <WagmiProvider>{children}</WagmiProvider>;
}