33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
import { Route, Routes, Navigate } from "react-router-dom";
|
|
|
|
import SignInPage from "../application/Authentication/SignInPage";
|
|
import SignUpPage from "../application/Authentication/SignUpPage";
|
|
import ResetPasswordPage from "../application/Authentication/ResetPasswordPage";
|
|
import Dashboard from "../application/dashboard/Dashboard";
|
|
import ProfilePage from "../application/profile/ProfilePage";
|
|
import ProtectedRoutes from "./ProtectedRoutes";
|
|
|
|
const AppRoutes = () => {
|
|
return (
|
|
<Routes>
|
|
{/* Public Routes */}
|
|
<Route path="/signin" element={<SignInPage />} />
|
|
<Route path="/signup" element={<SignUpPage />} />
|
|
<Route path="/reset-password" element={<ResetPasswordPage />} />
|
|
|
|
{/* Protected Routes */}
|
|
<Route element={<ProtectedRoutes />}>
|
|
<Route path="/dashboard" element={<Dashboard />} />
|
|
<Route path="/profile" element={<ProfilePage />} />
|
|
{/* Redirect root to dashboard if logged in (ProtectedRoutes handles auth check usually, or we redirect to signin if not) */}
|
|
<Route path="/" element={<Navigate to="/dashboard" replace />} />
|
|
</Route>
|
|
|
|
{/* Catch all - Redirect to dashboard which will handle auth or show dashboard */}
|
|
<Route path="*" element={<Navigate to="/dashboard" replace />} />
|
|
</Routes>
|
|
);
|
|
};
|
|
|
|
export default AppRoutes;
|