@rango-dev/widget-embedded 0.22.4-next.10 → 0.22.4-next.12

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../../src/pages/Home.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAuCnD,wBAAgB,IAAI,sBAkQnB"}
1
+ {"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../../src/pages/Home.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAuCnD,wBAAgB,IAAI,sBAgQnB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.22.4-next.10",
3
+ "version": "0.22.4-next.12",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -21,11 +21,11 @@
21
21
  "dependencies": {
22
22
  "@lingui/core": "4.2.1",
23
23
  "@lingui/react": "4.2.1",
24
- "@rango-dev/provider-all": "^0.27.1-next.2",
24
+ "@rango-dev/provider-all": "^0.27.1-next.3",
25
25
  "@rango-dev/queue-manager-core": "^0.25.1-next.0",
26
26
  "@rango-dev/queue-manager-rango-preset": "^0.27.1-next.2",
27
27
  "@rango-dev/queue-manager-react": "^0.25.1-next.0",
28
- "@rango-dev/ui": "^0.28.2-next.9",
28
+ "@rango-dev/ui": "^0.28.2-next.10",
29
29
  "@rango-dev/wallets-react": "^0.13.1-next.2",
30
30
  "@rango-dev/wallets-shared": "^0.27.1-next.2",
31
31
  "bignumber.js": "^9.1.1",
@@ -84,18 +84,23 @@ export function ConfirmWalletsModal(props: PropTypes) {
84
84
  const isWalletRequiredFor = (blockchain: string) =>
85
85
  !!selectedQuote?.swaps.find((swap) => swap.from.blockchain === blockchain);
86
86
 
87
- const [selectableWallets, setSelectableWallets] = useState<ConnectedWallet[]>(
87
+ const getInitialSelectableWallets = () =>
88
88
  connectedWallets.filter((connectedWallet) => {
89
89
  return (
90
90
  connectedWallet.selected &&
91
91
  requiredWallets.includes(connectedWallet.chain)
92
92
  );
93
- })
93
+ });
94
+
95
+ const [selectableWallets, setSelectableWallets] = useState<ConnectedWallet[]>(
96
+ getInitialSelectableWallets()
94
97
  );
95
98
  const lastStepToBlockchainMeta = blockchains.find(
96
99
  (chain) => chain.name === lastStepToBlockchain?.name
97
100
  );
98
101
 
102
+ const isInsufficientBalanceModalOpen = balanceWarnings.length > 0;
103
+
99
104
  const isSelected = (walletType: string, chain: string) =>
100
105
  !!selectableWallets.find(
101
106
  (selectableWallet) =>
@@ -291,7 +296,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
291
296
  })}
292
297
  anchor="center">
293
298
  <WatermarkedModal
294
- open={balanceWarnings.length > 0}
299
+ open={isInsufficientBalanceModalOpen}
295
300
  onClose={setBalanceWarnings.bind(null, [])}
296
301
  container={modalContainer}>
297
302
  <MessageBox
@@ -95,9 +95,7 @@ export function SwapDetailsCompleteModal(props: CompleteModalPropTypes) {
95
95
  type="primary"
96
96
  size="large"
97
97
  onClick={() => window.open(diagnosisUrl, '_blank')}>
98
- <Typography variant="title" size="medium" color="primary">
99
- {i18n.t('Diagnosis')}
100
- </Typography>
98
+ {i18n.t('Diagnosis')}
101
99
  </Button>
102
100
  <Divider size={12} />
103
101
  </>
@@ -1,7 +1,7 @@
1
1
  import type { CancelContentProps } from './SwapDetailsModal.types';
2
2
 
3
3
  import { i18n } from '@lingui/core';
4
- import { Button, Divider, MessageBox, Typography } from '@rango-dev/ui';
4
+ import { Button, Divider, MessageBox } from '@rango-dev/ui';
5
5
  import React from 'react';
6
6
 
7
7
  export const CancelContent = ({ onCancel, onClose }: CancelContentProps) => {
@@ -19,15 +19,11 @@ export const CancelContent = ({ onCancel, onClose }: CancelContentProps) => {
19
19
  type="primary"
20
20
  size="large"
21
21
  onClick={onCancel}>
22
- <Typography variant="title" size="medium" color="neutral100">
23
- {i18n.t('Yes, Cancel it')}
24
- </Typography>
22
+ {i18n.t('Yes, Cancel it')}
25
23
  </Button>
26
24
  <Divider size={12} />
27
25
  <Button variant="outlined" type="primary" size="large" onClick={onClose}>
28
- <Typography variant="title" size="medium" color="primary">
29
- {i18n.t('No, Continue')}
30
- </Typography>
26
+ {i18n.t('No, Continue')}
31
27
  </Button>
32
28
  </>
33
29
  );
@@ -19,9 +19,7 @@ export const DeleteContent = ({ onDelete, onClose }: DeleteContentProps) => {
19
19
  type="primary"
20
20
  size="large"
21
21
  onClick={onDelete}>
22
- <Typography variant="title" size="medium" color="neutral100">
23
- {i18n.t('Yes, Delete it')}
24
- </Typography>
22
+ {i18n.t('Yes, Delete it')}
25
23
  </Button>
26
24
  <Divider size={12} />
27
25
  <Button variant="outlined" type="primary" size="large" onClick={onClose}>
@@ -102,7 +102,7 @@ export function Home() {
102
102
  formatBalance(fromTokenBalance)?.amount ?? '0';
103
103
 
104
104
  const tokenBalanceReal =
105
- !!fromBlockchain && !!fromToken
105
+ !!fromBlockchain && !!fromToken && fromTokenBalance?.amount
106
106
  ? numberToString(fromTokenBalance?.amount, fromTokenBalance?.decimals)
107
107
  : '0';
108
108
 
@@ -203,9 +203,7 @@ export function Home() {
203
203
  loadingBalance={fetchingBalance}
204
204
  tooltipContainer={getContainer()}
205
205
  onSelectMaxBalance={() => {
206
- if (fromTokenFormattedBalance !== '0') {
207
- setInputAmount(tokenBalanceReal.split(',').join(''));
208
- }
206
+ setInputAmount(tokenBalanceReal.split(',').join(''));
209
207
  }}
210
208
  />
211
209
  <SwitchFromAndToButton />