Skip to content

Commit

Permalink
Import config from server rendered layout (breaks)
Browse files Browse the repository at this point in the history
  • Loading branch information
corbanbrook committed May 13, 2024
1 parent f4c09ee commit 181172b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -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 (
<WagmiProvider config={wagmiConfig}>
Expand Down
8 changes: 6 additions & 2 deletions examples/next/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'] })

Expand All @@ -23,7 +25,9 @@ export default function RootLayout({
<html lang="en">
<body className={inter.className}>
<ThemeProvider theme="dark">
<Web3Provider>{children}</Web3Provider>
<Providers wagmiConfig={wagmiConfig} kitConfig={kitConfig}>
{children}
</Providers>
</ThemeProvider>
</body>
</html>
Expand Down

0 comments on commit 181172b

Please sign in to comment.