@superlogic/spree-pay 0.1.27 → 0.1.28
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 +39 -17
- package/build/index.css +39 -9
- package/build/index.d.cts +2 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +39 -17
- 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.28";
|
|
48
48
|
|
|
49
49
|
// src/context/SpreePayActionsContext.tsx
|
|
50
50
|
var import_react = require("react");
|
|
@@ -1308,24 +1308,43 @@ var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
|
1308
1308
|
var PointsSwitch = (props) => {
|
|
1309
1309
|
const { disabled = false, value, onChange, message } = props;
|
|
1310
1310
|
const { spreePayConfig } = useSpreePayConfig();
|
|
1311
|
+
const { appProps } = useStaticConfig();
|
|
1311
1312
|
const { balance } = useSlapiBalance();
|
|
1312
1313
|
const id = (0, import_react7.useId)();
|
|
1313
1314
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
1314
1315
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center justify-between gap-3", children: [
|
|
1315
1316
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
1316
1317
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Switch, { checked: value, onCheckedChange: onChange, disabled, id }),
|
|
1317
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1318
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1319
|
+
Label,
|
|
1320
|
+
{
|
|
1321
|
+
htmlFor: id,
|
|
1322
|
+
className: "text-md flex-col items-baseline gap-0 leading-[1.3] font-semibold text-black sm:flex-row sm:gap-2 md:text-lg",
|
|
1323
|
+
children: [
|
|
1324
|
+
"Use Points ",
|
|
1325
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-xs font-medium", children: "Optional" })
|
|
1326
|
+
]
|
|
1327
|
+
}
|
|
1328
|
+
)
|
|
1321
1329
|
] }),
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1330
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
|
1331
|
+
balance?.availablePoints ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { className: "flex-1 text-right text-sm font-medium text-black", children: [
|
|
1332
|
+
formatPoints(balance.availablePoints, spreePayConfig?.pointsTitle),
|
|
1333
|
+
!!spreePayConfig?.pointsConversionRatio && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-black/50", children: ` ${formatUSD(balance.availablePoints * spreePayConfig.pointsConversionRatio)}` })
|
|
1334
|
+
] }) : null,
|
|
1335
|
+
Boolean(appProps.topUpLink) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1336
|
+
"a",
|
|
1337
|
+
{
|
|
1338
|
+
className: "bg-primary cursor-pointer rounded-full px-2 py-1.5 text-xs font-medium text-white",
|
|
1339
|
+
rel: "noreferrer",
|
|
1340
|
+
target: "_blank",
|
|
1341
|
+
href: appProps.topUpLink,
|
|
1342
|
+
children: "Top Up"
|
|
1343
|
+
}
|
|
1344
|
+
)
|
|
1345
|
+
] })
|
|
1327
1346
|
] }),
|
|
1328
|
-
message && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-
|
|
1347
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-1 rounded-sm border-1 border-[#006FD533] bg-[#006FD50D] p-1.5", children: [
|
|
1329
1348
|
/* @__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)(
|
|
1330
1349
|
"path",
|
|
1331
1350
|
{
|
|
@@ -2371,16 +2390,17 @@ var PointsSelector = (props) => {
|
|
|
2371
2390
|
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-white", children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "bg-primary h-2.5 w-2.5 rounded-full" }) })
|
|
2372
2391
|
}
|
|
2373
2392
|
),
|
|
2374
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex h-full w-full items-center justify-between gap-3 px-3", children })
|
|
2393
|
+
/* @__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 })
|
|
2375
2394
|
] }),
|
|
2376
|
-
isSelected && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "px-
|
|
2395
|
+
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: [
|
|
2377
2396
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex max-w-[100px] flex-col gap-1", children: [
|
|
2378
2397
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2379
2398
|
Input,
|
|
2380
2399
|
{
|
|
2381
2400
|
readOnly: true,
|
|
2401
|
+
name: "points amount",
|
|
2382
2402
|
value: Math.round(splitTokens),
|
|
2383
|
-
className: "bg-white text-center font-medium",
|
|
2403
|
+
className: "sm:text-md min-w-[75px] bg-white px-1 text-center text-xs font-medium sm:px-3",
|
|
2384
2404
|
onClick: (e) => e.stopPropagation()
|
|
2385
2405
|
}
|
|
2386
2406
|
),
|
|
@@ -2403,8 +2423,9 @@ var PointsSelector = (props) => {
|
|
|
2403
2423
|
Input,
|
|
2404
2424
|
{
|
|
2405
2425
|
readOnly: true,
|
|
2426
|
+
name: "usd amount",
|
|
2406
2427
|
value: formatUSD(usdAmount + getTransactionFee(usdAmount, appProps.transactionFeePercentage)),
|
|
2407
|
-
className: "bg-white text-center font-medium",
|
|
2428
|
+
className: "sm:text-md min-w-[75px] bg-white px-1 text-center text-xs font-medium sm:px-3",
|
|
2408
2429
|
onClick: (e) => e.stopPropagation()
|
|
2409
2430
|
}
|
|
2410
2431
|
),
|
|
@@ -2452,7 +2473,7 @@ var SplitBlock = (props) => {
|
|
|
2452
2473
|
initWallet(spreePayConfig?.pointsChain);
|
|
2453
2474
|
}, [spreePayConfig?.pointsChain, initWallet]);
|
|
2454
2475
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex flex-col gap-1", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(PointsSelector, { isDisabled: !walletReady, onSelect: () => onSelect("air"), isSelected, children: [
|
|
2455
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex items-center gap-2", children: balance?.availablePoints ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("p", { className: "text-
|
|
2476
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex items-center gap-2", children: balance?.availablePoints ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("p", { className: "text-left text-xs font-medium text-black sm:text-sm", children: [
|
|
2456
2477
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-black/50", children: "Available" }),
|
|
2457
2478
|
" ",
|
|
2458
2479
|
formatPoints(balance.availablePoints, pointsTitle),
|
|
@@ -2471,6 +2492,7 @@ var Points = () => {
|
|
|
2471
2492
|
const [selectedPointsType, setSelectedPointsType] = (0, import_react12.useState)(null);
|
|
2472
2493
|
const { setSelectedPaymentMethod, selectedPaymentMethod } = useSpreePaymentMethod();
|
|
2473
2494
|
const { spreePayConfig } = useSpreePayConfig();
|
|
2495
|
+
const { appProps } = useStaticConfig();
|
|
2474
2496
|
const handleTogglePoints = (enabled) => {
|
|
2475
2497
|
setUsePoints(enabled);
|
|
2476
2498
|
if (!enabled) {
|
|
@@ -2485,7 +2507,7 @@ var Points = () => {
|
|
|
2485
2507
|
value: usePoints,
|
|
2486
2508
|
onChange: handleTogglePoints,
|
|
2487
2509
|
message: spreePayConfig?.creditCard.pointsInfoMessage,
|
|
2488
|
-
disabled: !spreePayConfig?.creditCard.enabled || !spreePayConfig?.creditCard.points
|
|
2510
|
+
disabled: !spreePayConfig?.creditCard.enabled || !spreePayConfig?.creditCard.points || appProps.disabledPoints
|
|
2489
2511
|
}
|
|
2490
2512
|
),
|
|
2491
2513
|
usePoints && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
package/build/index.css
CHANGED
|
@@ -464,6 +464,9 @@
|
|
|
464
464
|
.sl-spreepay .min-w-0 {
|
|
465
465
|
min-width: calc(var(--spacing) * 0);
|
|
466
466
|
}
|
|
467
|
+
.sl-spreepay .min-w-\[75px\] {
|
|
468
|
+
min-width: 75px;
|
|
469
|
+
}
|
|
467
470
|
.sl-spreepay .flex-1 {
|
|
468
471
|
flex: 1;
|
|
469
472
|
}
|
|
@@ -511,9 +514,6 @@
|
|
|
511
514
|
.sl-spreepay .items-center {
|
|
512
515
|
align-items: center;
|
|
513
516
|
}
|
|
514
|
-
.sl-spreepay .items-start {
|
|
515
|
-
align-items: flex-start;
|
|
516
|
-
}
|
|
517
517
|
.sl-spreepay .justify-between {
|
|
518
518
|
justify-content: space-between;
|
|
519
519
|
}
|
|
@@ -535,6 +535,9 @@
|
|
|
535
535
|
.sl-spreepay .gap-2 {
|
|
536
536
|
gap: calc(var(--spacing) * 2);
|
|
537
537
|
}
|
|
538
|
+
.sl-spreepay .gap-2\.5 {
|
|
539
|
+
gap: calc(var(--spacing) * 2.5);
|
|
540
|
+
}
|
|
538
541
|
.sl-spreepay .gap-3 {
|
|
539
542
|
gap: calc(var(--spacing) * 3);
|
|
540
543
|
}
|
|
@@ -718,9 +721,15 @@
|
|
|
718
721
|
.sl-spreepay .p-6 {
|
|
719
722
|
padding: calc(var(--spacing) * 6);
|
|
720
723
|
}
|
|
724
|
+
.sl-spreepay .px-1 {
|
|
725
|
+
padding-inline: calc(var(--spacing) * 1);
|
|
726
|
+
}
|
|
721
727
|
.sl-spreepay .px-1\.5 {
|
|
722
728
|
padding-inline: calc(var(--spacing) * 1.5);
|
|
723
729
|
}
|
|
730
|
+
.sl-spreepay .px-2 {
|
|
731
|
+
padding-inline: calc(var(--spacing) * 2);
|
|
732
|
+
}
|
|
724
733
|
.sl-spreepay .px-2\.5 {
|
|
725
734
|
padding-inline: calc(var(--spacing) * 2.5);
|
|
726
735
|
}
|
|
@@ -1463,11 +1472,32 @@
|
|
|
1463
1472
|
justify-content: flex-end;
|
|
1464
1473
|
}
|
|
1465
1474
|
}
|
|
1475
|
+
.sl-spreepay .sm\:gap-2 {
|
|
1476
|
+
@media (width >= 40rem) {
|
|
1477
|
+
gap: calc(var(--spacing) * 2);
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
.sl-spreepay .sm\:gap-3 {
|
|
1481
|
+
@media (width >= 40rem) {
|
|
1482
|
+
gap: calc(var(--spacing) * 3);
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
.sl-spreepay .sm\:px-3 {
|
|
1486
|
+
@media (width >= 40rem) {
|
|
1487
|
+
padding-inline: calc(var(--spacing) * 3);
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1466
1490
|
.sl-spreepay .sm\:text-left {
|
|
1467
1491
|
@media (width >= 40rem) {
|
|
1468
1492
|
text-align: left;
|
|
1469
1493
|
}
|
|
1470
1494
|
}
|
|
1495
|
+
.sl-spreepay .sm\:text-sm {
|
|
1496
|
+
@media (width >= 40rem) {
|
|
1497
|
+
font-size: var(--text-sm);
|
|
1498
|
+
line-height: var(--tw-leading, var(--text-sm--line-height));
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1471
1501
|
.sl-spreepay .md\:block {
|
|
1472
1502
|
@media (width >= 48rem) {
|
|
1473
1503
|
display: block;
|
|
@@ -1498,16 +1528,16 @@
|
|
|
1498
1528
|
padding-bottom: calc(var(--spacing) * 7);
|
|
1499
1529
|
}
|
|
1500
1530
|
}
|
|
1501
|
-
.sl-spreepay .md\:text-
|
|
1531
|
+
.sl-spreepay .md\:text-lg {
|
|
1502
1532
|
@media (width >= 48rem) {
|
|
1503
|
-
font-size: var(--text-
|
|
1504
|
-
line-height: var(--tw-leading, var(--text-
|
|
1533
|
+
font-size: var(--text-lg);
|
|
1534
|
+
line-height: var(--tw-leading, var(--text-lg--line-height));
|
|
1505
1535
|
}
|
|
1506
1536
|
}
|
|
1507
|
-
.sl-spreepay .md\:text-
|
|
1537
|
+
.sl-spreepay .md\:text-sm {
|
|
1508
1538
|
@media (width >= 48rem) {
|
|
1509
|
-
font-size: var(--text-
|
|
1510
|
-
line-height: var(--tw-leading, var(--text-
|
|
1539
|
+
font-size: var(--text-sm);
|
|
1540
|
+
line-height: var(--tw-leading, var(--text-sm--line-height));
|
|
1511
1541
|
}
|
|
1512
1542
|
}
|
|
1513
1543
|
.sl-spreepay .dark\:border-input {
|
package/build/index.d.cts
CHANGED
package/build/index.d.ts
CHANGED
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.28";
|
|
8
8
|
|
|
9
9
|
// src/context/SpreePayActionsContext.tsx
|
|
10
10
|
import { createContext, useCallback, useContext, useRef, useState } from "react";
|
|
@@ -1268,24 +1268,43 @@ import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
|
1268
1268
|
var PointsSwitch = (props) => {
|
|
1269
1269
|
const { disabled = false, value, onChange, message } = props;
|
|
1270
1270
|
const { spreePayConfig } = useSpreePayConfig();
|
|
1271
|
+
const { appProps } = useStaticConfig();
|
|
1271
1272
|
const { balance } = useSlapiBalance();
|
|
1272
1273
|
const id = useId2();
|
|
1273
1274
|
return /* @__PURE__ */ jsxs9("div", { className: "flex flex-col gap-6", children: [
|
|
1274
1275
|
/* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between gap-3", children: [
|
|
1275
1276
|
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-3", children: [
|
|
1276
1277
|
/* @__PURE__ */ jsx15(Switch, { checked: value, onCheckedChange: onChange, disabled, id }),
|
|
1277
|
-
/* @__PURE__ */ jsxs9(
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1278
|
+
/* @__PURE__ */ jsxs9(
|
|
1279
|
+
Label,
|
|
1280
|
+
{
|
|
1281
|
+
htmlFor: id,
|
|
1282
|
+
className: "text-md flex-col items-baseline gap-0 leading-[1.3] font-semibold text-black sm:flex-row sm:gap-2 md:text-lg",
|
|
1283
|
+
children: [
|
|
1284
|
+
"Use Points ",
|
|
1285
|
+
/* @__PURE__ */ jsx15("span", { className: "text-xs font-medium", children: "Optional" })
|
|
1286
|
+
]
|
|
1287
|
+
}
|
|
1288
|
+
)
|
|
1281
1289
|
] }),
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1290
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2.5", children: [
|
|
1291
|
+
balance?.availablePoints ? /* @__PURE__ */ jsxs9("p", { className: "flex-1 text-right text-sm font-medium text-black", children: [
|
|
1292
|
+
formatPoints(balance.availablePoints, spreePayConfig?.pointsTitle),
|
|
1293
|
+
!!spreePayConfig?.pointsConversionRatio && /* @__PURE__ */ jsx15("span", { className: "text-black/50", children: ` ${formatUSD(balance.availablePoints * spreePayConfig.pointsConversionRatio)}` })
|
|
1294
|
+
] }) : null,
|
|
1295
|
+
Boolean(appProps.topUpLink) && /* @__PURE__ */ jsx15(
|
|
1296
|
+
"a",
|
|
1297
|
+
{
|
|
1298
|
+
className: "bg-primary cursor-pointer rounded-full px-2 py-1.5 text-xs font-medium text-white",
|
|
1299
|
+
rel: "noreferrer",
|
|
1300
|
+
target: "_blank",
|
|
1301
|
+
href: appProps.topUpLink,
|
|
1302
|
+
children: "Top Up"
|
|
1303
|
+
}
|
|
1304
|
+
)
|
|
1305
|
+
] })
|
|
1287
1306
|
] }),
|
|
1288
|
-
message && /* @__PURE__ */ jsxs9("div", { className: "flex items-
|
|
1307
|
+
message && /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-1 rounded-sm border-1 border-[#006FD533] bg-[#006FD50D] p-1.5", children: [
|
|
1289
1308
|
/* @__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(
|
|
1290
1309
|
"path",
|
|
1291
1310
|
{
|
|
@@ -2331,16 +2350,17 @@ var PointsSelector = (props) => {
|
|
|
2331
2350
|
children: /* @__PURE__ */ jsx24("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-white", children: isSelected && /* @__PURE__ */ jsx24("div", { className: "bg-primary h-2.5 w-2.5 rounded-full" }) })
|
|
2332
2351
|
}
|
|
2333
2352
|
),
|
|
2334
|
-
/* @__PURE__ */ jsx24("div", { className: "flex h-full w-full items-center justify-between gap-3 px-3", children })
|
|
2353
|
+
/* @__PURE__ */ jsx24("div", { className: "flex h-full w-full items-center justify-between gap-2 px-2 sm:gap-3 sm:px-3", children })
|
|
2335
2354
|
] }),
|
|
2336
|
-
isSelected && /* @__PURE__ */ jsx24("div", { className: "px-
|
|
2355
|
+
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: [
|
|
2337
2356
|
/* @__PURE__ */ jsxs12("div", { className: "flex max-w-[100px] flex-col gap-1", children: [
|
|
2338
2357
|
/* @__PURE__ */ jsx24(
|
|
2339
2358
|
Input,
|
|
2340
2359
|
{
|
|
2341
2360
|
readOnly: true,
|
|
2361
|
+
name: "points amount",
|
|
2342
2362
|
value: Math.round(splitTokens),
|
|
2343
|
-
className: "bg-white text-center font-medium",
|
|
2363
|
+
className: "sm:text-md min-w-[75px] bg-white px-1 text-center text-xs font-medium sm:px-3",
|
|
2344
2364
|
onClick: (e) => e.stopPropagation()
|
|
2345
2365
|
}
|
|
2346
2366
|
),
|
|
@@ -2363,8 +2383,9 @@ var PointsSelector = (props) => {
|
|
|
2363
2383
|
Input,
|
|
2364
2384
|
{
|
|
2365
2385
|
readOnly: true,
|
|
2386
|
+
name: "usd amount",
|
|
2366
2387
|
value: formatUSD(usdAmount + getTransactionFee(usdAmount, appProps.transactionFeePercentage)),
|
|
2367
|
-
className: "bg-white text-center font-medium",
|
|
2388
|
+
className: "sm:text-md min-w-[75px] bg-white px-1 text-center text-xs font-medium sm:px-3",
|
|
2368
2389
|
onClick: (e) => e.stopPropagation()
|
|
2369
2390
|
}
|
|
2370
2391
|
),
|
|
@@ -2412,7 +2433,7 @@ var SplitBlock = (props) => {
|
|
|
2412
2433
|
initWallet(spreePayConfig?.pointsChain);
|
|
2413
2434
|
}, [spreePayConfig?.pointsChain, initWallet]);
|
|
2414
2435
|
return /* @__PURE__ */ jsx25("div", { className: "flex flex-col gap-1", children: /* @__PURE__ */ jsxs13(PointsSelector, { isDisabled: !walletReady, onSelect: () => onSelect("air"), isSelected, children: [
|
|
2415
|
-
/* @__PURE__ */ jsx25("div", { className: "flex items-center gap-2", children: balance?.availablePoints ? /* @__PURE__ */ jsxs13("p", { className: "text-
|
|
2436
|
+
/* @__PURE__ */ jsx25("div", { className: "flex items-center gap-2", children: balance?.availablePoints ? /* @__PURE__ */ jsxs13("p", { className: "text-left text-xs font-medium text-black sm:text-sm", children: [
|
|
2416
2437
|
/* @__PURE__ */ jsx25("span", { className: "text-black/50", children: "Available" }),
|
|
2417
2438
|
" ",
|
|
2418
2439
|
formatPoints(balance.availablePoints, pointsTitle),
|
|
@@ -2431,6 +2452,7 @@ var Points = () => {
|
|
|
2431
2452
|
const [selectedPointsType, setSelectedPointsType] = useState10(null);
|
|
2432
2453
|
const { setSelectedPaymentMethod, selectedPaymentMethod } = useSpreePaymentMethod();
|
|
2433
2454
|
const { spreePayConfig } = useSpreePayConfig();
|
|
2455
|
+
const { appProps } = useStaticConfig();
|
|
2434
2456
|
const handleTogglePoints = (enabled) => {
|
|
2435
2457
|
setUsePoints(enabled);
|
|
2436
2458
|
if (!enabled) {
|
|
@@ -2445,7 +2467,7 @@ var Points = () => {
|
|
|
2445
2467
|
value: usePoints,
|
|
2446
2468
|
onChange: handleTogglePoints,
|
|
2447
2469
|
message: spreePayConfig?.creditCard.pointsInfoMessage,
|
|
2448
|
-
disabled: !spreePayConfig?.creditCard.enabled || !spreePayConfig?.creditCard.points
|
|
2470
|
+
disabled: !spreePayConfig?.creditCard.enabled || !spreePayConfig?.creditCard.points || appProps.disabledPoints
|
|
2449
2471
|
}
|
|
2450
2472
|
),
|
|
2451
2473
|
usePoints && /* @__PURE__ */ jsx26(
|