From d7051c6b16c38aa013a4d69e56c1b1a71ba63646 Mon Sep 17 00:00:00 2001 From: payacom <59262811+payacom@users.noreply.github.com> Date: Wed, 16 Sep 2026 10:24:12 +0330 Subject: [PATCH] Add Pinterest product tag: discover filter, Reels badge, and images-step checkbox - Pinterest filter toggle on the Shop discover page, alongside "All", backed by the backend's new ?pinterest=true param on /shop-products/discover - Pinterest badge shown above the favorite button in ShopReelsView's action rail for products tagged is_pinterest - "Pinterest product" checkbox at the bottom of the product images step (create wizard and edit flow share the same route) - New pinterest bold-icon SVG under public/images/icons/vuesax/bold Co-Authored-By: Claude Sonnet 5 --- public/images/icons/vuesax/bold/pinterest.svg | 3 ++ .../[shopId]/products/new/images/page.tsx | 42 +++++++++++++++++-- src/app/shops/discover/page.tsx | 36 +++++++++++++++- src/components/shops/ShopReelsView.tsx | 13 ++++++ src/locales/en/common.json | 3 ++ src/locales/fa/common.json | 3 ++ src/types/types.ts | 1 + 7 files changed, 96 insertions(+), 5 deletions(-) create mode 100644 public/images/icons/vuesax/bold/pinterest.svg 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 && ( + + + + )}