@swype-org/react-sdk 0.1.205 → 0.1.206
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 +8 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -85
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3888,50 +3888,6 @@ function DepositScreen({
|
|
|
3888
3888
|
const isLowBalance = availableBalance < MIN_DEPOSIT;
|
|
3889
3889
|
const exceedsLimit = remainingLimit != null && amount > remainingLimit && !isLowBalance;
|
|
3890
3890
|
const canDeposit = amount >= MIN_DEPOSIT && !exceedsLimit && !isLowBalance && !processing;
|
|
3891
|
-
const headerTitle = merchantName ? `Deposit to ${merchantName}` : "Deposit";
|
|
3892
|
-
if (isLowBalance) {
|
|
3893
|
-
return /* @__PURE__ */ jsxs(
|
|
3894
|
-
ScreenLayout,
|
|
3895
|
-
{
|
|
3896
|
-
footer: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3897
|
-
/* @__PURE__ */ jsx(PrimaryButton, { onClick: onSwitchWallet, children: "Switch wallet" }),
|
|
3898
|
-
/* @__PURE__ */ jsx("p", { style: switchHintStyle(tokens.textMuted), children: "Use a different wallet with more balance" }),
|
|
3899
|
-
/* @__PURE__ */ jsx("div", { style: outlineBtnWrapStyle, children: /* @__PURE__ */ jsx(OutlineButton, { onClick: onBack, children: "Back to deposit options" }) }),
|
|
3900
|
-
/* @__PURE__ */ jsx(PoweredByFooter, {})
|
|
3901
|
-
] }),
|
|
3902
|
-
children: [
|
|
3903
|
-
/* @__PURE__ */ jsx(ScreenHeader, { title: headerTitle, onBack, onLogout }),
|
|
3904
|
-
/* @__PURE__ */ jsx("div", { style: lowBalanceAmountDisplayStyle, children: /* @__PURE__ */ jsxs("span", { style: lowBalanceAmountStyle, children: [
|
|
3905
|
-
"$",
|
|
3906
|
-
amount.toFixed(2)
|
|
3907
|
-
] }) }),
|
|
3908
|
-
/* @__PURE__ */ jsxs("div", { style: lowBalanceRowStyle, children: [
|
|
3909
|
-
/* @__PURE__ */ jsxs("div", { style: lowBalanceLeftStyle, children: [
|
|
3910
|
-
/* @__PURE__ */ jsx("div", { style: lowBalanceCoinStyle(tokens.warning), children: /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", children: [
|
|
3911
|
-
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10", fill: "currentColor" }),
|
|
3912
|
-
/* @__PURE__ */ jsx("text", { x: "12", y: "16", textAnchor: "middle", fontSize: "12", fill: "#fff", fontWeight: "700", children: "$" })
|
|
3913
|
-
] }) }),
|
|
3914
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
3915
|
-
/* @__PURE__ */ jsx("div", { style: lowBalanceLabelStyle(tokens.textMuted), children: selectedSourceLabel ?? "Available" }),
|
|
3916
|
-
/* @__PURE__ */ jsxs("div", { style: { fontSize: "1rem", fontWeight: 700, color: tokens.warning }, children: [
|
|
3917
|
-
"$",
|
|
3918
|
-
availableBalance.toFixed(2)
|
|
3919
|
-
] })
|
|
3920
|
-
] })
|
|
3921
|
-
] }),
|
|
3922
|
-
/* @__PURE__ */ jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z", fill: tokens.warning }) })
|
|
3923
|
-
] }),
|
|
3924
|
-
/* @__PURE__ */ jsxs(WarningBanner, { title: "Not enough funds", children: [
|
|
3925
|
-
"Your wallet balance is $",
|
|
3926
|
-
availableBalance.toFixed(2),
|
|
3927
|
-
" \u2014 you need at least $",
|
|
3928
|
-
MIN_DEPOSIT.toFixed(2),
|
|
3929
|
-
" to deposit via One-Tap."
|
|
3930
|
-
] })
|
|
3931
|
-
]
|
|
3932
|
-
}
|
|
3933
|
-
);
|
|
3934
|
-
}
|
|
3935
3891
|
return /* @__PURE__ */ jsxs(
|
|
3936
3892
|
ScreenLayout,
|
|
3937
3893
|
{
|
|
@@ -4062,6 +4018,13 @@ function DepositScreen({
|
|
|
4062
4018
|
". Increase your limit to continue."
|
|
4063
4019
|
] })
|
|
4064
4020
|
] }),
|
|
4021
|
+
!accountPickerOpen && isLowBalance && /* @__PURE__ */ jsxs(WarningBanner, { title: "Not enough funds", children: [
|
|
4022
|
+
"Your wallet balance is $",
|
|
4023
|
+
availableBalance.toFixed(2),
|
|
4024
|
+
" \u2014 you need at least $",
|
|
4025
|
+
MIN_DEPOSIT.toFixed(2),
|
|
4026
|
+
" to deposit via One-Tap."
|
|
4027
|
+
] }),
|
|
4065
4028
|
error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle5(tokens), children: error })
|
|
4066
4029
|
]
|
|
4067
4030
|
}
|
|
@@ -4265,46 +4228,6 @@ var limitExceededHintStyle = (color) => ({
|
|
|
4265
4228
|
margin: "12px 0 2px",
|
|
4266
4229
|
lineHeight: 1.5
|
|
4267
4230
|
});
|
|
4268
|
-
var switchHintStyle = (color) => ({
|
|
4269
|
-
textAlign: "center",
|
|
4270
|
-
fontSize: "0.8rem",
|
|
4271
|
-
color,
|
|
4272
|
-
margin: "10px 0"
|
|
4273
|
-
});
|
|
4274
|
-
var outlineBtnWrapStyle = {
|
|
4275
|
-
marginBottom: 8
|
|
4276
|
-
};
|
|
4277
|
-
var lowBalanceAmountDisplayStyle = {
|
|
4278
|
-
textAlign: "center",
|
|
4279
|
-
padding: "20px 0 8px"
|
|
4280
|
-
};
|
|
4281
|
-
var lowBalanceAmountStyle = {
|
|
4282
|
-
fontSize: "2.5rem",
|
|
4283
|
-
fontWeight: 700,
|
|
4284
|
-
color: "#ccc",
|
|
4285
|
-
letterSpacing: "-0.02em"
|
|
4286
|
-
};
|
|
4287
|
-
var lowBalanceRowStyle = {
|
|
4288
|
-
display: "flex",
|
|
4289
|
-
alignItems: "center",
|
|
4290
|
-
justifyContent: "space-between",
|
|
4291
|
-
marginBottom: 16
|
|
4292
|
-
};
|
|
4293
|
-
var lowBalanceLeftStyle = {
|
|
4294
|
-
display: "flex",
|
|
4295
|
-
alignItems: "center",
|
|
4296
|
-
gap: 10
|
|
4297
|
-
};
|
|
4298
|
-
var lowBalanceCoinStyle = (color) => ({
|
|
4299
|
-
color,
|
|
4300
|
-
display: "flex",
|
|
4301
|
-
alignItems: "center"
|
|
4302
|
-
});
|
|
4303
|
-
var lowBalanceLabelStyle = (color) => ({
|
|
4304
|
-
fontSize: "0.72rem",
|
|
4305
|
-
color,
|
|
4306
|
-
fontWeight: 500
|
|
4307
|
-
});
|
|
4308
4231
|
function SuccessScreen({
|
|
4309
4232
|
amount,
|
|
4310
4233
|
currency,
|
|
@@ -5659,7 +5582,7 @@ function StepRendererContent({
|
|
|
5659
5582
|
return /* @__PURE__ */ jsx(
|
|
5660
5583
|
SetupScreen,
|
|
5661
5584
|
{
|
|
5662
|
-
availableBalance: selectedSource ? selectedSource.balance.available.amount : selectedAccount ? selectedAccount.wallets.reduce((sum, w) => sum + w.balance.available.amount, 0) :
|
|
5585
|
+
availableBalance: selectedSource ? selectedSource.balance.available.amount : selectSourceAvailableBalance > 0 ? selectSourceAvailableBalance : selectedAccount ? selectedAccount.wallets.reduce((sum, w) => sum + w.balance.available.amount, 0) : maxSourceBalance,
|
|
5663
5586
|
tokenCount: effectiveTokenCount,
|
|
5664
5587
|
sourceName,
|
|
5665
5588
|
onSetupOneTap: handlers.onSetupOneTap,
|