Spaces:
Build error
Build error
| import '../styles/globals.css' | |
| import { Toaster } from 'react-hot-toast' | |
| import Layout from '../components/Layout' | |
| import { useRouter } from 'next/router' | |
| import { useEffect } from 'react' | |
| export default function App({ Component, pageProps }) { | |
| const router = useRouter() | |
| // Scroll to top on route change for better UX | |
| useEffect(() => { | |
| const handleRouteChange = () => { | |
| window.scrollTo({ top: 0, behavior: 'smooth' }) | |
| } | |
| router.events.on('routeChangeComplete', handleRouteChange) | |
| return () => router.events.off('routeChangeComplete', handleRouteChange) | |
| }, [router.events]) | |
| return ( | |
| <Layout> | |
| <Toaster | |
| position="top-right" | |
| toastOptions={{ | |
| duration: 3000, | |
| style: { | |
| background: '#1e3cc4', | |
| color: '#fff', | |
| borderRadius: '8px', | |
| fontSize: '14px', | |
| }, | |
| success: { | |
| style: { | |
| background: '#059669', | |
| }, | |
| }, | |
| error: { | |
| style: { | |
| background: '#dc2626', | |
| }, | |
| }, | |
| /> | |
| <Component {...pageProps} /> | |
| </Layout> | |
| ) | |
| } |