fix(web): give phones a bottom navigation bar instead of the rail (UF-057)
At 375px the 64px icon rail took a fifth of the screen and Home's heading wrapped over five lines. Below sm the rail hides, a bottom bar carries the five places plus More (⌘K), and Home tightens its padding and heading.
This commit is contained in:
@@ -3,6 +3,7 @@ import { useLocation, useNavigate } from "react-router-dom";
|
||||
import { ChevronDown, Palette, Plus, Search } from "lucide-react";
|
||||
import { cmdKLabel } from "@/lib/platform";
|
||||
import { useDesignMode } from "@/lib/design-mode";
|
||||
import { isNavItemActive } from "@/lib/nav-items";
|
||||
import { HintTooltip } from "@/components/ui/hint-tooltip";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
|
||||
@@ -74,10 +75,7 @@ const Sidebar = ({
|
||||
const [design, setDesign] = useDesignMode();
|
||||
const calm = design === "calm";
|
||||
|
||||
const isActive = (item: SidebarNavItem): boolean =>
|
||||
item.activeWhen
|
||||
? item.activeWhen(pathname)
|
||||
: item.match.some((p) => pathname === p || pathname.startsWith(`${p}/`));
|
||||
const isActive = (item: SidebarNavItem): boolean => isNavItemActive(item, pathname);
|
||||
|
||||
const renderNavItem = (item: SidebarNavItem) => {
|
||||
const active = isActive(item);
|
||||
@@ -131,7 +129,9 @@ const Sidebar = ({
|
||||
<nav
|
||||
role="navigation"
|
||||
aria-label="Primary"
|
||||
className="waggle-sidebar relative z-10 flex w-16 lg:w-[248px] shrink-0 flex-col gap-1 overflow-y-auto border-r border-[var(--line-soft)] bg-[var(--bg-2)] px-2 lg:px-3 py-3.5"
|
||||
// Below sm the rail would take a fifth of a phone screen; MobileNav
|
||||
// carries the five places there instead.
|
||||
className="waggle-sidebar relative z-10 hidden w-16 sm:flex lg:w-[248px] shrink-0 flex-col gap-1 overflow-y-auto border-r border-[var(--line-soft)] bg-[var(--bg-2)] px-2 lg:px-3 py-3.5"
|
||||
>
|
||||
{/* Workspace switcher pill */}
|
||||
<RailHint content={workspaceName ?? "Workspace"}>
|
||||
|
||||
Reference in New Issue
Block a user