@hook-sdk/template 0.9.0 → 0.9.1
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/index.cjs +78 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +78 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2287,6 +2287,8 @@ function DefaultPaywall() {
|
|
|
2287
2287
|
const monthlyCents = plan.data?.priceCents ?? 0;
|
|
2288
2288
|
const yearlyCents = plan.data?.yearlyPriceCents ?? null;
|
|
2289
2289
|
const activeCents = cycle === "YEARLY" && yearlyCents ? monthlyEquivalent("YEARLY") : monthlyCents;
|
|
2290
|
+
const cycleValueCents = cycle === "YEARLY" && yearlyCents ? yearlyCents : monthlyCents;
|
|
2291
|
+
const cycleLabel = cycle === "YEARLY" ? "por ano" : "por m\xEAs";
|
|
2290
2292
|
const pct = (0, import_react14.useMemo)(() => {
|
|
2291
2293
|
if (!yearlyCents || !monthlyCents) return 0;
|
|
2292
2294
|
const derived = Math.round((1 - yearlyCents / 12 / monthlyCents) * 100);
|
|
@@ -2643,6 +2645,50 @@ function DefaultPaywall() {
|
|
|
2643
2645
|
)
|
|
2644
2646
|
] }),
|
|
2645
2647
|
error && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { role: "alert", style: { color: "#c00", marginBottom: 12 }, children: error.message }),
|
|
2648
|
+
method === "pix-auto" && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2649
|
+
"div",
|
|
2650
|
+
{
|
|
2651
|
+
"data-testid": "paywall-pix-callout",
|
|
2652
|
+
style: {
|
|
2653
|
+
background: "rgba(0,0,0,0.04)",
|
|
2654
|
+
borderLeft: "3px solid var(--hook-color-primary)",
|
|
2655
|
+
padding: "10px 12px",
|
|
2656
|
+
marginBottom: 12,
|
|
2657
|
+
borderRadius: 4,
|
|
2658
|
+
fontSize: 12,
|
|
2659
|
+
lineHeight: 1.45,
|
|
2660
|
+
textAlign: "left"
|
|
2661
|
+
},
|
|
2662
|
+
children: [
|
|
2663
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("strong", { children: "Como funciona:" }),
|
|
2664
|
+
" no app do seu banco vai aparecer uma cobran\xE7a de",
|
|
2665
|
+
" ",
|
|
2666
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("strong", { children: "R$ 0,01" }),
|
|
2667
|
+
" \u2014 \xE9 simb\xF3lica, s\xF3 pra ativar o PIX Autom\xE1tico.",
|
|
2668
|
+
trialDays > 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
2669
|
+
" ",
|
|
2670
|
+
"Depois, ",
|
|
2671
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("strong", { children: [
|
|
2672
|
+
trialDays,
|
|
2673
|
+
" dias gr\xE1tis"
|
|
2674
|
+
] }),
|
|
2675
|
+
"; a cobran\xE7a de",
|
|
2676
|
+
" ",
|
|
2677
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("strong", { children: formatBRL(cycleValueCents) }),
|
|
2678
|
+
" ",
|
|
2679
|
+
cycleLabel,
|
|
2680
|
+
" s\xF3 come\xE7a depois."
|
|
2681
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
2682
|
+
" ",
|
|
2683
|
+
"A cobran\xE7a de ",
|
|
2684
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("strong", { children: formatBRL(cycleValueCents) }),
|
|
2685
|
+
" ",
|
|
2686
|
+
cycleLabel,
|
|
2687
|
+
" vem em seguida."
|
|
2688
|
+
] })
|
|
2689
|
+
]
|
|
2690
|
+
}
|
|
2691
|
+
),
|
|
2646
2692
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2647
2693
|
"button",
|
|
2648
2694
|
{
|
|
@@ -2698,6 +2744,38 @@ function DefaultPaywall() {
|
|
|
2698
2744
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
2699
2745
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h2", { style: { marginTop: 0, fontSize: 18 }, children: "Pague com Pix Autom\xE1tico" }),
|
|
2700
2746
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { style: { fontSize: 13, opacity: 0.75 }, children: "Escaneie o QR Code no app do seu banco pra autorizar o d\xE9bito recorrente." }),
|
|
2747
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2748
|
+
"p",
|
|
2749
|
+
{
|
|
2750
|
+
"data-testid": "pix-modal-explain",
|
|
2751
|
+
style: { fontSize: 12, opacity: 0.65, marginTop: 8, lineHeight: 1.4 },
|
|
2752
|
+
children: [
|
|
2753
|
+
"Seu banco vai mostrar uma cobran\xE7a de ",
|
|
2754
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("strong", { children: "R$ 0,01" }),
|
|
2755
|
+
" \u2014 \xE9 simb\xF3lica, s\xF3 pra ativar o PIX Autom\xE1tico.",
|
|
2756
|
+
trialDays > 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
2757
|
+
" ",
|
|
2758
|
+
"A cobran\xE7a de ",
|
|
2759
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("strong", { children: formatBRL(cycleValueCents) }),
|
|
2760
|
+
" ",
|
|
2761
|
+
cycleLabel,
|
|
2762
|
+
" come\xE7a depois dos ",
|
|
2763
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("strong", { children: [
|
|
2764
|
+
trialDays,
|
|
2765
|
+
" dias gr\xE1tis"
|
|
2766
|
+
] }),
|
|
2767
|
+
", automaticamente."
|
|
2768
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
2769
|
+
" ",
|
|
2770
|
+
"A cobran\xE7a de ",
|
|
2771
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("strong", { children: formatBRL(cycleValueCents) }),
|
|
2772
|
+
" ",
|
|
2773
|
+
cycleLabel,
|
|
2774
|
+
" vem logo em seguida."
|
|
2775
|
+
] })
|
|
2776
|
+
]
|
|
2777
|
+
}
|
|
2778
|
+
),
|
|
2701
2779
|
pixPending.qrCodeBase64 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2702
2780
|
"img",
|
|
2703
2781
|
{
|