Created the Sidebar.jsx

This commit is contained in:
Mathias Wagner 2023-11-14 09:47:29 +01:00
parent 21191d0b56
commit f2c0754203
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -25,10 +25,11 @@ export const Sidebar = ({open, setOpen}) => {
{sidebar.map((page) => {
const current = getPage(window.location.pathname);
if (page.route) return;
return (
<div className={"sidebar-item" + (current.path === page.path ? " item-active" : "")}
key={page.name}
onClick={() => update(page.path)}>
<div className={"sidebar-item" + (current.route === page.path || current.path === page.path ? " item-active" : "")}
key={page.name} onClick={() => update(page.path)}>
<FontAwesomeIcon icon={page.icon}/>
<h1>{page.name}</h1>
</div>