@swype-org/react-sdk 0.1.221 → 0.1.222
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 +4 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +4 -46
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4488,41 +4488,14 @@ function SuccessScreen({
|
|
|
4488
4488
|
onLogout,
|
|
4489
4489
|
onIncreaseLimits,
|
|
4490
4490
|
onManageAccount,
|
|
4491
|
-
onPreauthorize
|
|
4492
|
-
autoCloseSeconds
|
|
4491
|
+
onPreauthorize
|
|
4493
4492
|
}) {
|
|
4494
4493
|
const { tokens } = useBlinkConfig();
|
|
4495
|
-
const effectiveAutoClose = succeeded ? autoCloseSeconds : void 0;
|
|
4496
|
-
const [countdown, setCountdown] = react.useState(effectiveAutoClose ?? 0);
|
|
4497
|
-
const doneCalledRef = react.useRef(false);
|
|
4498
|
-
const handleDone = react.useCallback(() => {
|
|
4499
|
-
if (doneCalledRef.current) return;
|
|
4500
|
-
doneCalledRef.current = true;
|
|
4501
|
-
onDone();
|
|
4502
|
-
}, [onDone]);
|
|
4503
|
-
react.useEffect(() => {
|
|
4504
|
-
if (!effectiveAutoClose || effectiveAutoClose <= 0) return;
|
|
4505
|
-
const intervalId = window.setInterval(() => {
|
|
4506
|
-
setCountdown((prev) => {
|
|
4507
|
-
if (prev <= 1) {
|
|
4508
|
-
window.clearInterval(intervalId);
|
|
4509
|
-
return 0;
|
|
4510
|
-
}
|
|
4511
|
-
return prev - 1;
|
|
4512
|
-
});
|
|
4513
|
-
}, 1e3);
|
|
4514
|
-
return () => window.clearInterval(intervalId);
|
|
4515
|
-
}, [effectiveAutoClose]);
|
|
4516
|
-
react.useEffect(() => {
|
|
4517
|
-
if (effectiveAutoClose && countdown === 0) {
|
|
4518
|
-
handleDone();
|
|
4519
|
-
}
|
|
4520
|
-
}, [effectiveAutoClose, countdown, handleDone]);
|
|
4521
4494
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4522
4495
|
ScreenLayout,
|
|
4523
4496
|
{
|
|
4524
4497
|
footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4525
|
-
/* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick:
|
|
4498
|
+
/* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: onDone, children: succeeded ? "Done" : "Try again" }),
|
|
4526
4499
|
succeeded && onPreauthorize && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4527
4500
|
"button",
|
|
4528
4501
|
{
|
|
@@ -4532,11 +4505,6 @@ function SuccessScreen({
|
|
|
4532
4505
|
children: "Preauthorize future transfers"
|
|
4533
4506
|
}
|
|
4534
4507
|
),
|
|
4535
|
-
effectiveAutoClose != null && effectiveAutoClose > 0 && /* @__PURE__ */ jsxRuntime.jsxs("p", { style: countdownStyle(tokens.textMuted), children: [
|
|
4536
|
-
"Returning to app in ",
|
|
4537
|
-
countdown,
|
|
4538
|
-
"s\u2026"
|
|
4539
|
-
] }),
|
|
4540
4508
|
onManageAccount && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onManageAccount, style: manageStyle(tokens.textMuted), children: "Manage Blink account \u2192" }),
|
|
4541
4509
|
/* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
|
|
4542
4510
|
] }),
|
|
@@ -4674,12 +4642,6 @@ var preauthorizeStyle = (accentColor, borderColor) => ({
|
|
|
4674
4642
|
cursor: "pointer",
|
|
4675
4643
|
fontFamily: "inherit"
|
|
4676
4644
|
});
|
|
4677
|
-
var countdownStyle = (color) => ({
|
|
4678
|
-
fontSize: "0.82rem",
|
|
4679
|
-
color,
|
|
4680
|
-
margin: "10px 0 0",
|
|
4681
|
-
textAlign: "center"
|
|
4682
|
-
});
|
|
4683
4645
|
var manageStyle = (color) => ({
|
|
4684
4646
|
background: "transparent",
|
|
4685
4647
|
border: "none",
|
|
@@ -5875,7 +5837,6 @@ function StepRendererContent({
|
|
|
5875
5837
|
merchantName,
|
|
5876
5838
|
onBack,
|
|
5877
5839
|
onDismiss,
|
|
5878
|
-
autoCloseSeconds,
|
|
5879
5840
|
depositAmount,
|
|
5880
5841
|
handlers
|
|
5881
5842
|
}) {
|
|
@@ -6152,8 +6113,7 @@ function StepRendererContent({
|
|
|
6152
6113
|
})() : void 0,
|
|
6153
6114
|
onDone: onDismiss ?? handlers.onNewPayment,
|
|
6154
6115
|
onLogout: handlers.onLogout,
|
|
6155
|
-
onPreauthorize: state.isGuestFlow ? handlers.onPreauthorize : void 0
|
|
6156
|
-
autoCloseSeconds
|
|
6116
|
+
onPreauthorize: state.isGuestFlow ? handlers.onPreauthorize : void 0
|
|
6157
6117
|
}
|
|
6158
6118
|
);
|
|
6159
6119
|
}
|
|
@@ -8429,8 +8389,7 @@ function BlinkPaymentInner({
|
|
|
8429
8389
|
merchantAuthorization,
|
|
8430
8390
|
merchantName,
|
|
8431
8391
|
onBack,
|
|
8432
|
-
onDismiss
|
|
8433
|
-
autoCloseSeconds
|
|
8392
|
+
onDismiss
|
|
8434
8393
|
}) {
|
|
8435
8394
|
const { apiBaseUrl, depositAmount } = useBlinkConfig();
|
|
8436
8395
|
const { ready, authenticated, logout, getAccessToken } = reactAuth.usePrivy();
|
|
@@ -8686,7 +8645,6 @@ function BlinkPaymentInner({
|
|
|
8686
8645
|
merchantName,
|
|
8687
8646
|
onBack,
|
|
8688
8647
|
onDismiss,
|
|
8689
|
-
autoCloseSeconds,
|
|
8690
8648
|
depositAmount,
|
|
8691
8649
|
handlers
|
|
8692
8650
|
}
|