fix: move crop button into edit mode so it's reachable
The crop icon button was in the view-mode branch but conditioned on isEditing, making it unreachable. Moved it below ImageUpload in the edit-mode branch where it belongs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -292,6 +292,28 @@ function ItemDetail() {
|
||||
});
|
||||
}}
|
||||
/>
|
||||
{imageUrl && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
setIsEditing(false);
|
||||
setEditingCrop(true);
|
||||
}}
|
||||
className="mt-2 w-8 h-8 flex items-center justify-center rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100 transition-colors"
|
||||
title="Adjust framing"
|
||||
>
|
||||
<svg
|
||||
className="w-4 h-4"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
strokeWidth={2}
|
||||
>
|
||||
<path d="M6.13 1L6 16a2 2 0 0 0 2 2h15" />
|
||||
<path d="M1 6.13L16 6a2 2 0 0 1 2 2v15" />
|
||||
</svg>
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
) : editingCrop && imageUrl ? (
|
||||
<div className="mb-6">
|
||||
@@ -343,25 +365,6 @@ function ItemDetail() {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{imageUrl && isEditing && !isReference && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setEditingCrop(true)}
|
||||
className="mb-4 w-8 h-8 flex items-center justify-center rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100 transition-colors"
|
||||
title="Adjust framing"
|
||||
>
|
||||
<svg
|
||||
className="w-4 h-4"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
strokeWidth={2}
|
||||
>
|
||||
<path d="M6.13 1L6 16a2 2 0 0 0 2 2h15" />
|
||||
<path d="M1 6.13L16 6a2 2 0 0 1 2 2v15" />
|
||||
</svg>
|
||||
</button>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user