@neowhale/storefront 0.2.38 → 0.2.40
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/landing.global.js +28 -3
- package/dist/react/index.cjs +28 -3
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +28 -3
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -2298,7 +2298,24 @@ function VideoSection({ section, theme }) {
|
|
|
2298
2298
|
function GallerySection({ section, theme }) {
|
|
2299
2299
|
const { images } = section.content;
|
|
2300
2300
|
const columns = section.config?.columns || 3;
|
|
2301
|
+
const layout = section.config?.layout || "grid";
|
|
2301
2302
|
if (!images || images.length === 0) return null;
|
|
2303
|
+
if (layout === "collage") {
|
|
2304
|
+
return /* @__PURE__ */ jsx("div", { style: { padding: "0.375rem", maxWidth: 900, margin: "0 auto" }, children: /* @__PURE__ */ jsx("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "0.375rem" }, children: images.map((img, i) => /* @__PURE__ */ jsx("div", { style: {
|
|
2305
|
+
gridColumn: i === 0 ? "1 / -1" : void 0,
|
|
2306
|
+
aspectRatio: i === 0 ? "16/9" : i % 3 === 0 ? "3/4" : "1",
|
|
2307
|
+
overflow: "hidden",
|
|
2308
|
+
background: theme.surface
|
|
2309
|
+
}, children: /* @__PURE__ */ jsx(
|
|
2310
|
+
"img",
|
|
2311
|
+
{
|
|
2312
|
+
src: img.url,
|
|
2313
|
+
alt: img.alt || "",
|
|
2314
|
+
loading: i < 2 ? "eager" : "lazy",
|
|
2315
|
+
style: { width: "100%", height: "100%", objectFit: "cover", display: "block" }
|
|
2316
|
+
}
|
|
2317
|
+
) }, i)) }) });
|
|
2318
|
+
}
|
|
2302
2319
|
return /* @__PURE__ */ jsx("div", { style: { padding: "1.5rem", maxWidth: 800, margin: "0 auto" }, children: /* @__PURE__ */ jsx("div", { style: { display: "grid", gridTemplateColumns: `repeat(${columns}, 1fr)`, gap: "0.5rem" }, children: images.map((img, i) => /* @__PURE__ */ jsx("div", { style: { aspectRatio: "1", overflow: "hidden", background: theme.surface }, children: /* @__PURE__ */ jsx("img", { src: img.url, alt: img.alt || "", style: { width: "100%", height: "100%", objectFit: "cover", display: "block" } }) }, i)) }) });
|
|
2303
2320
|
}
|
|
2304
2321
|
function SocialLinksSection({ section, theme }) {
|
|
@@ -2522,6 +2539,7 @@ function LeadCaptureSection({ section, data, theme, onEvent }) {
|
|
|
2522
2539
|
const [newsletterOptIn, setNewsletterOptIn] = useState(false);
|
|
2523
2540
|
const [status, setStatus] = useState("idle");
|
|
2524
2541
|
const [errorMsg, setErrorMsg] = useState("");
|
|
2542
|
+
const [serverMessage, setServerMessage] = useState(null);
|
|
2525
2543
|
const gatewayUrl = c.gateway_url || data.gatewayUrl || "https://whale-gateway.fly.dev";
|
|
2526
2544
|
const storeId = c.store_id || data.store?.id;
|
|
2527
2545
|
const slug = c.landing_page_slug || data.landing_page?.slug;
|
|
@@ -2560,8 +2578,15 @@ function LeadCaptureSection({ section, data, theme, onEvent }) {
|
|
|
2560
2578
|
})
|
|
2561
2579
|
});
|
|
2562
2580
|
if (!res.ok) {
|
|
2563
|
-
const
|
|
2564
|
-
throw new Error(
|
|
2581
|
+
const body2 = await res.json().catch(() => ({}));
|
|
2582
|
+
throw new Error(body2?.error?.message || "Something went wrong. Please try again.");
|
|
2583
|
+
}
|
|
2584
|
+
const body = await res.json().catch(() => ({}));
|
|
2585
|
+
if (body.is_new === false) {
|
|
2586
|
+
setServerMessage({
|
|
2587
|
+
heading: "welcome back!",
|
|
2588
|
+
message: body.message || "your rewards are already loaded."
|
|
2589
|
+
});
|
|
2565
2590
|
}
|
|
2566
2591
|
setStatus("success");
|
|
2567
2592
|
onEvent?.("lead", { email, first_name: firstName || void 0, source: c.source || "landing_page", landing_page_slug: slug || void 0 });
|
|
@@ -2584,7 +2609,7 @@ function LeadCaptureSection({ section, data, theme, onEvent }) {
|
|
|
2584
2609
|
fontFamily: "inherit",
|
|
2585
2610
|
transition: "border-color 0.2s"
|
|
2586
2611
|
};
|
|
2587
|
-
if (status === "success") return /* @__PURE__ */ jsx(SuccessState, { theme, heading: successHeading, message: successMessage, couponCode: c.coupon_code });
|
|
2612
|
+
if (status === "success") return /* @__PURE__ */ jsx(SuccessState, { theme, heading: serverMessage?.heading || successHeading, message: serverMessage?.message || successMessage, couponCode: c.coupon_code });
|
|
2588
2613
|
return /* @__PURE__ */ jsxs("div", { style: { padding: "3.5rem 1.5rem", maxWidth: 560, margin: "0 auto" }, children: [
|
|
2589
2614
|
/* @__PURE__ */ jsx("style", { children: `@keyframes lc-spin { to { transform: rotate(360deg) } }` }),
|
|
2590
2615
|
/* @__PURE__ */ jsxs("div", { style: { background: theme.surface, border: `1px solid ${theme.fg}12`, padding: "clamp(2rem, 6vw, 3rem)" }, children: [
|