@neowhale/storefront 0.2.25 → 0.2.26

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.
@@ -2781,6 +2781,7 @@ function LeadCaptureSection({ section, data, theme }) {
2781
2781
  const c = section.content;
2782
2782
  const [firstName, setFirstName] = useState("");
2783
2783
  const [email, setEmail] = useState("");
2784
+ const [newsletterOptIn, setNewsletterOptIn] = useState(false);
2784
2785
  const [status, setStatus] = useState("idle");
2785
2786
  const [errorMsg, setErrorMsg] = useState("");
2786
2787
  const gatewayUrl = c.gateway_url || data.gatewayUrl || "https://whale-gateway.fly.dev";
@@ -2800,7 +2801,11 @@ function LeadCaptureSection({ section, data, theme }) {
2800
2801
  first_name: firstName || void 0,
2801
2802
  source: c.source || "landing_page",
2802
2803
  landing_page_slug: slug || void 0,
2803
- tags: c.tags || void 0
2804
+ tags: (() => {
2805
+ const t = [...c.tags || []];
2806
+ if (newsletterOptIn) t.push(c.newsletter_tag || "newsletter-subscriber");
2807
+ return t.length > 0 ? t : void 0;
2808
+ })()
2804
2809
  })
2805
2810
  });
2806
2811
  if (!res.ok) {
@@ -2910,6 +2915,33 @@ function LeadCaptureSection({ section, data, theme }) {
2910
2915
  }
2911
2916
  )
2912
2917
  ] }),
2918
+ c.show_newsletter_opt_in !== false && /* @__PURE__ */ jsxs("label", { style: {
2919
+ display: "flex",
2920
+ alignItems: "center",
2921
+ gap: "0.5rem",
2922
+ cursor: "pointer",
2923
+ fontSize: "0.8rem",
2924
+ color: `${theme.fg}90`,
2925
+ fontWeight: 300,
2926
+ lineHeight: 1.4
2927
+ }, children: [
2928
+ /* @__PURE__ */ jsx(
2929
+ "input",
2930
+ {
2931
+ type: "checkbox",
2932
+ checked: newsletterOptIn,
2933
+ onChange: (e) => setNewsletterOptIn(e.target.checked),
2934
+ style: {
2935
+ width: 16,
2936
+ height: 16,
2937
+ accentColor: theme.accent,
2938
+ cursor: "pointer",
2939
+ flexShrink: 0
2940
+ }
2941
+ }
2942
+ ),
2943
+ c.newsletter_label || "Also sign me up for the newsletter \u2014 new drops, deals, and company news."
2944
+ ] }),
2913
2945
  status === "error" && errorMsg && /* @__PURE__ */ jsx("p", { style: { fontSize: "0.8rem", color: "#e55", margin: 0, fontWeight: 400 }, children: errorMsg }),
2914
2946
  /* @__PURE__ */ jsxs(
2915
2947
  "button",