Skip to content

Instantly share code, notes, and snippets.

@Daltonic
Created December 20, 2023 16:57
Show Gist options
  • Save Daltonic/9c242246cfaa297a1b1bb6c90ac4457a to your computer and use it in GitHub Desktop.
Save Daltonic/9c242246cfaa297a1b1bb6c90ac4457a to your computer and use it in GitHub Desktop.
Dapp Bnb
import { ToastContainer } from 'react-toastify'
import '@/styles/globals.css'
import 'react-toastify/dist/ReactToastify.css'
import '@rainbow-me/rainbowkit/styles.css'
import 'react-datepicker/dist/react-datepicker.css'
import { useEffect, useState } from 'react'
import Providers from '@/services/provider'
import { Footer, Header } from '@/components'
export default function App({ Component, pageProps }) {
const [showChild, setShowChild] = useState(false)
useEffect(() => {
setShowChild(true)
}, [])
if (!showChild || typeof window === 'undefined') {
return null
} else {
return (
<Providers pageProps={pageProps}>
<div className="relative h-screen min-w-screen">
<Header />
<Component {...pageProps} />
<div className="h-20"></div>
<Footer />
</div>
<ToastContainer
position="bottom-center"
autoClose={5000}
hideProgressBar={false}
newestOnTop={false}
closeOnClick
rtl={false}
pauseOnFocusLoss
draggable
pauseOnHover
theme="dark"
/>
</Providers>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment