@rango-dev/widget-embedded 0.22.4-next.0 → 0.22.4-next.10
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/QueueManager.d.ts.map +1 -1
- package/dist/components/AppRoutes.d.ts.map +1 -1
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts +3 -0
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts.map +1 -1
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +1 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts +2 -2
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +15 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts +3 -0
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts.map +1 -1
- package/dist/components/CustomCollapsible/CustomCollapsible.styles.d.ts +4 -0
- package/dist/components/CustomCollapsible/CustomCollapsible.styles.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HeaderButtons.d.ts +4 -0
- package/dist/components/HeaderButtons/HeaderButtons.d.ts.map +1 -0
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +5 -0
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts +3 -2
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts.map +1 -1
- package/dist/components/HeaderButtons/index.d.ts +1 -1
- package/dist/components/HeaderButtons/index.d.ts.map +1 -1
- package/dist/components/HistoryGroupedList/HistoryGroupedList.styles.d.ts +6 -0
- package/dist/components/HistoryGroupedList/HistoryGroupedList.styles.d.ts.map +1 -1
- package/dist/components/Layout/Layout.d.ts.map +1 -1
- package/dist/components/Layout/Layout.styles.d.ts +3 -0
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
- package/dist/components/Layout/Layout.types.d.ts +1 -0
- package/dist/components/Layout/Layout.types.d.ts.map +1 -1
- package/dist/components/Layout/PageContainer.d.ts +1 -0
- package/dist/components/Layout/PageContainer.d.ts.map +1 -1
- package/dist/components/Layout/ScrollableArea.d.ts +1 -0
- package/dist/components/Layout/ScrollableArea.d.ts.map +1 -1
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +1 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +14 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.styles.d.ts +3 -0
- package/dist/components/NoResult/NoResult.styles.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts +4 -0
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.d.ts.map +1 -1
- package/dist/components/Quote/Quote.styles.d.ts +1136 -25
- package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.types.d.ts +12 -7
- package/dist/components/Quote/Quote.types.d.ts.map +1 -1
- package/dist/components/Quote/QuoteCostDetails.d.ts.map +1 -1
- package/dist/components/Quote/QuoteCostDetails.styles.d.ts +5 -0
- package/dist/components/Quote/QuoteCostDetails.styles.d.ts.map +1 -1
- package/dist/components/Quote/QuoteSummary.styles.d.ts +2 -0
- package/dist/components/Quote/QuoteSummary.styles.d.ts.map +1 -1
- package/dist/components/Quote/QuoteTrigger .d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts +4 -0
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/QuoteSkeleton.types.d.ts +1 -1
- package/dist/components/QuoteSkeleton/QuoteSkeleton.types.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts +20 -10
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.types.d.ts +1 -1
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.types.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts +5 -0
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts +4 -0
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -1
- package/dist/components/SearchInput/SearchInput.styles.d.ts +1 -0
- package/dist/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +3 -0
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.styles.d.ts +5 -0
- package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts +13 -0
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts +2 -1
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/index.d.ts +1 -1
- package/dist/components/SwapDetailsModal/index.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.styles.d.ts +17 -0
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts +4 -0
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts.map +1 -1
- package/dist/constants/languages.d.ts.map +1 -1
- package/dist/constants/navigationRoutes.d.ts +1 -0
- package/dist/constants/navigationRoutes.d.ts.map +1 -1
- package/dist/constants/quote.d.ts +5 -1
- package/dist/constants/quote.d.ts.map +1 -1
- package/dist/containers/App/App.styles.d.ts +1 -0
- package/dist/containers/App/App.styles.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +3 -0
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +6 -3
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
- package/dist/containers/Wallets/Wallets.d.ts.map +1 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts.map +1 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts +5 -4
- package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts.map +1 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts +1 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts.map +1 -1
- package/dist/hooks/useFetch.d.ts +12 -0
- package/dist/hooks/useFetch.d.ts.map +1 -0
- package/dist/hooks/useFetchAllQuotes.d.ts +4 -0
- package/dist/hooks/useFetchAllQuotes.d.ts.map +1 -0
- package/dist/hooks/useFetchConfirmQuote.d.ts +4 -0
- package/dist/hooks/useFetchConfirmQuote.d.ts.map +1 -0
- package/dist/hooks/useSwapInput.d.ts +5 -5
- package/dist/hooks/useSwapInput.d.ts.map +1 -1
- package/dist/hooks/useWalletList.d.ts +1 -0
- package/dist/hooks/useWalletList.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +4 -4
- package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
- package/dist/pages/Routes.d.ts +3 -0
- package/dist/pages/Routes.d.ts.map +1 -0
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/AppStore.d.ts +2 -2
- package/dist/store/app.d.ts +2 -2
- package/dist/store/quote.d.ts +32 -10
- package/dist/store/quote.d.ts.map +1 -1
- package/dist/store/wallets.d.ts +0 -2
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/types/quote.d.ts +19 -1
- package/dist/types/quote.d.ts.map +1 -1
- package/dist/utils/quote.d.ts +12 -9
- package/dist/utils/quote.d.ts.map +1 -1
- package/dist/utils/settings.d.ts +2 -3
- package/dist/utils/settings.d.ts.map +1 -1
- package/dist/utils/swap.d.ts +18 -18
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +4 -3
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +10 -10
- package/src/QueueManager.tsx +0 -3
- package/src/components/AppRoutes.tsx +5 -0
- package/src/components/ConfirmWalletsModal/ConfirmWallets.helpers.ts +3 -3
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +22 -19
- package/src/components/ConfirmWalletsModal/WalletList.tsx +24 -18
- package/src/components/HeaderButtons/{HomeButtons.tsx → HeaderButtons.tsx} +39 -26
- package/src/components/HeaderButtons/HeaderButtons.types.ts +3 -2
- package/src/components/HeaderButtons/index.ts +1 -1
- package/src/components/Layout/Layout.tsx +13 -1
- package/src/components/Layout/Layout.types.ts +1 -0
- package/src/components/Quote/Quote.styles.ts +133 -38
- package/src/components/Quote/Quote.tsx +77 -18
- package/src/components/Quote/Quote.types.ts +13 -7
- package/src/components/Quote/QuoteCostDetails.tsx +9 -4
- package/src/components/Quote/QuoteTrigger .tsx +7 -3
- package/src/components/QuoteSkeleton/QuoteSkeleton.tsx +2 -2
- package/src/components/QuoteSkeleton/QuoteSkeleton.types.ts +1 -1
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.styles.ts +10 -12
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.tsx +28 -9
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.types.ts +1 -1
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +19 -19
- package/src/components/SwapDetails/SwapDetails.tsx +1 -1
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.types.ts +1 -1
- package/src/components/SwapDetailsModal/index.ts +1 -1
- package/src/constants/languages.ts +2 -1
- package/src/constants/navigationRoutes.ts +1 -0
- package/src/constants/quote.ts +17 -1
- package/src/containers/QuoteInfo/QuoteInfo.tsx +32 -7
- package/src/containers/QuoteInfo/QuoteInfo.types.ts +6 -3
- package/src/containers/Wallets/Wallets.tsx +5 -11
- package/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts +36 -20
- package/src/hooks/useConfirmSwap/useConfirmSwap.ts +76 -78
- package/src/hooks/useConfirmSwap/useConfirmSwap.types.ts +1 -1
- package/src/hooks/useFetch.ts +48 -0
- package/src/hooks/useFetchAllQuotes.ts +21 -0
- package/src/hooks/useFetchConfirmQuote.ts +21 -0
- package/src/hooks/useSwapInput.ts +59 -31
- package/src/hooks/useWalletList.ts +5 -3
- package/src/pages/ConfirmSwapPage.tsx +12 -9
- package/src/pages/Home.tsx +25 -15
- package/src/pages/LiquiditySourcePage.tsx +3 -5
- package/src/pages/Routes.tsx +131 -0
- package/src/pages/SettingsPage.tsx +11 -13
- package/src/pages/WalletsPage.tsx +24 -18
- package/src/store/quote.ts +60 -22
- package/src/store/wallets.ts +0 -2
- package/src/types/quote.ts +27 -1
- package/src/utils/quote.ts +129 -67
- package/src/utils/settings.ts +2 -4
- package/src/utils/swap.ts +37 -77
- package/src/utils/wallets.ts +14 -9
- package/dist/components/HeaderButtons/HomeButtons.d.ts +0 -4
- package/dist/components/HeaderButtons/HomeButtons.d.ts.map +0 -1
- package/dist/hooks/useFetchQuote.d.ts +0 -9
- package/dist/hooks/useFetchQuote.d.ts.map +0 -1
- package/src/hooks/useFetchQuote.ts +0 -38
|
@@ -55,7 +55,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
55
55
|
|
|
56
56
|
const blockchains = useAppStore().blockchains();
|
|
57
57
|
const {
|
|
58
|
-
|
|
58
|
+
selectedQuote,
|
|
59
59
|
setSelectedWallets: selectQuoteWallets,
|
|
60
60
|
quoteWalletsConfirmed: quoteWalletsConfirmed,
|
|
61
61
|
setQuoteWalletConfirmed: setQuoteWalletConfirmed,
|
|
@@ -70,20 +70,19 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
70
70
|
const [quoteWarning, setQuoteWarning] = useState<
|
|
71
71
|
ConfirmSwapWarnings['quoteUpdate'] | null
|
|
72
72
|
>(null);
|
|
73
|
-
const [destination, setDestination] = useState(customDestination);
|
|
74
73
|
const [showCustomDestination, setShowCustomDestination] = useState(
|
|
75
74
|
!!customDestination
|
|
76
75
|
);
|
|
77
76
|
|
|
78
|
-
const requiredWallets = getRequiredWallets(
|
|
77
|
+
const requiredWallets = getRequiredWallets(selectedQuote?.swaps || null);
|
|
79
78
|
|
|
80
79
|
const lastStepToBlockchain = blockchains.find(
|
|
81
80
|
(blockchain) =>
|
|
82
81
|
blockchain.name ===
|
|
83
|
-
|
|
82
|
+
selectedQuote?.swaps[selectedQuote?.swaps.length - 1].to.blockchain
|
|
84
83
|
);
|
|
85
84
|
const isWalletRequiredFor = (blockchain: string) =>
|
|
86
|
-
!!
|
|
85
|
+
!!selectedQuote?.swaps.find((swap) => swap.from.blockchain === blockchain);
|
|
87
86
|
|
|
88
87
|
const [selectableWallets, setSelectableWallets] = useState<ConnectedWallet[]>(
|
|
89
88
|
connectedWallets.filter((connectedWallet) => {
|
|
@@ -104,18 +103,18 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
104
103
|
selectableWallet.chain === chain &&
|
|
105
104
|
selectableWallet.selected &&
|
|
106
105
|
(isWalletRequiredFor(chain) ||
|
|
107
|
-
(!isWalletRequiredFor(chain) && !
|
|
106
|
+
(!isWalletRequiredFor(chain) && !customDestination))
|
|
108
107
|
);
|
|
109
108
|
|
|
110
109
|
const isAddressMatched =
|
|
111
|
-
!!
|
|
110
|
+
!!customDestination &&
|
|
112
111
|
showCustomDestination &&
|
|
113
112
|
lastStepToBlockchainMeta &&
|
|
114
|
-
!isValidAddress(lastStepToBlockchainMeta,
|
|
113
|
+
!isValidAddress(lastStepToBlockchainMeta, customDestination);
|
|
115
114
|
|
|
116
115
|
const resetCustomDestination = () => {
|
|
117
116
|
setShowCustomDestination(false);
|
|
118
|
-
|
|
117
|
+
setCustomDestination(null);
|
|
119
118
|
setSelectableWallets((selectableWallets) => {
|
|
120
119
|
let anyWalletSelected = false;
|
|
121
120
|
return selectableWallets.map((selectableWallet) => {
|
|
@@ -155,7 +154,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
155
154
|
onCancel();
|
|
156
155
|
if (wallet.chain === lastStepToBlockchain?.name && showCustomDestination) {
|
|
157
156
|
setShowCustomDestination(false);
|
|
158
|
-
|
|
157
|
+
setCustomDestination(null);
|
|
159
158
|
}
|
|
160
159
|
setSelectableWallets((selectableWallets) =>
|
|
161
160
|
selectableWallets
|
|
@@ -170,7 +169,6 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
170
169
|
);
|
|
171
170
|
selectWallets(lastSelectedWallets);
|
|
172
171
|
selectQuoteWallets(lastSelectedWallets);
|
|
173
|
-
setCustomDestination(destination);
|
|
174
172
|
setQuoteWalletConfirmed(true);
|
|
175
173
|
onClose();
|
|
176
174
|
};
|
|
@@ -188,9 +186,8 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
188
186
|
);
|
|
189
187
|
const result = await onCheckBalance?.({
|
|
190
188
|
selectedWallets,
|
|
191
|
-
customDestination
|
|
189
|
+
customDestination,
|
|
192
190
|
});
|
|
193
|
-
|
|
194
191
|
const warnings = result.warnings;
|
|
195
192
|
if (warnings?.balance?.messages) {
|
|
196
193
|
setBalanceWarnings(warnings.balance.messages);
|
|
@@ -254,8 +251,8 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
254
251
|
disabled={confirmSwapDisabled(
|
|
255
252
|
loading,
|
|
256
253
|
showCustomDestination,
|
|
257
|
-
|
|
258
|
-
|
|
254
|
+
customDestination,
|
|
255
|
+
selectedQuote,
|
|
259
256
|
selectableWallets,
|
|
260
257
|
lastStepToBlockchain
|
|
261
258
|
)}
|
|
@@ -270,7 +267,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
270
267
|
),
|
|
271
268
|
})}
|
|
272
269
|
{...(showMoreWalletFor && {
|
|
273
|
-
|
|
270
|
+
styles: { container: { padding: '$0' } },
|
|
274
271
|
header: (
|
|
275
272
|
<ShowMoreHeader>
|
|
276
273
|
<NavigateBack
|
|
@@ -442,9 +439,15 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
442
439
|
<StyledTextField
|
|
443
440
|
autoFocus
|
|
444
441
|
placeholder={i18n.t('Your destination address')}
|
|
445
|
-
value={
|
|
442
|
+
value={customDestination || ''}
|
|
446
443
|
onChange={(e) => {
|
|
447
|
-
|
|
444
|
+
const value = e.target.value;
|
|
445
|
+
if (!value.length) {
|
|
446
|
+
setShowCustomDestination(false);
|
|
447
|
+
setCustomDestination(null);
|
|
448
|
+
} else {
|
|
449
|
+
setCustomDestination(value.length ? value : null);
|
|
450
|
+
}
|
|
448
451
|
}}
|
|
449
452
|
/>
|
|
450
453
|
</CustomCollapsible>
|
|
@@ -455,7 +458,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
455
458
|
variant="alarm"
|
|
456
459
|
type="error"
|
|
457
460
|
title={i18n.t({
|
|
458
|
-
values: { destination },
|
|
461
|
+
values: { destination: customDestination },
|
|
459
462
|
id: "Address {destination} doesn't match the blockchain address pattern.",
|
|
460
463
|
})}
|
|
461
464
|
/>
|
|
@@ -59,23 +59,24 @@ export function WalletList(props: PropTypes) {
|
|
|
59
59
|
useState<'in-progress' | 'completed' | 'rejected' | null>(null);
|
|
60
60
|
const { suggestAndConnect } = useWallets();
|
|
61
61
|
let modalTimerId: ReturnType<typeof setTimeout> | null = null;
|
|
62
|
-
const { list, error, handleClick } =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
62
|
+
const { list, error, handleClick, disconnectConnectingWallets } =
|
|
63
|
+
useWalletList({
|
|
64
|
+
config,
|
|
65
|
+
chain,
|
|
66
|
+
onBeforeConnect: (type) => {
|
|
67
|
+
modalTimerId = setTimeout(() => {
|
|
68
|
+
setOpenWalletStateModal(type);
|
|
69
|
+
}, TIME_TO_IGNORE_MODAL);
|
|
70
|
+
},
|
|
71
|
+
onConnect: () => {
|
|
72
|
+
if (modalTimerId) {
|
|
73
|
+
clearTimeout(modalTimerId);
|
|
74
|
+
}
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
setOpenWalletStateModal('');
|
|
77
|
+
}, TIME_TO_CLOSE_MODAL);
|
|
78
|
+
},
|
|
79
|
+
});
|
|
79
80
|
const [sortedList, setSortedList] = useState<WalletInfo[]>(list);
|
|
80
81
|
const numberOfSupportedWallets = list.length;
|
|
81
82
|
const shouldShowMoreWallets = limit && numberOfSupportedWallets - limit > 0;
|
|
@@ -133,6 +134,11 @@ export function WalletList(props: PropTypes) {
|
|
|
133
134
|
};
|
|
134
135
|
}, [addingExperimentalChainStatus]);
|
|
135
136
|
|
|
137
|
+
const handleCloseWalletModal = () => {
|
|
138
|
+
disconnectConnectingWallets();
|
|
139
|
+
setOpenWalletStateModal('');
|
|
140
|
+
};
|
|
141
|
+
|
|
136
142
|
return (
|
|
137
143
|
<>
|
|
138
144
|
{sortedList.slice(0, limit).map((wallet) => {
|
|
@@ -195,7 +201,7 @@ export function WalletList(props: PropTypes) {
|
|
|
195
201
|
<>
|
|
196
202
|
<WalletModal
|
|
197
203
|
open={openWalletStateModal === wallet.type}
|
|
198
|
-
onClose={
|
|
204
|
+
onClose={handleCloseWalletModal}
|
|
199
205
|
image={wallet.image}
|
|
200
206
|
state={wallet.state}
|
|
201
207
|
error={error}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { HeaderButtonsPropTypes } from './HeaderButtons.types';
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
4
|
import {
|
|
@@ -19,23 +19,32 @@ import { HeaderButton } from './HeaderButtons.styles';
|
|
|
19
19
|
import { RefreshButton } from './RefreshButton';
|
|
20
20
|
import { UnreadNotificationsBadge } from './UnreadNotificationsBadge';
|
|
21
21
|
|
|
22
|
-
export function
|
|
23
|
-
const {
|
|
22
|
+
export function HeaderButtons(props: HeaderButtonsPropTypes) {
|
|
23
|
+
const {
|
|
24
|
+
onClickRefresh,
|
|
25
|
+
onClickHistory,
|
|
26
|
+
onClickSettings,
|
|
27
|
+
hidden = [],
|
|
28
|
+
} = props;
|
|
24
29
|
|
|
25
30
|
const {
|
|
26
31
|
config: { features },
|
|
27
32
|
} = useAppStore();
|
|
28
33
|
|
|
29
|
-
const isNotificationsHidden =
|
|
34
|
+
const isNotificationsHidden =
|
|
35
|
+
isFeatureHidden('notification', features) ||
|
|
36
|
+
hidden.includes('notifications');
|
|
30
37
|
|
|
31
38
|
return (
|
|
32
39
|
<>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
{!hidden.includes('refresh') && (
|
|
41
|
+
<Tooltip
|
|
42
|
+
container={getContainer()}
|
|
43
|
+
side="top"
|
|
44
|
+
content={i18n.t('Refresh')}>
|
|
45
|
+
<RefreshButton onClick={onClickRefresh} />
|
|
46
|
+
</Tooltip>
|
|
47
|
+
)}
|
|
39
48
|
|
|
40
49
|
{!isNotificationsHidden && (
|
|
41
50
|
<Popover
|
|
@@ -57,22 +66,26 @@ export function HomeButtons(props: HomeButtonsPropTypes) {
|
|
|
57
66
|
</div>
|
|
58
67
|
</Popover>
|
|
59
68
|
)}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
{!hidden.includes('settings') && (
|
|
70
|
+
<Tooltip
|
|
71
|
+
container={getContainer()}
|
|
72
|
+
side="top"
|
|
73
|
+
content={i18n.t('Settings')}>
|
|
74
|
+
<HeaderButton size="small" variant="ghost" onClick={onClickSettings}>
|
|
75
|
+
<SettingsIcon size={18} color="black" />
|
|
76
|
+
</HeaderButton>
|
|
77
|
+
</Tooltip>
|
|
78
|
+
)}
|
|
79
|
+
{!hidden.includes('history') && (
|
|
80
|
+
<Tooltip
|
|
81
|
+
container={getContainer()}
|
|
82
|
+
side="top"
|
|
83
|
+
content={i18n.t('Transactions History')}>
|
|
84
|
+
<HeaderButton size="small" variant="ghost" onClick={onClickHistory}>
|
|
85
|
+
<TransactionIcon size={18} color="black" />
|
|
86
|
+
</HeaderButton>
|
|
87
|
+
</Tooltip>
|
|
88
|
+
)}
|
|
76
89
|
</>
|
|
77
90
|
);
|
|
78
91
|
}
|
|
@@ -3,8 +3,9 @@ export interface PropTypes {
|
|
|
3
3
|
isConnected?: boolean;
|
|
4
4
|
container?: HTMLElement;
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface HeaderButtonsPropTypes {
|
|
7
|
+
onClickSettings?: () => void;
|
|
7
8
|
onClickRefresh?: () => void;
|
|
8
9
|
onClickHistory?: () => void;
|
|
9
|
-
|
|
10
|
+
hidden?: ('settings' | 'refresh' | 'history' | 'notifications')[];
|
|
10
11
|
}
|
|
@@ -101,7 +101,19 @@ function Layout(props: PropsWithChildren<PropTypes>) {
|
|
|
101
101
|
className={activeTheme()}
|
|
102
102
|
ref={containerRef}>
|
|
103
103
|
<Header
|
|
104
|
-
prefix={
|
|
104
|
+
prefix={
|
|
105
|
+
<>
|
|
106
|
+
{showBackButton && (
|
|
107
|
+
<BackButton
|
|
108
|
+
onClick={() => {
|
|
109
|
+
navigateBack();
|
|
110
|
+
// As an example, used in routes page to add a custom logic when navigating back to the home page.
|
|
111
|
+
header.onBack && header.onBack();
|
|
112
|
+
}}
|
|
113
|
+
/>
|
|
114
|
+
)}
|
|
115
|
+
</>
|
|
116
|
+
}
|
|
105
117
|
title={header.title}
|
|
106
118
|
suffix={
|
|
107
119
|
<>
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import * as Collapsible from '@radix-ui/react-collapsible';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
css,
|
|
5
|
+
darkTheme,
|
|
6
|
+
Image,
|
|
7
|
+
styled,
|
|
8
|
+
Typography,
|
|
9
|
+
} from '@rango-dev/ui';
|
|
3
10
|
|
|
4
11
|
import { CollapsibleContent } from '../CustomCollapsible/CustomCollapsible.styles';
|
|
5
12
|
|
|
@@ -13,31 +20,64 @@ export const QuoteContainer = styled(Collapsible.Root, {
|
|
|
13
20
|
overflowY: 'hidden',
|
|
14
21
|
width: '100%',
|
|
15
22
|
borderRadius: '$xm',
|
|
16
|
-
cursor: 'default',
|
|
17
23
|
variants: {
|
|
18
|
-
|
|
19
|
-
true: {
|
|
20
|
-
|
|
24
|
+
selected: {
|
|
25
|
+
true: {},
|
|
26
|
+
false: {
|
|
27
|
+
$$color: '$colors$neutral400',
|
|
21
28
|
[`.${darkTheme} &`]: {
|
|
22
|
-
$$color: '$colors$
|
|
29
|
+
$$color: '$colors$neutral200',
|
|
23
30
|
},
|
|
24
31
|
backgroundColor: '$$color',
|
|
25
32
|
},
|
|
26
|
-
|
|
33
|
+
},
|
|
34
|
+
listItem: {
|
|
35
|
+
true: {
|
|
27
36
|
$$color: '$colors$neutral400',
|
|
28
37
|
[`.${darkTheme} &`]: {
|
|
29
38
|
$$color: '$colors$neutral200',
|
|
30
39
|
},
|
|
31
40
|
backgroundColor: '$$color',
|
|
32
41
|
},
|
|
42
|
+
false: {},
|
|
33
43
|
},
|
|
34
44
|
},
|
|
45
|
+
|
|
46
|
+
compoundVariants: [
|
|
47
|
+
{
|
|
48
|
+
listItem: false,
|
|
49
|
+
selected: true,
|
|
50
|
+
css: {
|
|
51
|
+
$$color: '$colors$info300',
|
|
52
|
+
[`.${darkTheme} &`]: {
|
|
53
|
+
$$color: '$colors$secondary800',
|
|
54
|
+
},
|
|
55
|
+
backgroundColor: '$$color',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
listItem: true,
|
|
60
|
+
selected: false,
|
|
61
|
+
css: {
|
|
62
|
+
cursor: 'pointer',
|
|
63
|
+
'&:hover': {
|
|
64
|
+
backgroundColor: '$neutral300',
|
|
65
|
+
[`.${darkTheme} &`]: {
|
|
66
|
+
backgroundColor: '$neutral400',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
],
|
|
35
72
|
});
|
|
36
73
|
|
|
37
74
|
export const stepsDetailsStyles = css({
|
|
38
75
|
padding: '$10 $15',
|
|
39
76
|
});
|
|
40
|
-
|
|
77
|
+
export const AllRoutesButton = styled(Button, {
|
|
78
|
+
backgroundColor: 'transparent',
|
|
79
|
+
border: '1px solid $secondary',
|
|
80
|
+
});
|
|
41
81
|
export const SummaryContainer = styled('div', {
|
|
42
82
|
borderRadius: '$xm',
|
|
43
83
|
display: 'flex',
|
|
@@ -45,35 +85,35 @@ export const SummaryContainer = styled('div', {
|
|
|
45
85
|
alignItems: 'start',
|
|
46
86
|
justifyContent: 'space-between',
|
|
47
87
|
color: '$foreground',
|
|
48
|
-
cursor: 'pointer',
|
|
49
88
|
boxSizing: 'border-box',
|
|
50
89
|
position: 'relative',
|
|
51
90
|
variants: {
|
|
52
|
-
|
|
53
|
-
true: {
|
|
54
|
-
|
|
91
|
+
selected: {
|
|
92
|
+
true: {},
|
|
93
|
+
false: {
|
|
94
|
+
$$color: '$colors$neutral200',
|
|
55
95
|
[`.${darkTheme} &`]: {
|
|
56
|
-
$$color: '$colors$
|
|
96
|
+
$$color: '$colors$neutral500',
|
|
57
97
|
},
|
|
58
98
|
backgroundColor: '$$color',
|
|
59
|
-
'&:hover': {
|
|
60
|
-
backgroundColor: '$$color',
|
|
61
|
-
},
|
|
62
99
|
},
|
|
63
|
-
|
|
100
|
+
},
|
|
101
|
+
basic: { true: { borderTopRightRadius: '0', borderTopLeftRadius: '0' } },
|
|
102
|
+
listItem: {
|
|
103
|
+
true: {
|
|
64
104
|
$$color: '$colors$neutral200',
|
|
65
105
|
[`.${darkTheme} &`]: {
|
|
66
106
|
$$color: '$colors$neutral500',
|
|
67
107
|
},
|
|
68
108
|
backgroundColor: '$$color',
|
|
69
109
|
'&:hover': {
|
|
70
|
-
backgroundColor: '
|
|
110
|
+
backgroundColor: '$neutral300',
|
|
111
|
+
[`.${darkTheme} &`]: {
|
|
112
|
+
backgroundColor: '$neutral400',
|
|
113
|
+
},
|
|
71
114
|
},
|
|
115
|
+
cursor: 'pointer',
|
|
72
116
|
},
|
|
73
|
-
},
|
|
74
|
-
basic: { true: { borderTopRightRadius: '0', borderTopLeftRadius: '0' } },
|
|
75
|
-
listItem: {
|
|
76
|
-
true: {},
|
|
77
117
|
false: {},
|
|
78
118
|
},
|
|
79
119
|
},
|
|
@@ -81,27 +121,35 @@ export const SummaryContainer = styled('div', {
|
|
|
81
121
|
compoundVariants: [
|
|
82
122
|
{
|
|
83
123
|
listItem: true,
|
|
84
|
-
|
|
124
|
+
selected: true,
|
|
125
|
+
css: {
|
|
126
|
+
border: '1px solid $secondary',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
listItem: false,
|
|
131
|
+
selected: true,
|
|
85
132
|
css: {
|
|
133
|
+
$$color: '$colors$info100',
|
|
134
|
+
[`.${darkTheme} &`]: {
|
|
135
|
+
$$color: '$colors$secondary600',
|
|
136
|
+
},
|
|
137
|
+
backgroundColor: '$$color',
|
|
86
138
|
'&:hover': {
|
|
87
|
-
$$color: '$colors$secondary200',
|
|
88
|
-
[`.${darkTheme} &`]: {
|
|
89
|
-
$$color: '$colors$secondary700',
|
|
90
|
-
},
|
|
91
139
|
backgroundColor: '$$color',
|
|
92
140
|
},
|
|
93
141
|
},
|
|
94
142
|
},
|
|
95
143
|
{
|
|
96
144
|
listItem: true,
|
|
97
|
-
|
|
145
|
+
selected: false,
|
|
98
146
|
css: {
|
|
147
|
+
cursor: 'pointer',
|
|
99
148
|
'&:hover': {
|
|
100
|
-
|
|
149
|
+
backgroundColor: '$neutral300',
|
|
101
150
|
[`.${darkTheme} &`]: {
|
|
102
|
-
|
|
151
|
+
backgroundColor: '$neutral400',
|
|
103
152
|
},
|
|
104
|
-
backgroundColor: '$$color',
|
|
105
153
|
},
|
|
106
154
|
},
|
|
107
155
|
},
|
|
@@ -111,7 +159,15 @@ export const SummaryContainer = styled('div', {
|
|
|
111
159
|
export const summaryStyles = css({
|
|
112
160
|
width: '100%',
|
|
113
161
|
padding: '$15 $15 $10 $15',
|
|
114
|
-
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
export const summaryHeaderStyles = css({
|
|
165
|
+
display: 'flex',
|
|
166
|
+
flexDirection: 'row',
|
|
167
|
+
justifyContent: 'space-between',
|
|
168
|
+
alignItems: 'center',
|
|
169
|
+
paddingBottom: '$10',
|
|
170
|
+
position: 'relative',
|
|
115
171
|
});
|
|
116
172
|
|
|
117
173
|
export const rowStyles = css({
|
|
@@ -124,7 +180,6 @@ export const rowStyles = css({
|
|
|
124
180
|
},
|
|
125
181
|
});
|
|
126
182
|
export const basicInfoStyles = css({
|
|
127
|
-
paddingTop: '$10',
|
|
128
183
|
display: 'flex',
|
|
129
184
|
alignItems: 'center',
|
|
130
185
|
'.usd-value': {
|
|
@@ -163,23 +218,41 @@ export const Trigger = styled(Collapsible.Trigger, {
|
|
|
163
218
|
},
|
|
164
219
|
},
|
|
165
220
|
},
|
|
166
|
-
|
|
167
|
-
true: {
|
|
168
|
-
|
|
221
|
+
selected: {
|
|
222
|
+
true: {},
|
|
223
|
+
false: {
|
|
224
|
+
$$color: '$colors$neutral400',
|
|
169
225
|
[`.${darkTheme} &`]: {
|
|
170
|
-
$$color: '$colors$
|
|
226
|
+
$$color: '$colors$neutral200',
|
|
171
227
|
},
|
|
172
228
|
backgroundColor: '$$color',
|
|
173
229
|
},
|
|
174
|
-
|
|
230
|
+
},
|
|
231
|
+
listItem: {
|
|
232
|
+
true: {
|
|
175
233
|
$$color: '$colors$neutral400',
|
|
176
234
|
[`.${darkTheme} &`]: {
|
|
177
235
|
$$color: '$colors$neutral200',
|
|
178
236
|
},
|
|
179
237
|
backgroundColor: '$$color',
|
|
180
238
|
},
|
|
239
|
+
false: {},
|
|
181
240
|
},
|
|
182
241
|
},
|
|
242
|
+
|
|
243
|
+
compoundVariants: [
|
|
244
|
+
{
|
|
245
|
+
listItem: false,
|
|
246
|
+
selected: true,
|
|
247
|
+
css: {
|
|
248
|
+
$$color: '$colors$info300',
|
|
249
|
+
[`.${darkTheme} &`]: {
|
|
250
|
+
$$color: '$colors$secondary800',
|
|
251
|
+
},
|
|
252
|
+
backgroundColor: '$$color',
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
],
|
|
183
256
|
'.blockchains_section': {
|
|
184
257
|
display: 'none',
|
|
185
258
|
},
|
|
@@ -291,3 +364,25 @@ export const MoreStep = styled('div', {
|
|
|
291
364
|
},
|
|
292
365
|
},
|
|
293
366
|
});
|
|
367
|
+
|
|
368
|
+
export const Tag = styled('div', {
|
|
369
|
+
backgroundColor: '$neutral400',
|
|
370
|
+
borderRadius: '$xs',
|
|
371
|
+
padding: '$2 $5',
|
|
372
|
+
fontSize: '$10',
|
|
373
|
+
fontWeight: 400,
|
|
374
|
+
});
|
|
375
|
+
export const TagContainer = styled('div', {
|
|
376
|
+
display: 'flex',
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
export const Line = styled('div', {
|
|
380
|
+
width: '100%',
|
|
381
|
+
borderTopWidth: '1px',
|
|
382
|
+
borderTopStyle: 'solid',
|
|
383
|
+
borderTopColor: '$neutral',
|
|
384
|
+
margin: '$5 0',
|
|
385
|
+
[`.${darkTheme} &`]: {
|
|
386
|
+
borderTopColor: '$neutral400',
|
|
387
|
+
},
|
|
388
|
+
});
|