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