feat(31-02): add responsive icon buttons to setup detail page
Replace text action buttons (Add Items, Public/Private toggle, Delete Setup) with icon-only buttons on mobile. Migrate inline SVGs to LucideIcon component (plus, globe, trash-2). All icon buttons have aria-label and 44px touch targets.
This commit is contained in:
@@ -154,59 +154,73 @@ function SetupDetailPage() {
|
|||||||
{/* Actions — only visible to authenticated users */}
|
{/* Actions — only visible to authenticated users */}
|
||||||
{isAuthenticated && (
|
{isAuthenticated && (
|
||||||
<div className="flex items-center gap-3 py-4">
|
<div className="flex items-center gap-3 py-4">
|
||||||
|
{/* Add Items — desktop */}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setPickerOpen(true)}
|
onClick={() => setPickerOpen(true)}
|
||||||
className="inline-flex items-center gap-2 px-4 py-2 bg-gray-700 hover:bg-gray-800 text-white text-sm font-medium rounded-lg transition-colors"
|
className="hidden md:inline-flex items-center gap-2 px-4 py-2 bg-gray-700 hover:bg-gray-800 text-white text-sm font-medium rounded-lg transition-colors"
|
||||||
>
|
>
|
||||||
<svg
|
<LucideIcon name="plus" size={16} />
|
||||||
className="w-4 h-4"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
strokeWidth={2}
|
|
||||||
d="M12 4v16m8-8H4"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
Add Items
|
Add Items
|
||||||
</button>
|
</button>
|
||||||
|
{/* Add Items — mobile */}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => setPickerOpen(true)}
|
||||||
|
className="md:hidden inline-flex items-center justify-center min-w-[44px] min-h-[44px] p-2 bg-gray-700 hover:bg-gray-800 text-white rounded-lg transition-colors"
|
||||||
|
aria-label="Add Items"
|
||||||
|
title="Add Items"
|
||||||
|
>
|
||||||
|
<LucideIcon name="plus" size={16} />
|
||||||
|
</button>
|
||||||
|
|
||||||
{/* Public toggle */}
|
{/* Public toggle — desktop */}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => updateSetup.mutate({ isPublic: !setup.isPublic })}
|
onClick={() => updateSetup.mutate({ isPublic: !setup.isPublic })}
|
||||||
className={`inline-flex items-center gap-1.5 px-3 py-2 text-sm font-medium rounded-lg transition-colors ${
|
className={`hidden md:inline-flex items-center gap-1.5 px-3 py-2 text-sm font-medium rounded-lg transition-colors ${
|
||||||
setup.isPublic
|
setup.isPublic
|
||||||
? "text-green-700 bg-green-50 hover:bg-green-100"
|
? "text-green-700 bg-green-50 hover:bg-green-100"
|
||||||
: "text-gray-500 bg-gray-50 hover:bg-gray-100"
|
: "text-gray-500 bg-gray-50 hover:bg-gray-100"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<svg
|
<LucideIcon name="globe" size={16} />
|
||||||
className="w-4 h-4"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
strokeWidth={1.5}
|
|
||||||
>
|
|
||||||
<circle cx="12" cy="12" r="10" />
|
|
||||||
<path d="M2 12h20" />
|
|
||||||
<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" />
|
|
||||||
</svg>
|
|
||||||
{setup.isPublic ? "Public" : "Private"}
|
{setup.isPublic ? "Public" : "Private"}
|
||||||
</button>
|
</button>
|
||||||
|
{/* Public toggle — mobile */}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => updateSetup.mutate({ isPublic: !setup.isPublic })}
|
||||||
|
className={`md:hidden inline-flex items-center justify-center min-w-[44px] min-h-[44px] p-2 rounded-lg transition-colors ${
|
||||||
|
setup.isPublic
|
||||||
|
? "text-green-700 bg-green-50 hover:bg-green-100"
|
||||||
|
: "text-gray-500 bg-gray-50 hover:bg-gray-100"
|
||||||
|
}`}
|
||||||
|
aria-label={setup.isPublic ? "Public" : "Private"}
|
||||||
|
title={setup.isPublic ? "Public" : "Private"}
|
||||||
|
>
|
||||||
|
<LucideIcon name="globe" size={16} />
|
||||||
|
</button>
|
||||||
|
|
||||||
<div className="flex-1" />
|
<div className="flex-1" />
|
||||||
|
{/* Delete Setup — desktop */}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setConfirmDelete(true)}
|
onClick={() => setConfirmDelete(true)}
|
||||||
className="inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-red-600 bg-red-50 hover:bg-red-100 rounded-lg transition-colors"
|
className="hidden md:inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-red-600 bg-red-50 hover:bg-red-100 rounded-lg transition-colors"
|
||||||
>
|
>
|
||||||
Delete Setup
|
Delete Setup
|
||||||
</button>
|
</button>
|
||||||
|
{/* Delete Setup — mobile */}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => setConfirmDelete(true)}
|
||||||
|
className="md:hidden inline-flex items-center justify-center min-w-[44px] min-h-[44px] p-2 text-red-600 bg-red-50 hover:bg-red-100 rounded-lg transition-colors"
|
||||||
|
aria-label="Delete Setup"
|
||||||
|
title="Delete Setup"
|
||||||
|
>
|
||||||
|
<LucideIcon name="trash-2" size={16} />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user