From 9a75965b2cf94e839b03465b161983b1679e202c Mon Sep 17 00:00:00 2001 From: Paul Bailey Date: Wed, 3 Dec 2025 00:52:33 +0000 Subject: [PATCH] Move permission badge and share button to list title line - Created ListHeader component with permission and share on same line as title - Permission badge and share button now appear to the right of the title - Removed permission/share section from ListDetailView - More compact header layout with better use of space --- app/list/[id]/page.tsx | 38 ++++++-------- components/ListDetailView.tsx | 20 ------- components/ListHeader.tsx | 98 +++++++++++++++++++++++++++++++++++ 3 files changed, 115 insertions(+), 41 deletions(-) create mode 100644 components/ListHeader.tsx diff --git a/app/list/[id]/page.tsx b/app/list/[id]/page.tsx index 73020cd..b0143e3 100644 --- a/app/list/[id]/page.tsx +++ b/app/list/[id]/page.tsx @@ -7,6 +7,7 @@ import Link from 'next/link' import { ArrowLeft } from 'lucide-react' import InlineItemCreate from '@/components/InlineItemCreate' import ListDetailView from '@/components/ListDetailView' +import ListHeader from '@/components/ListHeader' export const dynamic = 'force-dynamic' export const revalidate = 0 @@ -36,27 +37,22 @@ export default async function ListDetailPage({ params }: { params: { id: string return (
{/* Header */} -
- - - Back to Lists - - -
-
-

{list.title}

-
- -

- {completedItems.length} of {list.items.length} tasks completed -

-
+ ({ + ...c, + permission: c.permission as 'editor' | 'viewer' + }))} + /> {/* Inline Item Creation - only show if user can edit */} {canEdit && ( diff --git a/components/ListDetailView.tsx b/components/ListDetailView.tsx index 1ac7b4c..42233be 100644 --- a/components/ListDetailView.tsx +++ b/components/ListDetailView.tsx @@ -156,26 +156,6 @@ export default function ListDetailView({ return (
- {/* Permission Badge and Share Button */} - {(permission || canShare) && ( -
- {permission && ( -
- -
- )} - {canShare && ( - - )} -
- )} - {/* Search Bar */} +} + +export default function ListHeader({ + listId, + listTitle, + listColor, + completedCount, + totalCount, + permission, + canShare, + ownerId, + ownerName, + ownerEmail, + collaborators +}: ListHeaderProps) { + const [isShareModalOpen, setIsShareModalOpen] = useState(false) + + return ( + <> +
+ + + Back to Lists + + +
+
+
+

{listTitle}

+
+ +
+ + {canShare && ( + + )} +
+
+ +

+ {completedCount} of {totalCount} tasks completed +

+
+ + setIsShareModalOpen(false)} + listId={listId} + listTitle={listTitle} + isOwner={permission === 'owner'} + ownerId={ownerId} + ownerName={ownerName} + ownerEmail={ownerEmail} + initialCollaborators={collaborators} + /> + + ) +}