Hide customer action buttons (Submit/Add to bag) when in admin editing mode
Added isAdminEditing prop to DesignCanvas component. When true, hides the "Submit for Approval" and "Add to bag" buttons since these are customer-facing actions. The admin edit page now only shows the design canvas and the "Send to Customer for Review" button. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Haiku 4.5
parent
fded2af63b
commit
30e4a0c229
@@ -109,7 +109,7 @@ export default function EditDesignPage({ params }: { params: { id: string } }) {
|
||||
</div>
|
||||
|
||||
{/* Full Design Canvas */}
|
||||
<DesignCanvas product={design.product} />
|
||||
<DesignCanvas product={design.product} isAdminEditing={true} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -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<string | null>(product.sizes[0] ?? null);
|
||||
const [designWidthCm, setDesignWidthCm] = useState<number | null>(null);
|
||||
@@ -1498,7 +1498,7 @@ export default function DesignCanvas({ product }: { product: ProductDTO }) {
|
||||
+
|
||||
</button>
|
||||
</div>
|
||||
{approvalStatus === 'APPROVED' ? (
|
||||
{!isAdminEditing && (approvalStatus === 'APPROVED' ? (
|
||||
<button
|
||||
onClick={handleAddToBag}
|
||||
disabled={elementsFront.length === 0 && elementsBack.length === 0}
|
||||
@@ -1522,7 +1522,7 @@ export default function DesignCanvas({ product }: { product: ProductDTO }) {
|
||||
>
|
||||
{submittingForApproval ? 'Submitting…' : 'Submit for Approval'}
|
||||
</button>
|
||||
)}
|
||||
))}
|
||||
</div>
|
||||
{elementsFront.length === 0 && elementsBack.length === 0 && !approvalStatus && (
|
||||
<p className="text-xs text-splash-pink">Add text or images to personalize your design before submitting</p>
|
||||
|
||||
Reference in New Issue
Block a user