Merge main_v2 mobile tabbar/inventory UI refinements into production
Brings in main_v2 17c7ae6 (tab bar sizing, inventory actions, date picker
proportions, stats lead time).
Conflicts resolved in favour of main_v2, which deliberately removed the
'تغییر موجودی' top button (nav lives in the tab bar / InventoryTopNav now)
and rewrote the proforma date field. Dropped the now-unused Button import.
This commit is contained in:
@@ -13,6 +13,7 @@ export function StatsBar({ total, offered, accepted, avgLeadTime }: StatsBarProp
|
||||
label: string;
|
||||
shortLabel: string;
|
||||
value: string;
|
||||
unit?: string;
|
||||
color: string;
|
||||
icon: LucideIcon;
|
||||
}[] = [
|
||||
@@ -38,9 +39,10 @@ export function StatsBar({ total, offered, accepted, avgLeadTime }: StatsBarProp
|
||||
icon: CheckCircle2,
|
||||
},
|
||||
{
|
||||
label: "میانگین lead time (روز)",
|
||||
shortLabel: "زمان تحویل",
|
||||
label: "میانگین زمان تحویل",
|
||||
shortLabel: "میانگین تحویل",
|
||||
value: avgLeadTime == null ? "—" : fmtNum(avgLeadTime),
|
||||
unit: avgLeadTime != null ? "روز" : undefined,
|
||||
color: "text-green",
|
||||
icon: Timer,
|
||||
},
|
||||
@@ -60,17 +62,22 @@ export function StatsBar({ total, offered, accepted, avgLeadTime }: StatsBarProp
|
||||
<span className="hidden sm:inline">{s.label}</span>
|
||||
</span>
|
||||
|
||||
{/* آیکون در موبایل حذف شده تا فضا برای متن باز بماند */}
|
||||
{/* آیکون در دسکتاپ */}
|
||||
<span className="hidden h-6 w-6 shrink-0 items-center justify-center rounded-md bg-slate-bg text-muted sm:flex">
|
||||
<s.icon className="h-3.5 w-3.5" strokeWidth={2} />
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* مقدار عددی */}
|
||||
{/* مقدار عددی به همراه واحد روز */}
|
||||
<div
|
||||
className={`mt-0.5 text-base font-extrabold leading-5 tabular-nums sm:mt-1 sm:text-[22px] sm:leading-8 ${s.color}`}
|
||||
className={`mt-0.5 flex items-baseline justify-center sm:justify-start gap-1 text-base font-extrabold leading-5 tabular-nums sm:mt-1 sm:text-[22px] sm:leading-8 ${s.color}`}
|
||||
>
|
||||
{s.value}
|
||||
<span>{s.value}</span>
|
||||
{s.unit && (
|
||||
<span className="text-[10px] font-medium text-muted sm:text-xs">
|
||||
{s.unit}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
@@ -48,7 +48,7 @@ const ADMIN_INV_TABS: TabDef[] = [
|
||||
function TabBar({ tabs }: { tabs: TabDef[] }) {
|
||||
return (
|
||||
<nav
|
||||
className="fixed inset-x-0 bottom-0 z-40 border-t border-line bg-panel md:hidden"
|
||||
className="fixed inset-x-0 bottom-0 z-40 border-t border-line bg-panel/95 backdrop-blur-md md:hidden"
|
||||
style={{ paddingBottom: "env(safe-area-inset-bottom)" }}
|
||||
>
|
||||
<div className="grid grid-cols-4">
|
||||
@@ -59,13 +59,13 @@ function TabBar({ tabs }: { tabs: TabDef[] }) {
|
||||
end={t.end}
|
||||
className={({ isActive }) =>
|
||||
cn(
|
||||
"flex min-h-[56px] flex-col items-center justify-center gap-0.5 whitespace-nowrap px-1 text-[10.5px] font-medium transition-colors",
|
||||
isActive ? "text-accent" : "text-muted",
|
||||
"flex min-h-[66px] flex-col items-center justify-center gap-1.5 whitespace-nowrap px-1 py-1 transition-all active:scale-95",
|
||||
isActive ? "text-accent font-bold" : "text-muted hover:text-ink font-medium",
|
||||
)
|
||||
}
|
||||
>
|
||||
<t.icon className="h-5 w-5" strokeWidth={1.8} />
|
||||
<span>{t.label}</span>
|
||||
<t.icon className="h-6.5 w-6.5" strokeWidth={2.2} />
|
||||
<span className="text-[12px] leading-tight tracking-tight">{t.label}</span>
|
||||
</NavLink>
|
||||
))}
|
||||
</div>
|
||||
@@ -97,4 +97,4 @@ export function MobileTabBar() {
|
||||
pathname.startsWith("/suppliers");
|
||||
if (onOfficePage && isOffice) return <TabBar tabs={PROC_TABS} />;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user