PWA Settings
Fixed webmanifest generation and pwa icon. Made nav bar text optional.
This commit is contained in:
23 files changed
+1065
-91
No files matched your search
@@ -46,6 +46,8 @@ export interface BottomNavProps {
|
||||
* role-aware component.
|
||||
*/
|
||||
variant?: "customer" | "staff";
|
||||
/** Business-wide, Super Administrator-only display setting (see Business.bottomNavShowLabels) — defaults to the original icon+label layout when a caller doesn't pass it. */
|
||||
showLabels?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,7 +56,7 @@ export interface BottomNavProps {
|
||||
* and pass it down — one less thing to get out of sync as routes are
|
||||
* added in later phases.
|
||||
*/
|
||||
export function BottomNav({ items, variant = "customer" }: BottomNavProps) {
|
||||
export function BottomNav({ items, variant = "customer", showLabels = true }: BottomNavProps) {
|
||||
const pathname = usePathname();
|
||||
const isStaff = variant === "staff";
|
||||
const activeHref = resolveActiveHref(pathname, items);
|
||||
@@ -85,14 +87,19 @@ export function BottomNav({ items, variant = "customer" }: BottomNavProps) {
|
||||
key={href}
|
||||
href={href}
|
||||
aria-current={active ? "page" : undefined}
|
||||
// Icon-only drops the flex-col label row entirely (not just
|
||||
// hides the text) so the tap target re-centers vertically
|
||||
// instead of leaving an empty gap where the label used to be.
|
||||
aria-label={showLabels ? undefined : label}
|
||||
className={cn(
|
||||
"flex flex-col items-center gap-1 rounded-lg px-3 py-1 transition-colors",
|
||||
"flex items-center rounded-lg transition-colors",
|
||||
showLabels ? "flex-col gap-1 px-3 py-1" : "justify-center px-4 py-2",
|
||||
active ? (isStaff ? "text-white" : "text-ink") : "hover:text-ink",
|
||||
isStaff && !active && "hover:text-white",
|
||||
)}
|
||||
>
|
||||
<Icon className="h-5 w-5" aria-hidden="true" />
|
||||
<span className="text-[10px] font-bold tracking-widest uppercase">{label}</span>
|
||||
<Icon className={showLabels ? "h-5 w-5" : "h-6 w-6"} aria-hidden="true" />
|
||||
{showLabels && <span className="text-[10px] font-bold tracking-widest uppercase">{label}</span>}
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -33,7 +33,7 @@ export async function StaffShell({
|
||||
<StaffSidebarNav items={items} businessName={branding.name} logoUrl={branding.logoUrl} />
|
||||
<NotificationBell href={notificationsHref} unreadCount={unreadNotificationCount} />
|
||||
<div id="main-content">{children}</div>
|
||||
<BottomNav items={items} variant="staff" />
|
||||
<BottomNav items={items} variant="staff" showLabels={branding.bottomNavShowLabels} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user