diff --git a/apps/admin/src/pages/ProductEditPage.tsx b/apps/admin/src/pages/ProductEditPage.tsx index d11d6fe..4ff32c0 100644 --- a/apps/admin/src/pages/ProductEditPage.tsx +++ b/apps/admin/src/pages/ProductEditPage.tsx @@ -127,6 +127,7 @@ export default function ProductEditPage() { const [options, setOptions] = useState<{name: Record, values: Record[]}[]>([]) const [variants, setVariants] = useState[]>([]) const [images, setImages] = useState([]) + const [titleGraphicUrl, setTitleGraphicUrl] = useState('') const [availableAttributes, setAvailableAttributes] = useState([]) const [attributes, setAttributes] = useState([]) const [selectedDefinitionId, setSelectedDefinitionId] = useState(0) @@ -211,6 +212,7 @@ export default function ProductEditPage() { setOptions(parseOptions(prodData.options)) setVariants(prodData.variants || []) setImages(prodData.images || []) + setTitleGraphicUrl(prodData.titleGraphicUrl || '') setAttributes((prodData.attributes || []).map(parseEditableAttribute)) await fetchAttributeDefinitions(prodData.categoryId) } else { @@ -219,6 +221,7 @@ export default function ProductEditPage() { setName({ th: '', en: '' }) setDescription({ th: '', en: '' }) setDetails({ th: '', en: '' }) + setTitleGraphicUrl('') setOptions([]) setVariants([]) setImages([]) @@ -384,6 +387,7 @@ export default function ProductEditPage() { body: JSON.stringify({ categoryId, name, + titleGraphicUrl: titleGraphicUrl.trim() || null, description, details, options, @@ -395,7 +399,8 @@ export default function ProductEditPage() { price: Number(v.price) || 0, stock: Number(v.stock) || 0, sku: v.sku || '', - barcode: v.barcode || '' + barcode: v.barcode || '', + imageUrl: v.imageUrl || null, })), images: images.filter(img => img.url).map((img, idx) => ({ ...(img.id ? { id: img.id } : {}), @@ -550,6 +555,57 @@ export default function ProductEditPage() { +
+
+
+ + +
+ {titleGraphicUrl && ( + + )} +
+ + {titleGraphicUrl ? ( +
+
+ Title graphic preview +
+ +
+ ) : ( + + )} +

+ Optional. Displays as a branded logo banner above the product title on the website. +

+
+