coinley-checkout 0.5.8 → 0.6.0

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.
@@ -20595,7 +20595,9 @@ const PaymentStatus = ({
20595
20595
  payment = null,
20596
20596
  transactionHash = null,
20597
20597
  selectedPaymentMethod = null,
20598
- merchantName = "Merchant"
20598
+ merchantName = "Merchant",
20599
+ onClose = null
20600
+ // Add onClose prop for the close button
20599
20601
  }) => {
20600
20602
  const [copiedHash, setCopiedHash] = useState(false);
20601
20603
  const copyTransactionHash = () => __async(void 0, null, function* () {
@@ -20728,7 +20730,7 @@ const PaymentStatus = ({
20728
20730
  }
20729
20731
  )
20730
20732
  ] }),
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: [
20733
+ /* @__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
20734
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
20733
20735
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-xs font-medium mb-1 ${theme2 === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "Merchant ID:" }),
20734
20736
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-sm font-medium ${theme2 === "dark" ? "text-gray-300" : "text-gray-700"}`, children: merchantName })
@@ -20741,7 +20743,16 @@ const PaymentStatus = ({
20741
20743
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-xs font-medium mb-1 ${theme2 === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "Recipient:" }),
20742
20744
  /* @__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
20745
  ] })
20744
- ] }) })
20746
+ ] }) }),
20747
+ onClose && /* @__PURE__ */ jsxRuntimeExports.jsx(
20748
+ "button",
20749
+ {
20750
+ onClick: onClose,
20751
+ className: "w-full py-3 px-4 bg-[#7042D2] text-white font-medium rounded-2xl text-lg shadow-md hover:bg-[#5b34b1] transition-colors",
20752
+ style: { borderRadius: "1.5rem" },
20753
+ children: "Close"
20754
+ }
20755
+ )
20745
20756
  ] });
20746
20757
  }
20747
20758
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
@@ -21140,6 +21151,9 @@ const CoinleyModal = ({
21140
21151
  }
21141
21152
  return "No wallet address configured for this network";
21142
21153
  };
21154
+ const handleSuccessClose = () => {
21155
+ onClose();
21156
+ };
21143
21157
  const formatAmount = (amount) => {
21144
21158
  return parseFloat(amount).toFixed(2);
21145
21159
  };
@@ -21175,7 +21189,7 @@ const CoinleyModal = ({
21175
21189
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 z-50 overflow-y-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex min-h-screen items-center justify-center p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
21176
21190
  "div",
21177
21191
  {
21178
- className: "coinley-modal relative p-6 w-full max-w-[490px] mx-auto rounded-3xl shadow-xl bg-gray-100",
21192
+ className: "coinley-modal relative p-6 max-w-[490px] mx-auto rounded-3xl shadow-xl bg-gray-100",
21179
21193
  style: {
21180
21194
  maxWidth: "490px !important",
21181
21195
  width: "100% !important",
@@ -21187,7 +21201,7 @@ const CoinleyModal = ({
21187
21201
  /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: logo, className: "w-auto h-auto", alt: "Coinley Logo" }),
21188
21202
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-lg font-semibold text-gray-800", children: "Payment Details" })
21189
21203
  ] }),
21190
- /* @__PURE__ */ jsxRuntimeExports.jsx(
21204
+ step !== "success" && /* @__PURE__ */ jsxRuntimeExports.jsx(
21191
21205
  "button",
21192
21206
  {
21193
21207
  onClick: onClose,
@@ -21196,7 +21210,7 @@ const CoinleyModal = ({
21196
21210
  }
21197
21211
  )
21198
21212
  ] }),
21199
- payment && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
21213
+ payment && step !== "success" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
21200
21214
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm text-gray-600", children: "Total amount" }),
21201
21215
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "coinley-amount-display text-5xl font-bold text-[#7042D2] mt-2", children: [
21202
21216
  "$",
@@ -21378,7 +21392,8 @@ const CoinleyModal = ({
21378
21392
  payment,
21379
21393
  transactionHash,
21380
21394
  selectedPaymentMethod,
21381
- merchantName
21395
+ merchantName,
21396
+ onClose: handleSuccessClose
21382
21397
  }
21383
21398
  ),
21384
21399
  step === "error" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
@@ -21400,7 +21415,7 @@ const CoinleyModal = ({
21400
21415
  }
21401
21416
  )
21402
21417
  ] }),
21403
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center text-xs text-gray-500 flex items-center justify-center gap-1 mt-6", children: [
21418
+ 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
21419
  /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
21405
21420
  "Powered by ",
21406
21421
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-purple-600", children: "Coinley" }),