feat(ui): AppSwitcherMenu parity + hub-only warehouse headers + calendar badge removal

- shared AppSwitcherMenu ('پنل‌ها' title, active filled item with ✓ فعلی,
  «مدیریت انبار»/«مدیریت تدارکات» switcher, divider + خروج از حساب) used by
  both the procurement dashboard and the warehouse hub (PM variant keeps
  logout-only); replaced the old raw «بازگشت به دفتر» link
- warehouse header mirrors the procurement pattern: icon + hamburger only
  on the hub dashboard; sub-views (تغییر موجودی، کنترل روزانه، انبارها،
  کالاهای در راه، سازمان‌دهی) render a minimal header with just the title
  and «بازگشت به داشبورد»
- removed the self-referencing «داشبورد انبار» tab from the hub strip
- removed the red per-day transaction-count badges from the daily-control
  calendar (backend untouched — purely visual)
- removed the test subtitle «داده‌ها در پایگاه داده ذخیره می‌شوند» from the
  procurement dashboard header
This commit is contained in:
ali_mohaghegh
2026-09-03 15:01:07 +03:30
parent e4ae34ddbc
commit 0cd4f8f361
7 changed files with 53 additions and 61 deletions
@@ -1,10 +1,8 @@
import { useMemo, useState } from "react";
import { useNavigate } from "react-router-dom";
import { Warehouse as WarehouseIcon } from "lucide-react";
import { Header, PageLayout } from "../../components/layout/Header";
import { useAuthStore } from "../../store/auth";
import { PanelMenu } from "../../components/PanelMenu";
import { accountMenuItems, inventorySubheader, pmMenuItems, useLogout } from "./panelMenu";
import { inventorySubheader } from "./panelMenu";
import { useInventoryData, unitName, whName } from "./useInventoryData";
import { faNum } from "../../lib/formatters";
import { gregorianToJalali, jalaliToGregorian, MONTHS, toFa } from "../../lib/jalali";
@@ -20,8 +18,7 @@ function todayKey(): string {
// کنترل روزانه — پورت کامل تقویم شمسی نسخه‌ی ارسالی
export function DailyControlPage() {
const logout = useLogout();
const user = useAuthStore((s) => s.user);
const user = useAuthStore((s) => s.user);
const data = useInventoryData();
const navigate = useNavigate();
const isPM = user?.role === "pm";
@@ -124,8 +121,6 @@ export function DailyControlPage() {
sub={inventorySubheader(user)}
backTo="/inventory"
backLabel="بازگشت به داشبورد"
icon={<WarehouseIcon className="h-4.5 w-4.5" strokeWidth={2} />}
menu={<PanelMenu title="پنل مدیریت انبار" items={isAdmin ? accountMenuItems(logout) : pmMenuItems(logout)} />}
/>
<PageLayout className="flex flex-col gap-3">
{isAdmin && (
@@ -175,11 +170,6 @@ export function DailyControlPage() {
className={`relative rounded-lg py-2 text-[12px] ${!c.inMonth ? "text-muted/40" : ""} ${c.isToday ? "bg-accent font-bold text-white" : ""} ${sel === k ? "ring-2 ring-accent" : "hover:bg-accent/5"}`}
>
{toFa(jd)}
{c.n > 0 && (
<span className="absolute -top-0.5 -left-0.5 flex h-4 w-4 items-center justify-center rounded-full bg-red text-[9px] font-bold text-white">
{toFa(c.n)}
</span>
)}
</button>
);
})}