2024-06-06 13:10:13 -07:00
|
|
|
import NavBar from "../../Components/NavBar";
|
|
|
|
|
import { Outlet } from "react-router";
|
|
|
|
|
import DashboardSidebar from "../../Components/DashboardSidebar";
|
|
|
|
|
import "./index.css";
|
|
|
|
|
|
|
|
|
|
// Demo, remove me
|
|
|
|
|
import { jwtDecode } from "jwt-decode";
|
|
|
|
|
// Emd Demo
|
2024-05-06 12:29:36 -04:00
|
|
|
|
|
|
|
|
const HomeLayout = () => {
|
2024-06-06 13:10:13 -07:00
|
|
|
const token = localStorage.getItem("token");
|
|
|
|
|
const decodedToken = token && jwtDecode(token);
|
2024-06-01 14:29:54 -07:00
|
|
|
return (
|
|
|
|
|
<div className="home-layout">
|
|
|
|
|
<DashboardSidebar />
|
|
|
|
|
<div className="main-content">
|
|
|
|
|
<NavBar />
|
2024-06-06 13:10:13 -07:00
|
|
|
{/* Remove me later */}
|
|
|
|
|
{token && <p>You are logged in</p>}
|
|
|
|
|
{token && <p>First Name: {decodedToken.firstname}</p>}
|
|
|
|
|
{token && <p>Last Name: {decodedToken.lastname}</p>}
|
|
|
|
|
{token && <p>Email: {decodedToken.email}</p>}
|
|
|
|
|
{/* I am a demo */}
|
2024-06-01 14:29:54 -07:00
|
|
|
</div>
|
2024-06-06 22:04:30 +03:30
|
|
|
<Outlet />
|
2024-06-01 14:29:54 -07:00
|
|
|
</div>
|
|
|
|
|
);
|
2024-06-06 13:10:13 -07:00
|
|
|
};
|
2024-05-06 12:29:36 -04:00
|
|
|
|
2024-06-01 14:29:54 -07:00
|
|
|
export default HomeLayout;
|