Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion components/admin/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,13 @@ export function AdminSidebar({
key={href}
href={href}
onClick={() => setOpen(false)}
// The comparison below already knows which item is the page you are
// on; it only painted it. Announce it too.
aria-current={pathname.startsWith(href) ? "page" : undefined}
className={cn(
"flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors",
// min-h-11 is the 44px touch floor. py-2 on text-sm came out near
// 36px on the sidebar this app is driven from.
"flex min-h-11 items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors",
pathname.startsWith(href)
? "bg-teal-600 text-white"
: "text-slate-400 hover:bg-slate-800 hover:text-white",
Expand Down
6 changes: 4 additions & 2 deletions components/portal/sidebar-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ export function PortalSidebarNav({ onClose, unreadThreads = 0 }: Props) {
key={href}
href={href}
onClick={onClose}
aria-current={isActive(href) ? "page" : undefined}
className={cn(
"flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors",
"flex min-h-11 items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors",
isActive(href)
? "bg-teal-50 text-teal-700"
: "text-slate-600 hover:bg-slate-50 hover:text-slate-900",
Expand All @@ -81,8 +82,9 @@ export function PortalSidebarNav({ onClose, unreadThreads = 0 }: Props) {
<Link
href="/check-in"
onClick={onClose}
aria-current={isActive("/check-in") ? "page" : undefined}
className={cn(
"flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-semibold transition-colors",
"flex min-h-11 items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-semibold transition-colors",
isActive("/check-in")
? "bg-teal-600 text-white"
: "bg-teal-600 text-white hover:bg-teal-700",
Expand Down