From f5fdc9a3706f885d54ff76141550272df6fd3d02 Mon Sep 17 00:00:00 2001 From: cupadev-admin Date: Mon, 9 Mar 2026 07:11:12 +0000 Subject: [PATCH] fix: apply designer agent improvements to src/App.tsx --- src/App.tsx | 64 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 12 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 2137a9b..adb79c8 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -7,9 +7,13 @@ import Gallery from './components/Gallery'; import Events from './components/Events'; import Contact from './components/Contact'; import Footer from './components/Footer'; +import Musee from './components/Musee'; + +type Page = 'home' | 'musee'; function App() { const [scrolled, setScrolled] = useState(false); + const [currentPage, setCurrentPage] = useState('home'); useEffect(() => { const handleScroll = () => setScrolled(window.scrollY > 60); @@ -17,19 +21,55 @@ function App() { return () => window.removeEventListener('scroll', handleScroll); }, []); + // Simple hash-based routing + useEffect(() => { + const checkRoute = () => { + if (window.location.hash === '#musee-page') { + setCurrentPage('musee'); + window.scrollTo(0, 0); + } else { + setCurrentPage('home'); + } + }; + checkRoute(); + window.addEventListener('hashchange', checkRoute); + return () => window.removeEventListener('hashchange', checkRoute); + }, []); + + const navigateTo = (page: Page) => { + setCurrentPage(page); + window.scrollTo({ top: 0, behavior: 'smooth' }); + if (page === 'musee') { + window.history.pushState(null, '', '#musee-page'); + } else { + window.history.pushState(null, '', '/'); + } + }; + return ( -
-
-
- - - - - - -
-
-
+ <> + + Aller au contenu principal + +
+
+
+ {currentPage === 'musee' ? ( + + ) : ( + <> + + + + + + + + )} +
+
+ ); }