@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.
- package/package.json +1 -1
- package/src/segment.tsx +8 -8
package/package.json
CHANGED
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: "/
|
|
26
|
-
{ title: "
|
|
27
|
-
{ title: "
|
|
28
|
-
{ title: "
|
|
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 (
|
|
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
|
}
|