@unifold/ui-react 0.1.10 → 0.1.11

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.js CHANGED
@@ -476,6 +476,14 @@ var import_react2 = require("react");
476
476
  var import_lucide_react4 = require("lucide-react");
477
477
  var import_core2 = require("@unifold/core");
478
478
  var import_jsx_runtime6 = require("react/jsx-runtime");
479
+ function formatCurrency(currency) {
480
+ if (!currency) return "";
481
+ const dotIndex = currency.indexOf(".");
482
+ if (dotIndex === -1) {
483
+ return currency.toUpperCase();
484
+ }
485
+ return currency.slice(0, dotIndex).toUpperCase() + currency.slice(dotIndex);
486
+ }
479
487
  function DepositDetailContent({ execution }) {
480
488
  const [chains, setChains] = (0, import_react2.useState)([]);
481
489
  const [showNetworkDetails, setShowNetworkDetails] = (0, import_react2.useState)(false);
@@ -615,7 +623,7 @@ function DepositDetailContent({ execution }) {
615
623
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
616
624
  formatAmount(execution.source_amount_base_unit),
617
625
  " ",
618
- execution.source_currency?.toUpperCase()
626
+ formatCurrency(execution.source_currency)
619
627
  ] })
620
628
  ] }),
621
629
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
@@ -623,7 +631,7 @@ function DepositDetailContent({ execution }) {
623
631
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
624
632
  formatAmount(execution.destination_amount_base_unit),
625
633
  " ",
626
- execution.destination_currency?.toUpperCase()
634
+ formatCurrency(execution.destination_currency)
627
635
  ] })
628
636
  ] }),
629
637
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
@@ -1252,6 +1260,10 @@ function TransferCryptoBase({
1252
1260
  setLoading(false);
1253
1261
  return;
1254
1262
  }
1263
+ if (internalWallets.length > 0) {
1264
+ setLoading(false);
1265
+ return;
1266
+ }
1255
1267
  let retryTimeout = null;
1256
1268
  let isCancelled = false;
1257
1269
  const fetchWallets = async () => {
@@ -2082,6 +2094,10 @@ function BuyWithCard({
2082
2094
  setWalletsLoading(false);
2083
2095
  return;
2084
2096
  }
2097
+ if (internalWallets.length > 0) {
2098
+ setWalletsLoading(false);
2099
+ return;
2100
+ }
2085
2101
  let retryTimeout = null;
2086
2102
  let isCancelled = false;
2087
2103
  const fetchWallets = async () => {
package/dist/index.mjs CHANGED
@@ -391,6 +391,14 @@ import {
391
391
  getChainName
392
392
  } from "@unifold/core";
393
393
  import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
394
+ function formatCurrency(currency) {
395
+ if (!currency) return "";
396
+ const dotIndex = currency.indexOf(".");
397
+ if (dotIndex === -1) {
398
+ return currency.toUpperCase();
399
+ }
400
+ return currency.slice(0, dotIndex).toUpperCase() + currency.slice(dotIndex);
401
+ }
394
402
  function DepositDetailContent({ execution }) {
395
403
  const [chains, setChains] = useState([]);
396
404
  const [showNetworkDetails, setShowNetworkDetails] = useState(false);
@@ -530,7 +538,7 @@ function DepositDetailContent({ execution }) {
530
538
  /* @__PURE__ */ jsxs4("span", { className: "uf-text-foreground uf-font-medium", children: [
531
539
  formatAmount(execution.source_amount_base_unit),
532
540
  " ",
533
- execution.source_currency?.toUpperCase()
541
+ formatCurrency(execution.source_currency)
534
542
  ] })
535
543
  ] }),
536
544
  /* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
@@ -538,7 +546,7 @@ function DepositDetailContent({ execution }) {
538
546
  /* @__PURE__ */ jsxs4("span", { className: "uf-text-foreground uf-font-medium", children: [
539
547
  formatAmount(execution.destination_amount_base_unit),
540
548
  " ",
541
- execution.destination_currency?.toUpperCase()
549
+ formatCurrency(execution.destination_currency)
542
550
  ] })
543
551
  ] }),
544
552
  /* @__PURE__ */ jsxs4("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
@@ -1173,6 +1181,10 @@ function TransferCryptoBase({
1173
1181
  setLoading(false);
1174
1182
  return;
1175
1183
  }
1184
+ if (internalWallets.length > 0) {
1185
+ setLoading(false);
1186
+ return;
1187
+ }
1176
1188
  let retryTimeout = null;
1177
1189
  let isCancelled = false;
1178
1190
  const fetchWallets = async () => {
@@ -2012,6 +2024,10 @@ function BuyWithCard({
2012
2024
  setWalletsLoading(false);
2013
2025
  return;
2014
2026
  }
2027
+ if (internalWallets.length > 0) {
2028
+ setWalletsLoading(false);
2029
+ return;
2030
+ }
2015
2031
  let retryTimeout = null;
2016
2032
  let isCancelled = false;
2017
2033
  const fetchWallets = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifold/ui-react",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Unifold UI React - Deposit and onramp components for React applications",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -31,7 +31,7 @@
31
31
  "lucide-react": "^0.294.0",
32
32
  "qr-code-styling": "^1.6.0-rc.1",
33
33
  "tailwind-merge": "^2.0.0",
34
- "@unifold/core": "0.1.10"
34
+ "@unifold/core": "0.1.11"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/react": "^18.2.0",