import React, { useEffect } from 'react'; import { Routes, Route, useLocation } from 'react-router-dom'; import Header from './components/Header.jsx'; import Footer from './components/Footer.jsx'; import Home from './pages/Home.jsx'; import About from './pages/About.jsx'; import ProjectsSection from './pages/ProjectsSection.jsx'; import ProjectDetail from './pages/ProjectDetail.jsx'; import Contact from './pages/Contact.jsx'; import DotCursor from './components/DotCursor.jsx'; export default function App() { const { pathname, hash } = useLocation(); useEffect(() => { if (hash) { const el = document.querySelector(hash); if (el) el.scrollIntoView({ behavior: 'smooth', block: 'start' }); } else { window.scrollTo({ top: 0, behavior: 'smooth' }); } }, [pathname, hash]); return (
} /> } /> } /> } /> } />
); }