Skip to content

Commit

Permalink
Ya se muestra el Navbar al iniciar sesión
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosMachadoMenendez committed Mar 17, 2024
1 parent 9355b3f commit ab40e0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion webapp/src/components/ProtectedRoute.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Navigate, Outlet } from "react-router-dom";
import { useAuth } from "./login/AuthProvider";
import Navbar from "./Navbar";

export const ProtectedRoute = () => {
const { token } = useAuth();
Expand All @@ -11,5 +12,5 @@ export const ProtectedRoute = () => {
}

// If authenticated, render the child routes
return <Outlet />;
return <div><Navbar></Navbar><Outlet /></div>;
};
2 changes: 1 addition & 1 deletion webapp/src/components/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const Routes = () => {
]);

// Provide the router configuration using RouterProvider
return <RouterProvider router={router}> <Navbar /> </RouterProvider>
return <RouterProvider router={router}> </RouterProvider>
;
};

Expand Down

0 comments on commit ab40e0b

Please sign in to comment.