Add customer registration and deployment updates
This commit is contained in:
@@ -1,13 +1,6 @@
|
||||
import { NavLink, Outlet, useLocation, useNavigate } from "react-router-dom";
|
||||
import { useSession } from "../lib/session";
|
||||
|
||||
const NAV_ITEMS = [
|
||||
{ to: "/home", label: "Start" },
|
||||
{ to: "/samples/new", label: "Neue Probe" },
|
||||
{ to: "/admin", label: "Verwaltung" },
|
||||
{ to: "/portal", label: "Portal" },
|
||||
];
|
||||
|
||||
const PAGE_TITLES: Record<string, string> = {
|
||||
"/home": "Startseite",
|
||||
"/samples/new": "Neuanlage einer Probe",
|
||||
@@ -35,6 +28,14 @@ export default function AppShell() {
|
||||
const { user, setUser } = useSession();
|
||||
const location = useLocation();
|
||||
const navigate = useNavigate();
|
||||
const navItems = user?.role === "ADMIN"
|
||||
? [{ to: "/portal", label: "Benutzerverwaltung" }]
|
||||
: [
|
||||
{ to: "/home", label: "Start" },
|
||||
{ to: "/samples/new", label: "Neue Probe" },
|
||||
{ to: "/admin", label: "Verwaltung" },
|
||||
{ to: "/portal", label: "Portal" },
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="app-shell">
|
||||
@@ -44,7 +45,7 @@ export default function AppShell() {
|
||||
</div>
|
||||
|
||||
<nav className="sidebar__nav">
|
||||
{NAV_ITEMS.map((item) => (
|
||||
{navItems.map((item) => (
|
||||
<NavLink
|
||||
key={item.to}
|
||||
to={item.to}
|
||||
@@ -78,12 +79,6 @@ export default function AppShell() {
|
||||
<div className="topbar__headline">
|
||||
<h2>{resolvePageTitle(location.pathname)}</h2>
|
||||
</div>
|
||||
|
||||
<div className="topbar__actions">
|
||||
<button type="button" className="accent-button" onClick={() => navigate("/samples/new")}>
|
||||
Neuanlage
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main className="content-area">
|
||||
|
||||
Reference in New Issue
Block a user