This commit is contained in:
2024-04-13 11:23:15 +03:00
parent ac1c3639cc
commit 98239215e8
4 changed files with 25 additions and 28 deletions

View File

@ -16,17 +16,12 @@ const AppRoutes = ({ children }: { children: ReactNode }) => {
store.dispatch(getLocalToken());
store.dispatch(loadLanguage());
const user = useSelector((state: StorePrototype) => state.auth.user);
return (
<BrowserRouter>
{children}
<Routes>
<Route path="/" element={<MainPage />} />
<Route
path="/dashboard"
element={user ? <DashboardPage /> : <NotFoundPage />}
/>
<Route path="/dashboard" element={<DashboardPage />} />
<Route path="*" element={<NotFoundPage />} />
</Routes>
</BrowserRouter>