added logout button to sidebar and updated translations
This commit is contained in:
@@ -4,6 +4,7 @@ import InventoryIcon from "@mui/icons-material/Inventory";
|
||||
import AddBoxIcon from "@mui/icons-material/AddBox";
|
||||
import StorageIcon from "@mui/icons-material/Storage";
|
||||
import SettingsIcon from "@mui/icons-material/Settings";
|
||||
import ExitToAppIcon from "@mui/icons-material/ExitToApp";
|
||||
import { useNavigate, useMatchRoute } from "@tanstack/react-router";
|
||||
import Cookies from "js-cookie";
|
||||
|
||||
@@ -68,6 +69,17 @@ export const Sidebar = () => {
|
||||
>
|
||||
{t("settings")}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
Cookies.remove("token");
|
||||
navigate({ to: "/login" });
|
||||
}}
|
||||
variant={variant("/login")}
|
||||
startDecorator={<ExitToAppIcon />}
|
||||
className={btnClass}
|
||||
>
|
||||
{t("logout")}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="rounded-2xl border border-white/70 bg-white/80 px-4 py-3 text-xs font-semibold uppercase tracking-[0.2em] text-[#0b6bcb] shadow-[0_12px_30px_rgba(12,38,78,0.12)]">
|
||||
|
||||
Reference in New Issue
Block a user