From a5f09e9f7551921b7cca0ff79c92de4c18203ac9 Mon Sep 17 00:00:00 2001 From: Andymick Date: Sat, 18 Jul 2026 18:27:00 +0100 Subject: [PATCH] Disable Submit for Approval button when admin is editing design Added isAdminEditing prop to DesignCanvas. When true, the Submit for Approval button is disabled (grayed out) since the admin should use the Send to Customer for Review button instead. This is a safer approach than hiding the button. Co-Authored-By: Claude Haiku 4.5 --- src/app/admin/designs/[id]/edit/page.tsx | 2 +- src/components/DesignCanvas.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/admin/designs/[id]/edit/page.tsx b/src/app/admin/designs/[id]/edit/page.tsx index 13b068f..5fe2cd6 100644 --- a/src/app/admin/designs/[id]/edit/page.tsx +++ b/src/app/admin/designs/[id]/edit/page.tsx @@ -110,7 +110,7 @@ export default function EditDesignPage({ params }: { params: { id: string } }) { {/* Full Design Canvas */} - + ); diff --git a/src/components/DesignCanvas.tsx b/src/components/DesignCanvas.tsx index 3632957..7b32844 100644 --- a/src/components/DesignCanvas.tsx +++ b/src/components/DesignCanvas.tsx @@ -487,7 +487,7 @@ function generateCurvePath(type: string, radius: number, reverse: boolean = fals return path; } -export default function DesignCanvas({ product }: { product: ProductDTO }) { +export default function DesignCanvas({ product, isAdminEditing = false }: { product: ProductDTO; isAdminEditing?: boolean }) { const [color, setColor] = useState(product.colors[0]); const [size, setSize] = useState(product.sizes[0] ?? null); const [designWidthCm, setDesignWidthCm] = useState(null); @@ -1513,9 +1513,9 @@ export default function DesignCanvas({ product }: { product: ProductDTO }) { ) : (