@pradip1995/segment-vertical-collection-scroll 0.1.1 → 0.1.2
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/resolve-collection.ts +6 -61
package/package.json
CHANGED
|
@@ -140,13 +140,15 @@ export function resolveAdminCollections(
|
|
|
140
140
|
})
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
// Pure dynamic mode:
|
|
143
|
+
// Pure dynamic mode: only collections marked home_featured in Medusa Admin.
|
|
144
|
+
// Do not fall back to every collection in the store (seed catalogs can have dozens).
|
|
144
145
|
if (collections && collections.length > 0) {
|
|
145
146
|
const valid = collections.filter((c) => c.title && c.title.trim())
|
|
146
|
-
const
|
|
147
|
+
const source = valid.filter(isHomeFeatured).sort(
|
|
147
148
|
(a, b) => getHomeSort(a) - getHomeSort(b)
|
|
148
149
|
)
|
|
149
|
-
|
|
150
|
+
|
|
151
|
+
if (source.length === 0) return []
|
|
150
152
|
|
|
151
153
|
return source.map((col, index) => {
|
|
152
154
|
const title = col.title.trim()
|
|
@@ -199,63 +201,6 @@ export function resolveAdminCollections(
|
|
|
199
201
|
})
|
|
200
202
|
}
|
|
201
203
|
|
|
202
|
-
|
|
203
|
-
return [
|
|
204
|
-
{
|
|
205
|
-
id: "fallback-col-silver",
|
|
206
|
-
title: "Silver Collection",
|
|
207
|
-
subtitle: "Effortlessly elegant sterling silver jewellery designed for contemporary sophistication.",
|
|
208
|
-
eyebrow: "EXCLUSIVE COLLECTION",
|
|
209
|
-
buttonText: "DISCOVER",
|
|
210
|
-
buttonLink: "/store?collection=silver-collection",
|
|
211
|
-
image: "/images/collections/emerald-sapphire.jpg",
|
|
212
|
-
imageAlt: "Silver Collection",
|
|
213
|
-
theme: "dark" as const,
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
id: "fallback-col-lab-grown",
|
|
217
|
-
title: "Lab Grown Diamonds",
|
|
218
|
-
subtitle: "Brilliant, conflict-free diamond creations sculpted with flawless ethical precision.",
|
|
219
|
-
eyebrow: "SUSTAINABLE LUXURY",
|
|
220
|
-
buttonText: "DISCOVER",
|
|
221
|
-
buttonLink: "/store?collection=lab-grown-collection",
|
|
222
|
-
image: "/images/collections/yellow-diamond.jpg",
|
|
223
|
-
imageAlt: "Lab Grown Diamonds",
|
|
224
|
-
theme: "light" as const,
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
id: "fallback-col-bridal",
|
|
228
|
-
title: "Bridal Suite",
|
|
229
|
-
subtitle: "Celebrate your eternal union with handcrafted heirloom jewellery crafted to transcend time.",
|
|
230
|
-
eyebrow: "CELEBRATE LOVE",
|
|
231
|
-
buttonText: "DISCOVER",
|
|
232
|
-
buttonLink: "/store?collection=-bridal-collection",
|
|
233
|
-
image: "/images/bridal/bridal-hero.png",
|
|
234
|
-
imageAlt: "Bridal Suite",
|
|
235
|
-
theme: "dark" as const,
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
id: "fallback-col-gold",
|
|
239
|
-
title: "Gold Heritage",
|
|
240
|
-
subtitle: "Intricate antique gold craftsmanship echoing the grandeur of timeless royalty.",
|
|
241
|
-
eyebrow: "ROYAL HERITAGE",
|
|
242
|
-
buttonText: "DISCOVER",
|
|
243
|
-
buttonLink: "/store?collection=gold-collection",
|
|
244
|
-
image: "/images/Old_Cut_Jewelry_02_copy_1_1.webp",
|
|
245
|
-
imageAlt: "Gold Heritage",
|
|
246
|
-
theme: "light" as const,
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
id: "fallback-col-diamond",
|
|
250
|
-
title: "High Jewellery Diamonds",
|
|
251
|
-
subtitle: "Magnificent diamond statement pieces radiating unmatched fire, light, and brilliance.",
|
|
252
|
-
eyebrow: "THE APEX OF LUXURY",
|
|
253
|
-
buttonText: "DISCOVER",
|
|
254
|
-
buttonLink: "/store?collection=diamond-collection",
|
|
255
|
-
image: "/images/collections/white-diamond.jpg",
|
|
256
|
-
imageAlt: "High Jewellery Diamonds",
|
|
257
|
-
theme: "dark" as const,
|
|
258
|
-
},
|
|
259
|
-
]
|
|
204
|
+
return []
|
|
260
205
|
}
|
|
261
206
|
|