@pradip1995/segment-animation-collections 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/segment.tsx +8 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pradip1995/segment-animation-collections",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/segment.tsx CHANGED
@@ -22,15 +22,17 @@ export default function AnimationCollections({
22
22
  }) {
23
23
  // Try to use Medusa collections if available, otherwise fallback to static items
24
24
  const fallbackItems: CollectionItem[] = [
25
- { title: "NEW IN", image: "/images/cosmetics/hero-desktop.jpg?v=3", link: "/store" },
26
- { title: "ACCESSORIES", image: "/images/cosmetics/promo-makeup.jpg?v=3", link: "/store" },
27
- { title: "TRAIL", image: "/images/cosmetics/promo-skincare.jpg?v=3", link: "/store" },
28
- { title: "HIKE", image: "/images/cosmetics/shop-banner.jpg?v=3", link: "/store" },
25
+ { title: "NEW IN", image: "/theme-defaults/valero/demo-01-multicolumn-03_result.webp", link: "/store" },
26
+ { title: "MAKEUP", image: "/theme-defaults/valero/stylish-happy-girl-shopping-portrait-modern-woman-with-shop-bag-laughing-smiling-satisfied.jpg", link: "/store" },
27
+ { title: "SKINCARE", image: "/theme-defaults/valero/demo-01-blog-06_2355a964-fdff-41f0-836b-1fe627753fca.webp", link: "/store" },
28
+ { title: "BESTSELLERS", image: "/theme-defaults/valero/demo-01-gallery-03.webp", link: "/store" },
29
29
  ]
30
30
 
31
31
  let displayItems: CollectionItem[] = []
32
-
33
- if (collections && collections.length > 0) {
32
+
33
+ if (items && items.length > 0) {
34
+ displayItems = items
35
+ } else if (collections && collections.length > 0) {
34
36
  displayItems = collections.slice(0, 4).map((c: any) => {
35
37
  const metadata = c.metadata || {}
36
38
  const imageUrl = metadata.collection_icon || metadata.collection_image || metadata.image || metadata.thumbnail || fallbackItems[0].image
@@ -41,8 +43,6 @@ export default function AnimationCollections({
41
43
  link: `/store?collection=${c.handle || c.id}`
42
44
  }
43
45
  })
44
- } else if (items && items.length > 0) {
45
- displayItems = items
46
46
  } else {
47
47
  displayItems = fallbackItems
48
48
  }