@pollar/react 0.10.1-rc.3 → 0.10.1-rc.4
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.css +54 -4
- package/dist/index.css.map +1 -1
- package/dist/index.js +69 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +69 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1033,11 +1033,62 @@ var PollarModalFooter = () => {
|
|
|
1033
1033
|
/* @__PURE__ */ jsx("span", { className: "pollar-footer-name", children: "Pollar" }),
|
|
1034
1034
|
/* @__PURE__ */ jsxs("span", { className: "pollar-footer-version", children: [
|
|
1035
1035
|
"v",
|
|
1036
|
-
"0.10.1-rc.
|
|
1036
|
+
"0.10.1-rc.4"
|
|
1037
1037
|
] })
|
|
1038
1038
|
] })
|
|
1039
1039
|
] });
|
|
1040
1040
|
};
|
|
1041
|
+
function CopyButton({ value, label = "Copy", className }) {
|
|
1042
|
+
const [copied, setCopied] = useState(false);
|
|
1043
|
+
const timerRef = useRef(null);
|
|
1044
|
+
useEffect(() => {
|
|
1045
|
+
return () => {
|
|
1046
|
+
if (timerRef.current !== null) clearTimeout(timerRef.current);
|
|
1047
|
+
};
|
|
1048
|
+
}, []);
|
|
1049
|
+
function handleCopy(e) {
|
|
1050
|
+
e.stopPropagation();
|
|
1051
|
+
if (!value || !navigator.clipboard) return;
|
|
1052
|
+
void navigator.clipboard.writeText(value).then(() => {
|
|
1053
|
+
setCopied(true);
|
|
1054
|
+
if (timerRef.current !== null) clearTimeout(timerRef.current);
|
|
1055
|
+
timerRef.current = setTimeout(() => {
|
|
1056
|
+
setCopied(false);
|
|
1057
|
+
timerRef.current = null;
|
|
1058
|
+
}, 1500);
|
|
1059
|
+
});
|
|
1060
|
+
}
|
|
1061
|
+
return /* @__PURE__ */ jsx(
|
|
1062
|
+
"button",
|
|
1063
|
+
{
|
|
1064
|
+
type: "button",
|
|
1065
|
+
className: `pollar-copy-btn${className ? ` ${className}` : ""}`,
|
|
1066
|
+
onClick: handleCopy,
|
|
1067
|
+
"aria-label": copied ? "Copied" : label,
|
|
1068
|
+
children: copied ? /* @__PURE__ */ jsx("svg", { width: "13", height: "13", viewBox: "0 0 14 14", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx(
|
|
1069
|
+
"path",
|
|
1070
|
+
{
|
|
1071
|
+
d: "M3.5 7l2.5 2.5 4.5-5",
|
|
1072
|
+
stroke: "currentColor",
|
|
1073
|
+
strokeWidth: "1.5",
|
|
1074
|
+
strokeLinecap: "round",
|
|
1075
|
+
strokeLinejoin: "round"
|
|
1076
|
+
}
|
|
1077
|
+
) }) : /* @__PURE__ */ jsxs("svg", { width: "13", height: "13", viewBox: "0 0 13 13", fill: "none", "aria-hidden": true, children: [
|
|
1078
|
+
/* @__PURE__ */ jsx("rect", { x: "4", y: "4", width: "8", height: "8", rx: "1.5", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1079
|
+
/* @__PURE__ */ jsx(
|
|
1080
|
+
"path",
|
|
1081
|
+
{
|
|
1082
|
+
d: "M3 9H2a1 1 0 01-1-1V2a1 1 0 011-1h6a1 1 0 011 1v1",
|
|
1083
|
+
stroke: "currentColor",
|
|
1084
|
+
strokeWidth: "1.5",
|
|
1085
|
+
strokeLinecap: "round"
|
|
1086
|
+
}
|
|
1087
|
+
)
|
|
1088
|
+
] })
|
|
1089
|
+
}
|
|
1090
|
+
);
|
|
1091
|
+
}
|
|
1041
1092
|
function ModalStatusBanner({ message, status, onCancel, onRetry }) {
|
|
1042
1093
|
if (!message && status === "NONE") {
|
|
1043
1094
|
return /* @__PURE__ */ jsx("div", { className: "pollar-status" });
|
|
@@ -4635,6 +4686,7 @@ function TxHistoryModalTemplate({
|
|
|
4635
4686
|
txHistory.step === "loaded" && records.length === 0 && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "No transactions yet." }),
|
|
4636
4687
|
records.map((record) => {
|
|
4637
4688
|
const explorerUrl = `https://stellar.expert/explorer/${record.network === "testnet" ? "testnet" : "public"}/tx/${record.hash}`;
|
|
4689
|
+
const destination = typeof record.details?.destination === "string" ? record.details.destination : void 0;
|
|
4638
4690
|
return /* @__PURE__ */ jsxs("div", { className: "pollar-hist-item", children: [
|
|
4639
4691
|
/* @__PURE__ */ jsx("span", { className: "pollar-hist-item-summary", children: record.summary }),
|
|
4640
4692
|
/* @__PURE__ */ jsx(StatusBadge, { status: record.status }),
|
|
@@ -4653,6 +4705,10 @@ function TxHistoryModalTemplate({
|
|
|
4653
4705
|
"\xB7 ",
|
|
4654
4706
|
formatDate(record.createdAt)
|
|
4655
4707
|
] }),
|
|
4708
|
+
destination && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4709
|
+
/* @__PURE__ */ jsx("span", { children: "\xB7" }),
|
|
4710
|
+
/* @__PURE__ */ jsx(CopyButton, { value: destination, label: "Copy wallet address", className: "pollar-copy-btn-sm" })
|
|
4711
|
+
] }),
|
|
4656
4712
|
/* @__PURE__ */ jsx("span", { children: "\xB7" }),
|
|
4657
4713
|
/* @__PURE__ */ jsxs(
|
|
4658
4714
|
"a",
|
|
@@ -4741,7 +4797,7 @@ function TxHistoryModal({ onClose }) {
|
|
|
4741
4797
|
}
|
|
4742
4798
|
function formatBalance2(balance) {
|
|
4743
4799
|
const n = parseFloat(balance);
|
|
4744
|
-
return isNaN(n) ? balance : n.toLocaleString(void 0, { maximumFractionDigits: 7 });
|
|
4800
|
+
return isNaN(n) ? balance : n.toLocaleString(void 0, { minimumFractionDigits: 7, maximumFractionDigits: 7 });
|
|
4745
4801
|
}
|
|
4746
4802
|
function cropAddress2(address) {
|
|
4747
4803
|
if (address.length <= 16) return address;
|
|
@@ -4750,7 +4806,13 @@ function cropAddress2(address) {
|
|
|
4750
4806
|
function BalanceItem({ record }) {
|
|
4751
4807
|
const balanceDiffers = record.balance !== record.available;
|
|
4752
4808
|
return /* @__PURE__ */ jsxs("div", { className: "pollar-bal-item", children: [
|
|
4753
|
-
/* @__PURE__ */
|
|
4809
|
+
/* @__PURE__ */ jsxs("div", { className: "pollar-bal-asset-info", children: [
|
|
4810
|
+
/* @__PURE__ */ jsx("span", { className: "pollar-bal-asset", children: record.code }),
|
|
4811
|
+
record.issuer && /* @__PURE__ */ jsxs("span", { className: "pollar-bal-issuer", children: [
|
|
4812
|
+
/* @__PURE__ */ jsx("span", { className: "pollar-bal-issuer-addr", children: cropAddress2(record.issuer) }),
|
|
4813
|
+
/* @__PURE__ */ jsx(CopyButton, { value: record.issuer, label: "Copy issuer address", className: "pollar-copy-btn-sm" })
|
|
4814
|
+
] })
|
|
4815
|
+
] }),
|
|
4754
4816
|
/* @__PURE__ */ jsxs("div", { className: "pollar-bal-amounts", children: [
|
|
4755
4817
|
/* @__PURE__ */ jsx("span", { className: "pollar-bal-amount", children: formatBalance2(record.balance) }),
|
|
4756
4818
|
balanceDiffers && /* @__PURE__ */ jsxs("span", { className: "pollar-bal-available", children: [
|
|
@@ -4813,7 +4875,10 @@ function WalletBalanceModalTemplate({
|
|
|
4813
4875
|
/* @__PURE__ */ jsx("button", { className: "pollar-modal-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
|
|
4814
4876
|
] })
|
|
4815
4877
|
] }),
|
|
4816
|
-
walletAddress && /* @__PURE__ */
|
|
4878
|
+
walletAddress && /* @__PURE__ */ jsxs("div", { className: "pollar-bal-address-row", children: [
|
|
4879
|
+
/* @__PURE__ */ jsx("span", { className: "pollar-bal-address", children: cropAddress2(walletAddress) }),
|
|
4880
|
+
/* @__PURE__ */ jsx(CopyButton, { value: walletAddress, label: "Copy wallet address" })
|
|
4881
|
+
] }),
|
|
4817
4882
|
isLoading && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "Loading\u2026" }),
|
|
4818
4883
|
walletBalance.step === "error" && /* @__PURE__ */ jsx("div", { className: "pollar-modal-error", children: walletBalance.message }),
|
|
4819
4884
|
data && !data.exists && /* @__PURE__ */ jsxs("div", { className: "pollar-modal-empty", children: [
|