diff --git a/components/providers/rainbow-kit.tsx b/components/providers/rainbow-kit.tsx deleted file mode 100644 index cc1c92f9..00000000 --- a/components/providers/rainbow-kit.tsx +++ /dev/null @@ -1,49 +0,0 @@ -"use client" - -import { ReactNode, useEffect } from "react" -import { EIP6963Connector } from "@web3modal/wagmi" -import { createWeb3Modal, useWeb3ModalTheme } from "@web3modal/wagmi/react" -import { createConfig, WagmiConfig } from "wagmi" -import { CoinbaseWalletConnector } from "wagmi/connectors/coinbaseWallet" -import { InjectedConnector } from "wagmi/connectors/injected" -import { WalletConnectConnector } from "wagmi/connectors/walletConnect" - -import { chains, publicClient, webSocketPublicClient } from "@/config/networks" -import { metadata } from "@/config/site" -import { useColorMode } from "@/lib/state/color-mode" - -const projectId = process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID! -if (!projectId) { - throw new Error("Project ID is undefined") -} - -const wagmiConfig = createConfig({ - autoConnect: true, - connectors: [ - new WalletConnectConnector({ - chains, - options: { projectId, showQrModal: false, metadata }, - }), - new EIP6963Connector({ chains }), - new InjectedConnector({ chains, options: { shimDisconnect: true } }), - new CoinbaseWalletConnector({ - chains, - options: { appName: metadata.name }, - }), - ], - publicClient, - webSocketPublicClient, -}) - -createWeb3Modal({ wagmiConfig, projectId, chains }) - -export function Web3Modal({ children }: { children: ReactNode }) { - const [colorMode] = useColorMode() - const { setThemeMode } = useWeb3ModalTheme() - - useEffect(() => { - if (colorMode !== "system") setThemeMode(colorMode) - }, [colorMode]) - - return {children} -} diff --git a/components/providers/root-provider.tsx b/components/providers/root-provider.tsx deleted file mode 100644 index a9efd3d3..00000000 --- a/components/providers/root-provider.tsx +++ /dev/null @@ -1,35 +0,0 @@ -"use client" - -import { ReactNode } from "react" -import { QueryClient, QueryClientProvider } from "@tanstack/react-query" -import { ThemeProvider } from "next-themes" -import { Provider as RWBProvider } from "react-wrap-balancer" - -import { useIsMounted } from "@/lib/hooks/use-is-mounted" -import HandleWalletEvents from "@/components/blockchain/handle-wallet-events" -import { Web3Modal } from "@/components/providers/web3modal" - -const queryClient = new QueryClient() -interface RootProviderProps { - children: ReactNode -} - -export default function RootProvider({ children }: RootProviderProps) { - const isMounted = useIsMounted() - return isMounted ? ( - - - - - {children} - - - - - ) : null -}