diff --git a/src/app/[netname]/layout.tsx b/src/app/[netname]/layout.tsx index 3d29f9a..5a3af1b 100644 --- a/src/app/[netname]/layout.tsx +++ b/src/app/[netname]/layout.tsx @@ -1,7 +1,6 @@ import { Metadata } from 'next'; import React from 'react'; -import Wrapper from '@/components/global/Wrapper'; import { Netname } from '@/utils/types'; type Props = { @@ -26,5 +25,5 @@ export async function generateMetadata({ params }: Props): Promise { } export default function Layout({ children }: Props) { - return {children}; + return children; } diff --git a/src/components/global/Wrapper.tsx b/src/components/global/Wrapper.tsx deleted file mode 100644 index 47bc683..0000000 --- a/src/components/global/Wrapper.tsx +++ /dev/null @@ -1,25 +0,0 @@ -'use client'; - -import React, { useEffect } from 'react'; - -import '@/styles/globals.css'; -import '@/styles/colors.css'; - -import { useGetChain } from '@/hooks/useGetChain'; -import { useAccount, useSwitchChain } from 'wagmi'; - -export default function Wrapper({ children }: { children: React.ReactNode }) { - const chain = useGetChain(); - const account = useAccount(); - const switchChain = useSwitchChain(); - - useEffect(() => { - if (account.isConnected) { - if (chain.id !== account.chainId) { - switchChain.switchChain({ chainId: chain.id }); - } - } - }, [account, chain, switchChain]); - - return <>{children}; -}