From 181172b94803002024b6eacba9827b9b5b3deedc Mon Sep 17 00:00:00 2001 From: Corban Riley Date: Mon, 13 May 2024 12:31:32 -0400 Subject: [PATCH] Import config from server rendered layout (breaks) --- .../src/app/{Web3Provider.tsx => Providers.tsx} | 14 +++++++------- examples/next/src/app/layout.tsx | 8 ++++++-- 2 files changed, 13 insertions(+), 9 deletions(-) rename examples/next/src/app/{Web3Provider.tsx => Providers.tsx} (68%) diff --git a/examples/next/src/app/Web3Provider.tsx b/examples/next/src/app/Providers.tsx similarity index 68% rename from examples/next/src/app/Web3Provider.tsx rename to examples/next/src/app/Providers.tsx index fe8bfd57..04caa5bf 100644 --- a/examples/next/src/app/Web3Provider.tsx +++ b/examples/next/src/app/Providers.tsx @@ -1,21 +1,21 @@ 'use client' -import { KitProvider } from '@0xsequence/kit' +import { KitConfig, KitProvider } from '@0xsequence/kit' import { KitCheckoutProvider } from '@0xsequence/kit-checkout' import { KitWalletProvider } from '@0xsequence/kit-wallet' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' -import { WagmiProvider } from 'wagmi' - -import { wagmiConfig, kitConfig } from '../config' +import { Config, WagmiProvider } from 'wagmi' const queryClient = new QueryClient() -export interface Web3ProviderProps { +export interface ProvidersProps { + wagmiConfig: Config + kitConfig: KitConfig children: React.ReactNode } -export const Web3Provider = (props: Web3ProviderProps) => { - const { children } = props +export const Providers = (props: ProvidersProps) => { + const { wagmiConfig, kitConfig, children } = props return ( diff --git a/examples/next/src/app/layout.tsx b/examples/next/src/app/layout.tsx index d1ecdb49..bdb6d137 100644 --- a/examples/next/src/app/layout.tsx +++ b/examples/next/src/app/layout.tsx @@ -5,7 +5,9 @@ import { Inter } from 'next/font/google' import './globals.css' import '@0xsequence/design-system/styles.css' -import { Web3Provider } from './Web3Provider' +import { wagmiConfig, kitConfig } from '../config' + +import { Providers } from './Providers' const inter = Inter({ subsets: ['latin'] }) @@ -23,7 +25,9 @@ export default function RootLayout({ - {children} + + {children} +