From d4afa43abf36cc60c8ef152a4b6b667ef46ae923 Mon Sep 17 00:00:00 2001 From: Richard R Date: Mon, 1 Jun 2026 11:58:30 -0600 Subject: [PATCH] refactor(ui): unify button usage in settings, admin, and doclist components Replace native button elements with shared Button, ChoiceTile, and IconButton components for consistent UI behavior and styling. Update classNames and props to match new component APIs. Adjust FinderSidebar to use utility function for conditional class merging. --- src/components/SettingsModal.tsx | 10 +++++----- src/components/admin/AdminFeaturesPanel.tsx | 8 +++++--- src/components/doclist/DocumentList.tsx | 9 +++++---- src/components/doclist/window/FinderSidebar.tsx | 4 ++-- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/components/SettingsModal.tsx b/src/components/SettingsModal.tsx index 7157f33..7d71964 100644 --- a/src/components/SettingsModal.tsx +++ b/src/components/SettingsModal.tsx @@ -1168,20 +1168,20 @@ export function SettingsModal({ {/* Export Data */} {session?.user && ( - + )} {/* Actions */} @@ -1438,7 +1438,7 @@ function SettingsChangelogPanel({ + )} {dirty ? ( Modified diff --git a/src/components/doclist/DocumentList.tsx b/src/components/doclist/DocumentList.tsx index 3b96fb1..b854554 100644 --- a/src/components/doclist/DocumentList.tsx +++ b/src/components/doclist/DocumentList.tsx @@ -22,6 +22,7 @@ import { ConfirmDialog } from '@/components/ConfirmDialog'; import { CreateFolderDialog } from '@/components/doclist/CreateFolderDialog'; import { DocumentListSkeleton } from '@/components/doclist/DocumentListSkeleton'; import { DocumentUploader, type UploadBatchState } from '@/components/documents/DocumentUploader'; +import { IconButton } from '@/components/ui'; import { DocumentDndProvider } from './dnd/DocumentDndProvider'; import { DocumentSelectionProvider, @@ -664,16 +665,16 @@ function DocumentListInner({ brand, appActions }: DocumentListInnerProps) {

Drag files onto each other to make folders. Drop into the sidebar to move.

- + )} diff --git a/src/components/doclist/window/FinderSidebar.tsx b/src/components/doclist/window/FinderSidebar.tsx index b534af0..573dcb0 100644 --- a/src/components/doclist/window/FinderSidebar.tsx +++ b/src/components/doclist/window/FinderSidebar.tsx @@ -7,7 +7,7 @@ import type { Folder, SidebarFilter } from '@/types/documents'; import { PDFIcon, EPUBIcon, FileIcon, DotsHorizontalIcon } from '@/components/icons/Icons'; import { FolderIcon, HomeIcon, ClockIcon, FolderPlusIcon } from './finderIcons'; import { DND_DOCUMENT, type DocumentDragItem } from '../dnd/dndTypes'; -import { IconButton, MenuItemClass, Sidebar as SidebarShell, SidebarNav, SidebarNavGroup, SidebarNavItem, menuPanelClass } from '@/components/ui'; +import { IconButton, MenuItemClass, Sidebar as SidebarShell, SidebarNav, SidebarNavGroup, SidebarNavItem, cn, menuPanelClass } from '@/components/ui'; interface FinderSidebarProps { filter: SidebarFilter; @@ -248,7 +248,7 @@ export function FinderSidebar({ onRowAction?.(); }} disabled={disabled} - className={disabled ? 'flex w-full cursor-not-allowed items-center gap-2 rounded-md px-2 py-2 text-xs text-faint' : MenuItemClass(active)} + className={cn(MenuItemClass(active), disabled && 'cursor-not-allowed text-faint')} >