Update menu design and add toggle functionality for better responsiveness

Add a menu toggle button to show/hide the sidebar. Update locale files for `menuToggle` key. Refactor `protocol.tsx` to manage menu state, adjust layout for responsiveness, and apply square corners to the menu.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 470babcf-8feb-4bdb-8f18-66e74df799e6
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/ZgwFc55
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
Replit Agent
2026-07-09 06:37:50 +00:00
parent 3ed91778b2
commit 4315988e78
3 changed files with 20 additions and 4 deletions
+1
View File
@@ -1661,6 +1661,7 @@
}, },
"protocol": { "protocol": {
"title": "العلاقات العامة والمراسم", "title": "العلاقات العامة والمراسم",
"menuToggle": "إظهار/إخفاء القائمة",
"notes": "ملاحظات", "notes": "ملاحظات",
"statusLabel": "الحالة", "statusLabel": "الحالة",
"confirmReject": "هل أنت متأكد من رفض هذا الطلب؟", "confirmReject": "هل أنت متأكد من رفض هذا الطلب؟",
+1
View File
@@ -1534,6 +1534,7 @@
}, },
"protocol": { "protocol": {
"title": "Public Relations & Protocol", "title": "Public Relations & Protocol",
"menuToggle": "Show/hide menu",
"notes": "Notes", "notes": "Notes",
"statusLabel": "Status", "statusLabel": "Status",
"confirmReject": "Are you sure you want to reject this request?", "confirmReject": "Are you sure you want to reject this request?",
+18 -4
View File
@@ -33,6 +33,7 @@ import {
Image as ImageIcon, Image as ImageIcon,
Settings as SettingsIcon, Settings as SettingsIcon,
Clock3, Clock3,
Menu as MenuIcon,
} from "lucide-react"; } from "lucide-react";
import { import {
ResponsiveContainer, ResponsiveContainer,
@@ -881,6 +882,7 @@ export default function ProtocolPage() {
}); });
const [giftsGroupOpen, setGiftsGroupOpen] = useState(false); const [giftsGroupOpen, setGiftsGroupOpen] = useState(false);
const [roomsGroupOpen, setRoomsGroupOpen] = useState(false); const [roomsGroupOpen, setRoomsGroupOpen] = useState(false);
const [menuOpen, setMenuOpen] = useState(true);
const bookingAction = useMutation({ const bookingAction = useMutation({
mutationFn: (args: { id: number; action: "approve" | "cancel" }) => mutationFn: (args: { id: number; action: "approve" | "cancel" }) =>
@@ -1396,6 +1398,16 @@ export default function ProtocolPage() {
<Button variant="ghost" size="icon" onClick={back} aria-label={t("common.back")}> <Button variant="ghost" size="icon" onClick={back} aria-label={t("common.back")}>
<BackIcon size={20} /> <BackIcon size={20} />
</Button> </Button>
<Button
variant="ghost"
size="icon"
onClick={() => setMenuOpen((v) => !v)}
aria-label={t("protocol.menuToggle")}
title={t("protocol.menuToggle")}
data-testid="protocol-menu-toggle"
>
<MenuIcon size={20} />
</Button>
<div className="flex items-center gap-2 min-w-0"> <div className="flex items-center gap-2 min-w-0">
<div className="h-9 w-9 rounded-xl bg-sky-500 text-white flex items-center justify-center shrink-0"> <div className="h-9 w-9 rounded-xl bg-sky-500 text-white flex items-center justify-center shrink-0">
<Handshake size={20} /> <Handshake size={20} />
@@ -1407,9 +1419,10 @@ export default function ProtocolPage() {
</div> </div>
</header> </header>
<div className="max-w-6xl mx-auto px-4 py-5 flex flex-col md:flex-row gap-4 md:gap-6"> <div className="flex flex-col md:flex-row md:items-stretch">
<aside className="md:w-56 shrink-0"> {menuOpen && (
<nav className="flex md:flex-col gap-1 overflow-x-auto md:overflow-visible md:sticky md:top-20 rounded-xl bg-[#0f1d3d] p-2"> <aside className="md:w-56 shrink-0 bg-[#0f1d3d] md:min-h-[calc(100vh-61px)]">
<nav className="flex md:flex-col gap-1 overflow-x-auto md:overflow-visible p-2 md:sticky md:top-[73px]">
{TABS.map((item) => { {TABS.map((item) => {
const { key, label, icon: Icon } = item; const { key, label, icon: Icon } = item;
if (key === "issues") return null; if (key === "issues") return null;
@@ -1539,8 +1552,9 @@ export default function ProtocolPage() {
})} })}
</nav> </nav>
</aside> </aside>
)}
<main className="flex-1 min-w-0"> <main className="flex-1 min-w-0 w-full max-w-6xl md:mx-auto px-4 py-5">
{tab === "dashboard" && ( {tab === "dashboard" && (
<DashboardView data={dashboard.data} t={t} goTab={setTab} /> <DashboardView data={dashboard.data} t={t} goTab={setTab} />
)} )}