Skip to content

Commit

Permalink
Private route add
Browse files Browse the repository at this point in the history
  • Loading branch information
saagor16 committed Apr 17, 2024
1 parent 5bbd2ae commit 23872b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ const Navbar = () => {
Review
</NavLink>
</li>
{user && (
<>
<li>
<li>
<NavLink
to="/profile"
style={({ isActive }) => ({
Expand All @@ -77,6 +75,8 @@ const Navbar = () => {
Profile
</NavLink>
</li>
{user && (
<>
<li>
<NavLink
to="/updateProfile"
Expand All @@ -94,7 +94,7 @@ const Navbar = () => {
);

return (
<div className="container mx-auto p-2">
<div className="container mx-auto">
<div className="navbar bg-base-100 ">
<div className="navbar-start">
<div className="dropdown lg:hidden">
Expand Down
4 changes: 2 additions & 2 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ const router = createBrowserRouter([
},
{
path: "/updateProfile",
element: <UpdateProfile></UpdateProfile>,
element:<UpdateProfile></UpdateProfile>,
},
{
path: "/profile",
element: <Profile></Profile>,
element: <PrivateRoute><Profile></Profile></PrivateRoute>,
},
],
},
Expand Down

0 comments on commit 23872b1

Please sign in to comment.