polish
This commit is contained in:
@ -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>
|
||||
|
||||
Reference in New Issue
Block a user