diff --git a/public/images/icons/vuesax/bold/pinterest.svg b/public/images/icons/vuesax/bold/pinterest.svg new file mode 100644 index 0000000..4af9570 --- /dev/null +++ b/public/images/icons/vuesax/bold/pinterest.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/app/shops/[shopId]/products/new/images/page.tsx b/src/app/shops/[shopId]/products/new/images/page.tsx index 436b2d8..8b84c30 100644 --- a/src/app/shops/[shopId]/products/new/images/page.tsx +++ b/src/app/shops/[shopId]/products/new/images/page.tsx @@ -36,16 +36,21 @@ function ProductImagesPage() { const [images, setImages] = useState([]); const [primaryIndex, setPrimaryIndex] = useState(0); + const [isPinterest, setIsPinterest] = useState(false); useEffect(() => { if (!listingId) return; - request<{ listing: { images: string[]; primaryImageIndex: number } }>( - "GET", - `/shop-products/${listingId}` - ).then((res) => { + request<{ + listing: { + images: string[]; + primaryImageIndex: number; + is_pinterest?: boolean; + }; + }>("GET", `/shop-products/${listingId}`).then((res) => { if (!res?.listing) return; setImages((res.listing.images || []).map((path) => ({ type: "existing", path }))); setPrimaryIndex(res.listing.primaryImageIndex || 0); + setIsPinterest(Boolean(res.listing.is_pinterest)); }); // eslint-disable-next-line react-hooks/exhaustive-deps }, [listingId]); @@ -83,6 +88,7 @@ function ProductImagesPage() { newFiles.forEach((img) => formData.append("images", img.file, img.file.name)); formData.append("existing_images", JSON.stringify(existingImages)); formData.append("primaryImageIndex", String(primaryIndex)); + formData.append("is_pinterest", String(isPinterest)); try { await request("PATCH", `/shop-products/${listingId}`, formData); @@ -172,6 +178,34 @@ function ProductImagesPage() { onChange={handleSelect} /> + + {t("shops.discoverTitle")} + +
+ + +
+ + {listing.is_pinterest && ( + + + + )}