Files
Wdipl-react/App.tsx

34 lines
776 B
TypeScript
Raw Permalink Normal View History

// App.tsx
import { Navigation } from "./components/Navigation";
import { Footer } from "./components/Footer";
import { CookieConsent } from "./components/CookieConsent";
import { AppRouter } from "./src/Router";
import { useLocation } from "react-router-dom";
import { useEffect } from "react";
2025-07-11 16:54:37 +05:30
// Smooth scroll to top function
const scrollToTop = () => {
window.scrollTo({ top: 0, behavior: 'smooth' });
2025-07-11 16:54:37 +05:30
};
function App() {
const location = useLocation();
2025-07-11 16:54:37 +05:30
// Scroll to top on route change
2025-07-11 16:54:37 +05:30
useEffect(() => {
scrollToTop();
}, [location.pathname]);
2025-07-11 16:54:37 +05:30
return (
<div className="min-h-screen bg-background">
<Navigation />
<main>
<AppRouter />
</main>
<Footer />
2025-07-11 16:54:37 +05:30
<CookieConsent />
</div>
);
}
export default App;