From a834e07abfdf96989add548394da345f3d902109 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sun, 23 Mar 2025 18:20:20 -0500 Subject: [PATCH] Refine sidebar collapse behavior --- src/components/HeaderList.tsx | 13 +++++++++++-- src/photo/PhotoGridSidebar.tsx | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/HeaderList.tsx b/src/components/HeaderList.tsx index be6be34a..2becf235 100644 --- a/src/components/HeaderList.tsx +++ b/src/components/HeaderList.tsx @@ -69,11 +69,20 @@ export default function HeaderList({ 'text-xs font-medium tracking-wider', 'border-medium rounded-md', 'px-[5px] h-5!', - 'hover:bg-dim active:bg-main', + 'hover:bg-dim hover:text-main active:bg-main', + 'group', )} > { - {isExpanded ? 'LESS' : 'MORE'} + {isExpanded + ? 'LESS' + : <> + MORE + + {' '} + {items.length - maxItems} + + } {isExpanded ? : } diff --git a/src/photo/PhotoGridSidebar.tsx b/src/photo/PhotoGridSidebar.tsx index eef5a795..0759bd38 100644 --- a/src/photo/PhotoGridSidebar.tsx +++ b/src/photo/PhotoGridSidebar.tsx @@ -30,7 +30,7 @@ import { } from '@/category'; import PhotoFocalLength from '@/focal/PhotoFocalLength'; -const SIDEBAR_ITEM_MAX_COUNT = 24; +const SIDEBAR_ITEM_MAX_COUNT = 28; export default function PhotoGridSidebar({ photosCount,