feat : add page profile (private component) and add section , modal for profile page

This commit is contained in:
ali josheghani
2024-06-06 09:55:28 +03:30
parent 18cc4948e6
commit 5300f9ec01
13 changed files with 267 additions and 58 deletions

View File

@@ -1,8 +1,8 @@
import { Navigate } from "react-router-dom";
import { Navigate, Outlet } from "react-router-dom";
import { isAuthenticated } from "../utils/auth";
const PrivateRoute = () => {
return !isAuthenticated() && <Navigate to="/" />;
return !isAuthenticated() ? <Outlet /> : <Navigate to="/login" />;
};
export default PrivateRoute;