feat(notes-pyqs): implement dynamic notes scanning, subject dropdown, and redesign UI
This commit is contained in:
14
src/App.tsx
14
src/App.tsx
@@ -1,4 +1,5 @@
|
||||
import { BrowserRouter, Routes, Route } from 'react-router-dom';
|
||||
import { useEffect } from 'react';
|
||||
import { BrowserRouter, Routes, Route, useLocation } from 'react-router-dom';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import MainLayout from '@/layouts/MainLayout';
|
||||
import Home from '@/pages/Home/Home';
|
||||
@@ -18,10 +19,21 @@ const queryClient = new QueryClient({
|
||||
},
|
||||
});
|
||||
|
||||
function ScrollToTop() {
|
||||
const { pathname } = useLocation();
|
||||
|
||||
useEffect(() => {
|
||||
window.scrollTo(0, 0);
|
||||
}, [pathname]);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<BrowserRouter>
|
||||
<ScrollToTop />
|
||||
<Routes>
|
||||
<Route element={<MainLayout />}>
|
||||
<Route path="/" element={<Home />} />
|
||||
|
||||
Reference in New Issue
Block a user