@superlogic/spree-pay 0.1.28 → 0.1.30
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/build/index.cjs +27 -14
- package/build/index.css +16 -5
- package/build/index.js +39 -26
- package/package.json +1 -1
package/build/index.cjs
CHANGED
|
@@ -44,7 +44,7 @@ var import_nice_modal_react7 = __toESM(require("@ebay/nice-modal-react"), 1);
|
|
|
44
44
|
var import_swr5 = require("swr");
|
|
45
45
|
|
|
46
46
|
// package.json
|
|
47
|
-
var version = "0.1.
|
|
47
|
+
var version = "0.1.30";
|
|
48
48
|
|
|
49
49
|
// src/context/SpreePayActionsContext.tsx
|
|
50
50
|
var import_react = require("react");
|
|
@@ -323,9 +323,10 @@ var getTransactionFee = (amount = 0, transactionFeePercentage) => {
|
|
|
323
323
|
// src/components/CheckoutButton.tsx
|
|
324
324
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
325
325
|
var CheckoutButton = ({ isLoggedIn }) => {
|
|
326
|
-
const { appProps } = useStaticConfig();
|
|
326
|
+
const { appProps, staticConfig } = useStaticConfig();
|
|
327
327
|
const { amount, onProcess, isProcessing, transactionFeePercentage } = appProps;
|
|
328
328
|
const { spreePayConfig } = useSpreePayConfig();
|
|
329
|
+
const { env } = useSpreePayEnv();
|
|
329
330
|
const { selectedPaymentMethod, isInternalProcessing } = useSpreePaymentMethod();
|
|
330
331
|
const { splitAmount, type, method } = selectedPaymentMethod;
|
|
331
332
|
const usdAmount = getSplitAmount(amount ?? 0, splitAmount ?? 0, spreePayConfig?.pointsConversionRatio);
|
|
@@ -360,7 +361,7 @@ var CheckoutButton = ({ isLoggedIn }) => {
|
|
|
360
361
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("a", { className: "underline", href: spreePayConfig?.termsConditionsUrl, target: "_blank", rel: "noreferrer", children: "Terms and Conditions" }),
|
|
361
362
|
"."
|
|
362
363
|
] }) }),
|
|
363
|
-
onProcess && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
364
|
+
isLoggedIn ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: onProcess && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
364
365
|
"button",
|
|
365
366
|
{
|
|
366
367
|
disabled: isDisabled,
|
|
@@ -368,6 +369,13 @@ var CheckoutButton = ({ isLoggedIn }) => {
|
|
|
368
369
|
className: "bg-primary h-[60px] w-full cursor-pointer text-xl font-semibold text-white disabled:cursor-not-allowed disabled:opacity-50",
|
|
369
370
|
children: getCheckoutContent()
|
|
370
371
|
}
|
|
372
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
373
|
+
"a",
|
|
374
|
+
{
|
|
375
|
+
href: `${staticConfig.keycloakUrl}/realms/${env.tenantId}/protocol/openid-connect/auth?client_id=${staticConfig.keycloakClientId}&response_type=code&redirect_uri=${window.location.href}`,
|
|
376
|
+
className: "bg-primary h-[60px] w-full cursor-pointer text-center text-xl leading-[60px] font-semibold text-white disabled:cursor-not-allowed disabled:opacity-50",
|
|
377
|
+
children: "Log in / Sign up for an AIR account"
|
|
378
|
+
}
|
|
371
379
|
)
|
|
372
380
|
] });
|
|
373
381
|
};
|
|
@@ -1344,7 +1352,7 @@ var PointsSwitch = (props) => {
|
|
|
1344
1352
|
)
|
|
1345
1353
|
] })
|
|
1346
1354
|
] }),
|
|
1347
|
-
message && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex
|
|
1355
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex gap-1 rounded-sm border-1 border-[#006FD533] bg-[#006FD50D] p-1.5", children: [
|
|
1348
1356
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("svg", { className: "size-5 shrink-0", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1349
1357
|
"path",
|
|
1350
1358
|
{
|
|
@@ -2370,6 +2378,8 @@ var PointsSelector = (props) => {
|
|
|
2370
2378
|
const handleCommit = (value) => {
|
|
2371
2379
|
setSelectedPaymentMethod({ ...selectedPaymentMethod, splitAmount: value });
|
|
2372
2380
|
};
|
|
2381
|
+
const pointsValue = String(Math.round(splitTokens));
|
|
2382
|
+
const usdValue = formatUSD(usdAmount + getTransactionFee(usdAmount, appProps.transactionFeePercentage));
|
|
2373
2383
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2374
2384
|
"button",
|
|
2375
2385
|
{
|
|
@@ -2393,14 +2403,15 @@ var PointsSelector = (props) => {
|
|
|
2393
2403
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex h-full w-full items-center justify-between gap-2 px-2 sm:gap-3 sm:px-3", children })
|
|
2394
2404
|
] }),
|
|
2395
2405
|
isSelected && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "px-2 pt-6 pb-2 sm:px-3 md:px-4", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-between gap-2 sm:gap-3", children: [
|
|
2396
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex
|
|
2406
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
2397
2407
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2398
2408
|
Input,
|
|
2399
2409
|
{
|
|
2400
2410
|
readOnly: true,
|
|
2401
2411
|
name: "points amount",
|
|
2402
|
-
value:
|
|
2403
|
-
className: "sm:text-md min-w-[
|
|
2412
|
+
value: pointsValue,
|
|
2413
|
+
className: "sm:text-md min-w-[50px] bg-white px-1 text-center text-xs font-medium sm:min-w-[100px] sm:px-2",
|
|
2414
|
+
style: { width: `${pointsValue.length}ch` },
|
|
2404
2415
|
onClick: (e) => e.stopPropagation()
|
|
2405
2416
|
}
|
|
2406
2417
|
),
|
|
@@ -2418,14 +2429,15 @@ var PointsSelector = (props) => {
|
|
|
2418
2429
|
step
|
|
2419
2430
|
}
|
|
2420
2431
|
) }),
|
|
2421
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex
|
|
2432
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
2422
2433
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2423
2434
|
Input,
|
|
2424
2435
|
{
|
|
2425
2436
|
readOnly: true,
|
|
2426
2437
|
name: "usd amount",
|
|
2427
|
-
value:
|
|
2428
|
-
className: "sm:text-md min-w-[
|
|
2438
|
+
value: usdValue,
|
|
2439
|
+
className: "sm:text-md min-w-[50px] bg-white px-1 text-center text-xs font-medium sm:min-w-[100px] sm:px-2",
|
|
2440
|
+
style: { width: `${usdValue.length}ch` },
|
|
2429
2441
|
onClick: (e) => e.stopPropagation()
|
|
2430
2442
|
}
|
|
2431
2443
|
),
|
|
@@ -3499,15 +3511,16 @@ var SpreePayInner = () => {
|
|
|
3499
3511
|
ssoPageURI: env?.ssoPageURI,
|
|
3500
3512
|
enabled: !env?.accessToken
|
|
3501
3513
|
});
|
|
3514
|
+
const _accessToken = env.accessToken ?? accessToken;
|
|
3502
3515
|
const slapiFetcher = (0, import_react18.useMemo)(() => {
|
|
3503
|
-
if (
|
|
3516
|
+
if (_accessToken) {
|
|
3504
3517
|
return registerApi({
|
|
3505
|
-
accessToken:
|
|
3518
|
+
accessToken: _accessToken,
|
|
3506
3519
|
tenantId,
|
|
3507
3520
|
baseUrl: staticConfig.slapiUrl
|
|
3508
3521
|
});
|
|
3509
3522
|
}
|
|
3510
|
-
}, [
|
|
3523
|
+
}, [_accessToken, staticConfig, tenantId]);
|
|
3511
3524
|
const getContent = () => {
|
|
3512
3525
|
if (isChecking) {
|
|
3513
3526
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex w-full flex-col", children: [
|
|
@@ -3525,7 +3538,7 @@ var SpreePayInner = () => {
|
|
|
3525
3538
|
revalidateOnFocus: false,
|
|
3526
3539
|
revalidateIfStale: false
|
|
3527
3540
|
},
|
|
3528
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(PortalContainerProvider, { container: portalEl, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_nice_modal_react7.default.Provider, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SpreePayContent, { isLoggedIn: Boolean(
|
|
3541
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(PortalContainerProvider, { container: portalEl, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_nice_modal_react7.default.Provider, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SpreePayContent, { isLoggedIn: Boolean(_accessToken) }) }) })
|
|
3529
3542
|
}
|
|
3530
3543
|
);
|
|
3531
3544
|
};
|
package/build/index.css
CHANGED
|
@@ -449,9 +449,6 @@
|
|
|
449
449
|
.sl-spreepay .w-full {
|
|
450
450
|
width: 100%;
|
|
451
451
|
}
|
|
452
|
-
.sl-spreepay .max-w-\[100px\] {
|
|
453
|
-
max-width: 100px;
|
|
454
|
-
}
|
|
455
452
|
.sl-spreepay .max-w-\[540px\] {
|
|
456
453
|
max-width: 540px;
|
|
457
454
|
}
|
|
@@ -464,8 +461,8 @@
|
|
|
464
461
|
.sl-spreepay .min-w-0 {
|
|
465
462
|
min-width: calc(var(--spacing) * 0);
|
|
466
463
|
}
|
|
467
|
-
.sl-spreepay .min-w-\[
|
|
468
|
-
min-width:
|
|
464
|
+
.sl-spreepay .min-w-\[50px\] {
|
|
465
|
+
min-width: 50px;
|
|
469
466
|
}
|
|
470
467
|
.sl-spreepay .flex-1 {
|
|
471
468
|
flex: 1;
|
|
@@ -827,6 +824,10 @@
|
|
|
827
824
|
--tw-leading: 34px;
|
|
828
825
|
line-height: 34px;
|
|
829
826
|
}
|
|
827
|
+
.sl-spreepay .leading-\[60px\] {
|
|
828
|
+
--tw-leading: 60px;
|
|
829
|
+
line-height: 60px;
|
|
830
|
+
}
|
|
830
831
|
.sl-spreepay .leading-none {
|
|
831
832
|
--tw-leading: 1;
|
|
832
833
|
line-height: 1;
|
|
@@ -1462,6 +1463,11 @@
|
|
|
1462
1463
|
max-width: var(--container-lg);
|
|
1463
1464
|
}
|
|
1464
1465
|
}
|
|
1466
|
+
.sl-spreepay .sm\:min-w-\[100px\] {
|
|
1467
|
+
@media (width >= 40rem) {
|
|
1468
|
+
min-width: 100px;
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1465
1471
|
.sl-spreepay .sm\:flex-row {
|
|
1466
1472
|
@media (width >= 40rem) {
|
|
1467
1473
|
flex-direction: row;
|
|
@@ -1482,6 +1488,11 @@
|
|
|
1482
1488
|
gap: calc(var(--spacing) * 3);
|
|
1483
1489
|
}
|
|
1484
1490
|
}
|
|
1491
|
+
.sl-spreepay .sm\:px-2 {
|
|
1492
|
+
@media (width >= 40rem) {
|
|
1493
|
+
padding-inline: calc(var(--spacing) * 2);
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1485
1496
|
.sl-spreepay .sm\:px-3 {
|
|
1486
1497
|
@media (width >= 40rem) {
|
|
1487
1498
|
padding-inline: calc(var(--spacing) * 3);
|
package/build/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import NiceModal7 from "@ebay/nice-modal-react";
|
|
|
4
4
|
import { SWRConfig } from "swr";
|
|
5
5
|
|
|
6
6
|
// package.json
|
|
7
|
-
var version = "0.1.
|
|
7
|
+
var version = "0.1.30";
|
|
8
8
|
|
|
9
9
|
// src/context/SpreePayActionsContext.tsx
|
|
10
10
|
import { createContext, useCallback, useContext, useRef, useState } from "react";
|
|
@@ -281,11 +281,12 @@ var getTransactionFee = (amount = 0, transactionFeePercentage) => {
|
|
|
281
281
|
};
|
|
282
282
|
|
|
283
283
|
// src/components/CheckoutButton.tsx
|
|
284
|
-
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
284
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
285
285
|
var CheckoutButton = ({ isLoggedIn }) => {
|
|
286
|
-
const { appProps } = useStaticConfig();
|
|
286
|
+
const { appProps, staticConfig } = useStaticConfig();
|
|
287
287
|
const { amount, onProcess, isProcessing, transactionFeePercentage } = appProps;
|
|
288
288
|
const { spreePayConfig } = useSpreePayConfig();
|
|
289
|
+
const { env } = useSpreePayEnv();
|
|
289
290
|
const { selectedPaymentMethod, isInternalProcessing } = useSpreePaymentMethod();
|
|
290
291
|
const { splitAmount, type, method } = selectedPaymentMethod;
|
|
291
292
|
const usdAmount = getSplitAmount(amount ?? 0, splitAmount ?? 0, spreePayConfig?.pointsConversionRatio);
|
|
@@ -320,7 +321,7 @@ var CheckoutButton = ({ isLoggedIn }) => {
|
|
|
320
321
|
/* @__PURE__ */ jsx4("a", { className: "underline", href: spreePayConfig?.termsConditionsUrl, target: "_blank", rel: "noreferrer", children: "Terms and Conditions" }),
|
|
321
322
|
"."
|
|
322
323
|
] }) }),
|
|
323
|
-
onProcess && /* @__PURE__ */ jsx4(
|
|
324
|
+
isLoggedIn ? /* @__PURE__ */ jsx4(Fragment, { children: onProcess && /* @__PURE__ */ jsx4(
|
|
324
325
|
"button",
|
|
325
326
|
{
|
|
326
327
|
disabled: isDisabled,
|
|
@@ -328,6 +329,13 @@ var CheckoutButton = ({ isLoggedIn }) => {
|
|
|
328
329
|
className: "bg-primary h-[60px] w-full cursor-pointer text-xl font-semibold text-white disabled:cursor-not-allowed disabled:opacity-50",
|
|
329
330
|
children: getCheckoutContent()
|
|
330
331
|
}
|
|
332
|
+
) }) : /* @__PURE__ */ jsx4(
|
|
333
|
+
"a",
|
|
334
|
+
{
|
|
335
|
+
href: `${staticConfig.keycloakUrl}/realms/${env.tenantId}/protocol/openid-connect/auth?client_id=${staticConfig.keycloakClientId}&response_type=code&redirect_uri=${window.location.href}`,
|
|
336
|
+
className: "bg-primary h-[60px] w-full cursor-pointer text-center text-xl leading-[60px] font-semibold text-white disabled:cursor-not-allowed disabled:opacity-50",
|
|
337
|
+
children: "Log in / Sign up for an AIR account"
|
|
338
|
+
}
|
|
331
339
|
)
|
|
332
340
|
] });
|
|
333
341
|
};
|
|
@@ -1083,7 +1091,7 @@ function Label({ className, ...props }) {
|
|
|
1083
1091
|
}
|
|
1084
1092
|
|
|
1085
1093
|
// src/components/CreditCardTab/CreditCard/CreditCardForm.tsx
|
|
1086
|
-
import { Fragment, jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1094
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1087
1095
|
var style = {
|
|
1088
1096
|
base: {
|
|
1089
1097
|
fontSize: "16px",
|
|
@@ -1141,7 +1149,7 @@ var CreditCardForm = ({ cancel, saveCard }) => {
|
|
|
1141
1149
|
setCardError("An error occurred while processing your card. Please try again.");
|
|
1142
1150
|
}
|
|
1143
1151
|
};
|
|
1144
|
-
return /* @__PURE__ */ jsxs7(
|
|
1152
|
+
return /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
1145
1153
|
/* @__PURE__ */ jsxs7("div", { className: "flex w-full flex-col gap-1", children: [
|
|
1146
1154
|
/* @__PURE__ */ jsx12(
|
|
1147
1155
|
CardNumberElement,
|
|
@@ -1189,7 +1197,7 @@ var CreditCardForm = ({ cancel, saveCard }) => {
|
|
|
1189
1197
|
};
|
|
1190
1198
|
|
|
1191
1199
|
// src/components/CreditCardTab/CreditCard/CreditCard.tsx
|
|
1192
|
-
import { Fragment as
|
|
1200
|
+
import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1193
1201
|
var StripeWrapper = (props) => {
|
|
1194
1202
|
const stripePromise = useMemo2(() => loadStripe(props.publicKey), [props.publicKey]);
|
|
1195
1203
|
return /* @__PURE__ */ jsx13(Elements, { stripe: stripePromise, children: /* @__PURE__ */ jsx13(CreditCardForm, { cancel: props.onCancel, saveCard: props.saveNewCard }) });
|
|
@@ -1212,7 +1220,7 @@ var CreditCard = () => {
|
|
|
1212
1220
|
};
|
|
1213
1221
|
return /* @__PURE__ */ jsxs8("div", { className: "flex flex-col items-baseline gap-4", children: [
|
|
1214
1222
|
/* @__PURE__ */ jsx13("h3", { className: "text-primary text-xl leading-[34px] font-semibold", children: "Your Credit Cards" }),
|
|
1215
|
-
!showForm && /* @__PURE__ */ jsxs8(
|
|
1223
|
+
!showForm && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
1216
1224
|
/* @__PURE__ */ jsx13(
|
|
1217
1225
|
CardsList,
|
|
1218
1226
|
{
|
|
@@ -1304,7 +1312,7 @@ var PointsSwitch = (props) => {
|
|
|
1304
1312
|
)
|
|
1305
1313
|
] })
|
|
1306
1314
|
] }),
|
|
1307
|
-
message && /* @__PURE__ */ jsxs9("div", { className: "flex
|
|
1315
|
+
message && /* @__PURE__ */ jsxs9("div", { className: "flex gap-1 rounded-sm border-1 border-[#006FD533] bg-[#006FD50D] p-1.5", children: [
|
|
1308
1316
|
/* @__PURE__ */ jsx15("svg", { className: "size-5 shrink-0", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx15(
|
|
1309
1317
|
"path",
|
|
1310
1318
|
{
|
|
@@ -2330,6 +2338,8 @@ var PointsSelector = (props) => {
|
|
|
2330
2338
|
const handleCommit = (value) => {
|
|
2331
2339
|
setSelectedPaymentMethod({ ...selectedPaymentMethod, splitAmount: value });
|
|
2332
2340
|
};
|
|
2341
|
+
const pointsValue = String(Math.round(splitTokens));
|
|
2342
|
+
const usdValue = formatUSD(usdAmount + getTransactionFee(usdAmount, appProps.transactionFeePercentage));
|
|
2333
2343
|
return /* @__PURE__ */ jsxs12(
|
|
2334
2344
|
"button",
|
|
2335
2345
|
{
|
|
@@ -2353,14 +2363,15 @@ var PointsSelector = (props) => {
|
|
|
2353
2363
|
/* @__PURE__ */ jsx24("div", { className: "flex h-full w-full items-center justify-between gap-2 px-2 sm:gap-3 sm:px-3", children })
|
|
2354
2364
|
] }),
|
|
2355
2365
|
isSelected && /* @__PURE__ */ jsx24("div", { className: "px-2 pt-6 pb-2 sm:px-3 md:px-4", children: /* @__PURE__ */ jsxs12("div", { className: "flex justify-between gap-2 sm:gap-3", children: [
|
|
2356
|
-
/* @__PURE__ */ jsxs12("div", { className: "flex
|
|
2366
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-1", children: [
|
|
2357
2367
|
/* @__PURE__ */ jsx24(
|
|
2358
2368
|
Input,
|
|
2359
2369
|
{
|
|
2360
2370
|
readOnly: true,
|
|
2361
2371
|
name: "points amount",
|
|
2362
|
-
value:
|
|
2363
|
-
className: "sm:text-md min-w-[
|
|
2372
|
+
value: pointsValue,
|
|
2373
|
+
className: "sm:text-md min-w-[50px] bg-white px-1 text-center text-xs font-medium sm:min-w-[100px] sm:px-2",
|
|
2374
|
+
style: { width: `${pointsValue.length}ch` },
|
|
2364
2375
|
onClick: (e) => e.stopPropagation()
|
|
2365
2376
|
}
|
|
2366
2377
|
),
|
|
@@ -2378,14 +2389,15 @@ var PointsSelector = (props) => {
|
|
|
2378
2389
|
step
|
|
2379
2390
|
}
|
|
2380
2391
|
) }),
|
|
2381
|
-
/* @__PURE__ */ jsxs12("div", { className: "flex
|
|
2392
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-1", children: [
|
|
2382
2393
|
/* @__PURE__ */ jsx24(
|
|
2383
2394
|
Input,
|
|
2384
2395
|
{
|
|
2385
2396
|
readOnly: true,
|
|
2386
2397
|
name: "usd amount",
|
|
2387
|
-
value:
|
|
2388
|
-
className: "sm:text-md min-w-[
|
|
2398
|
+
value: usdValue,
|
|
2399
|
+
className: "sm:text-md min-w-[50px] bg-white px-1 text-center text-xs font-medium sm:min-w-[100px] sm:px-2",
|
|
2400
|
+
style: { width: `${usdValue.length}ch` },
|
|
2389
2401
|
onClick: (e) => e.stopPropagation()
|
|
2390
2402
|
}
|
|
2391
2403
|
),
|
|
@@ -2446,7 +2458,7 @@ var SplitBlock = (props) => {
|
|
|
2446
2458
|
};
|
|
2447
2459
|
|
|
2448
2460
|
// src/components/CreditCardTab/Points/Points.tsx
|
|
2449
|
-
import { Fragment as
|
|
2461
|
+
import { Fragment as Fragment4, jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2450
2462
|
var Points = () => {
|
|
2451
2463
|
const [usePoints, setUsePoints] = useState10(false);
|
|
2452
2464
|
const [selectedPointsType, setSelectedPointsType] = useState10(null);
|
|
@@ -2460,7 +2472,7 @@ var Points = () => {
|
|
|
2460
2472
|
setSelectedPaymentMethod({ ...selectedPaymentMethod, splitAmount: void 0 });
|
|
2461
2473
|
}
|
|
2462
2474
|
};
|
|
2463
|
-
return /* @__PURE__ */ jsxs14(
|
|
2475
|
+
return /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
2464
2476
|
/* @__PURE__ */ jsx26(
|
|
2465
2477
|
PointsSwitch,
|
|
2466
2478
|
{
|
|
@@ -2718,11 +2730,11 @@ var useCryptoPayment = () => {
|
|
|
2718
2730
|
|
|
2719
2731
|
// src/components/CryptoTab/Crypto/ConnectButton.tsx
|
|
2720
2732
|
import { ConnectButton as RainbowButton } from "@rainbow-me/rainbowkit";
|
|
2721
|
-
import { Fragment as
|
|
2733
|
+
import { Fragment as Fragment5, jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2722
2734
|
var ConnectButton = () => {
|
|
2723
2735
|
return /* @__PURE__ */ jsx28(RainbowButton.Custom, { children: ({ mounted, chain, account, openAccountModal, openChainModal, openConnectModal }) => {
|
|
2724
2736
|
if (!mounted) return null;
|
|
2725
|
-
return /* @__PURE__ */ jsx28(
|
|
2737
|
+
return /* @__PURE__ */ jsx28(Fragment5, { children: (() => {
|
|
2726
2738
|
if (!mounted || !account || !chain) {
|
|
2727
2739
|
return /* @__PURE__ */ jsx28(
|
|
2728
2740
|
"button",
|
|
@@ -3036,7 +3048,7 @@ var useBaseTokens = () => {
|
|
|
3036
3048
|
};
|
|
3037
3049
|
|
|
3038
3050
|
// src/modals/CryptoSelectModal.tsx
|
|
3039
|
-
import { Fragment as
|
|
3051
|
+
import { Fragment as Fragment6, jsx as jsx34, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3040
3052
|
var CryptoSelectModal = NiceModal4.create(() => {
|
|
3041
3053
|
const modal = useModal2();
|
|
3042
3054
|
const { isLoading, error, erc20Balances } = useBaseERC20Token();
|
|
@@ -3100,7 +3112,7 @@ var CryptoSelectModal = NiceModal4.create(() => {
|
|
|
3100
3112
|
},
|
|
3101
3113
|
nativeBalance.symbol
|
|
3102
3114
|
),
|
|
3103
|
-
isLoading && /* @__PURE__ */ jsxs19(
|
|
3115
|
+
isLoading && /* @__PURE__ */ jsxs19(Fragment6, { children: [
|
|
3104
3116
|
/* @__PURE__ */ jsx34("div", { className: "h-11 animate-pulse rounded-md bg-gray-100" }),
|
|
3105
3117
|
/* @__PURE__ */ jsx34("div", { className: "h-11 animate-pulse rounded-md bg-gray-100" }),
|
|
3106
3118
|
/* @__PURE__ */ jsx34("div", { className: "h-11 animate-pulse rounded-md bg-gray-100" })
|
|
@@ -3126,7 +3138,7 @@ var CryptoSelectModal = NiceModal4.create(() => {
|
|
|
3126
3138
|
] }),
|
|
3127
3139
|
/* @__PURE__ */ jsx34("h3", { className: "text-primary text-xl font-semibold", children: "All Tokens" }),
|
|
3128
3140
|
/* @__PURE__ */ jsxs19("div", { className: "flex max-h-[40vh] w-full flex-col gap-1 overflow-y-auto", children: [
|
|
3129
|
-
tokensIsLoading && /* @__PURE__ */ jsxs19(
|
|
3141
|
+
tokensIsLoading && /* @__PURE__ */ jsxs19(Fragment6, { children: [
|
|
3130
3142
|
/* @__PURE__ */ jsx34("div", { className: "h-11 animate-pulse rounded-md bg-gray-100" }),
|
|
3131
3143
|
/* @__PURE__ */ jsx34("div", { className: "h-11 animate-pulse rounded-md bg-gray-100" }),
|
|
3132
3144
|
/* @__PURE__ */ jsx34("div", { className: "h-11 animate-pulse rounded-md bg-gray-100" })
|
|
@@ -3459,15 +3471,16 @@ var SpreePayInner = () => {
|
|
|
3459
3471
|
ssoPageURI: env?.ssoPageURI,
|
|
3460
3472
|
enabled: !env?.accessToken
|
|
3461
3473
|
});
|
|
3474
|
+
const _accessToken = env.accessToken ?? accessToken;
|
|
3462
3475
|
const slapiFetcher = useMemo9(() => {
|
|
3463
|
-
if (
|
|
3476
|
+
if (_accessToken) {
|
|
3464
3477
|
return registerApi({
|
|
3465
|
-
accessToken:
|
|
3478
|
+
accessToken: _accessToken,
|
|
3466
3479
|
tenantId,
|
|
3467
3480
|
baseUrl: staticConfig.slapiUrl
|
|
3468
3481
|
});
|
|
3469
3482
|
}
|
|
3470
|
-
}, [
|
|
3483
|
+
}, [_accessToken, staticConfig, tenantId]);
|
|
3471
3484
|
const getContent = () => {
|
|
3472
3485
|
if (isChecking) {
|
|
3473
3486
|
return /* @__PURE__ */ jsxs27("div", { className: "flex w-full flex-col", children: [
|
|
@@ -3485,7 +3498,7 @@ var SpreePayInner = () => {
|
|
|
3485
3498
|
revalidateOnFocus: false,
|
|
3486
3499
|
revalidateIfStale: false
|
|
3487
3500
|
},
|
|
3488
|
-
children: /* @__PURE__ */ jsx43(PortalContainerProvider, { container: portalEl, children: /* @__PURE__ */ jsx43(NiceModal7.Provider, { children: /* @__PURE__ */ jsx43(SpreePayContent, { isLoggedIn: Boolean(
|
|
3501
|
+
children: /* @__PURE__ */ jsx43(PortalContainerProvider, { container: portalEl, children: /* @__PURE__ */ jsx43(NiceModal7.Provider, { children: /* @__PURE__ */ jsx43(SpreePayContent, { isLoggedIn: Boolean(_accessToken) }) }) })
|
|
3489
3502
|
}
|
|
3490
3503
|
);
|
|
3491
3504
|
};
|