coinley-checkout 0.5.9 → 0.6.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.
@@ -20591,11 +20591,13 @@ const PaymentStatus = ({
20591
20591
  status,
20592
20592
  message,
20593
20593
  theme: theme2 = "light",
20594
- // New props for success screen
20594
+ // Props for success screen
20595
20595
  payment = null,
20596
20596
  transactionHash = null,
20597
20597
  selectedPaymentMethod = null,
20598
- merchantName = "Merchant"
20598
+ merchantName = "Merchant",
20599
+ onClose = null
20600
+ // The onClose prop for the close button
20599
20601
  }) => {
20600
20602
  const [copiedHash, setCopiedHash] = useState(false);
20601
20603
  const copyTransactionHash = () => __async(void 0, null, function* () {
@@ -20609,6 +20611,12 @@ const PaymentStatus = ({
20609
20611
  }
20610
20612
  }
20611
20613
  });
20614
+ const handleClose = () => {
20615
+ console.log("Payment success screen close button clicked");
20616
+ if (onClose) {
20617
+ onClose();
20618
+ }
20619
+ };
20612
20620
  const formatTransactionHash = (hash2) => {
20613
20621
  if (!hash2)
20614
20622
  return "";
@@ -20728,7 +20736,7 @@ const PaymentStatus = ({
20728
20736
  }
20729
20737
  )
20730
20738
  ] }),
20731
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-full p-4 rounded-lg border ${theme2 === "dark" ? "bg-gray-700 border-gray-600" : "bg-gray-50 border-gray-200"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
20739
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-full p-4 rounded-lg border mb-6 ${theme2 === "dark" ? "bg-gray-700 border-gray-600" : "bg-gray-50 border-gray-200"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
20732
20740
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
20733
20741
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-xs font-medium mb-1 ${theme2 === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "Merchant ID:" }),
20734
20742
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-sm font-medium ${theme2 === "dark" ? "text-gray-300" : "text-gray-700"}`, children: merchantName })
@@ -20741,7 +20749,16 @@ const PaymentStatus = ({
20741
20749
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-xs font-medium mb-1 ${theme2 === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "Recipient:" }),
20742
20750
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-sm font-mono ${theme2 === "dark" ? "text-gray-300" : "text-gray-700"}`, children: (payment == null ? void 0 : payment.recipientWallet) ? formatRecipientAddress(payment.recipientWallet) : "N/A" })
20743
20751
  ] })
20744
- ] }) })
20752
+ ] }) }),
20753
+ onClose && /* @__PURE__ */ jsxRuntimeExports.jsx(
20754
+ "button",
20755
+ {
20756
+ onClick: handleClose,
20757
+ className: "w-full py-3 px-4 bg-[#7042D2] text-white font-medium rounded-2xl text-lg shadow-md hover:bg-[#5b34b1] transition-colors",
20758
+ style: { borderRadius: "1.5rem" },
20759
+ children: "Close"
20760
+ }
20761
+ )
20745
20762
  ] });
20746
20763
  }
20747
20764
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
@@ -21140,6 +21157,12 @@ const CoinleyModal = ({
21140
21157
  }
21141
21158
  return "No wallet address configured for this network";
21142
21159
  };
21160
+ const handleSuccessClose = () => {
21161
+ console.log("Success screen close button clicked");
21162
+ if (onClose) {
21163
+ onClose();
21164
+ }
21165
+ };
21143
21166
  const formatAmount = (amount) => {
21144
21167
  return parseFloat(amount).toFixed(2);
21145
21168
  };
@@ -21187,7 +21210,7 @@ const CoinleyModal = ({
21187
21210
  /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: logo, className: "w-auto h-auto", alt: "Coinley Logo" }),
21188
21211
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-lg font-semibold text-gray-800", children: "Payment Details" })
21189
21212
  ] }),
21190
- /* @__PURE__ */ jsxRuntimeExports.jsx(
21213
+ step !== "success" && /* @__PURE__ */ jsxRuntimeExports.jsx(
21191
21214
  "button",
21192
21215
  {
21193
21216
  onClick: onClose,
@@ -21196,7 +21219,7 @@ const CoinleyModal = ({
21196
21219
  }
21197
21220
  )
21198
21221
  ] }),
21199
- payment && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
21222
+ payment && step !== "success" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
21200
21223
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm text-gray-600", children: "Total amount" }),
21201
21224
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "coinley-amount-display text-5xl font-bold text-[#7042D2] mt-2", children: [
21202
21225
  "$",
@@ -21378,7 +21401,8 @@ const CoinleyModal = ({
21378
21401
  payment,
21379
21402
  transactionHash,
21380
21403
  selectedPaymentMethod,
21381
- merchantName
21404
+ merchantName,
21405
+ onClose: handleSuccessClose
21382
21406
  }
21383
21407
  ),
21384
21408
  step === "error" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
@@ -21400,7 +21424,7 @@ const CoinleyModal = ({
21400
21424
  }
21401
21425
  )
21402
21426
  ] }),
21403
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center text-xs text-gray-500 flex items-center justify-center gap-1 mt-6", children: [
21427
+ step !== "success" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center text-xs text-gray-500 flex items-center justify-center gap-1 mt-6", children: [
21404
21428
  /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
21405
21429
  "Powered by ",
21406
21430
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-purple-600", children: "Coinley" }),