@neowhale/storefront 0.2.32 → 0.2.33
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/dist/react/index.cjs +11 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +11 -1
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -3527,6 +3527,15 @@ function LandingPage({
|
|
|
3527
3527
|
if (!data) return null;
|
|
3528
3528
|
return /* @__PURE__ */ jsx(PageLayout, { data, gatewayUrl, renderSection, onEvent, analyticsContext });
|
|
3529
3529
|
}
|
|
3530
|
+
function isSectionVisible(section, urlParams) {
|
|
3531
|
+
const vis = section.config?.visibility;
|
|
3532
|
+
if (!vis?.params) return true;
|
|
3533
|
+
for (const [key, allowed] of Object.entries(vis.params)) {
|
|
3534
|
+
const val = urlParams.get(key);
|
|
3535
|
+
if (!val || !allowed.includes(val)) return false;
|
|
3536
|
+
}
|
|
3537
|
+
return true;
|
|
3538
|
+
}
|
|
3530
3539
|
function PageLayout({
|
|
3531
3540
|
data,
|
|
3532
3541
|
gatewayUrl,
|
|
@@ -3546,7 +3555,8 @@ function PageLayout({
|
|
|
3546
3555
|
};
|
|
3547
3556
|
const fontFamily = lp.font_family || theme.fontDisplay || "system-ui, -apple-system, sans-serif";
|
|
3548
3557
|
const logoUrl = store?.logo_url;
|
|
3549
|
-
const
|
|
3558
|
+
const urlParams = typeof window !== "undefined" ? new URLSearchParams(window.location.search) : new URLSearchParams();
|
|
3559
|
+
const sorted = [...lp.sections].sort((a, b) => a.order - b.order).filter((s) => isSectionVisible(s, urlParams));
|
|
3550
3560
|
const sectionData = { ...data, gatewayUrl, landing_page: { slug: lp.slug }, analyticsContext };
|
|
3551
3561
|
return /* @__PURE__ */ jsxs("div", { style: { minHeight: "100dvh", background: theme.bg, color: theme.fg, fontFamily }, children: [
|
|
3552
3562
|
lp.custom_css && /* @__PURE__ */ jsx("style", { children: lp.custom_css }),
|