@lifi/widget 3.24.3 → 3.25.0-beta.1
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/esm/AppDefault.js +3 -3
- package/dist/esm/AppDefault.js.map +1 -1
- package/dist/esm/AppDrawer.style.d.ts +1 -1
- package/dist/esm/AppProvider.js +2 -2
- package/dist/esm/AppProvider.js.map +1 -1
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.js +1 -1
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.style.js +1 -1
- package/dist/esm/components/AmountInput/AmountInput.style.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.d.ts +1 -1
- package/dist/esm/components/AppContainer.js +6 -13
- package/dist/esm/components/AppContainer.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.style.js +1 -1
- package/dist/esm/components/Avatar/Avatar.style.js.map +1 -1
- package/dist/esm/components/ButtonTertiary.d.ts +1 -1
- package/dist/esm/components/Card/CardButton.style.js +1 -1
- package/dist/esm/components/Card/CardButton.style.js.map +1 -1
- package/dist/esm/components/Card/CardHeader.js +1 -1
- package/dist/esm/components/Card/CardHeader.js.map +1 -1
- package/dist/esm/components/Card/CardIconButton.d.ts +1 -1
- package/dist/esm/components/Card/CardLabel.js +1 -1
- package/dist/esm/components/Card/CardLabel.js.map +1 -1
- package/dist/esm/components/Card/CardTitle.js +1 -1
- package/dist/esm/components/Card/CardTitle.js.map +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.js +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.js.map +1 -1
- package/dist/esm/components/ChainSelect/useChainSelect.js +13 -2
- package/dist/esm/components/ChainSelect/useChainSelect.js.map +1 -1
- package/dist/esm/components/Chains/ChainList.d.ts +13 -0
- package/dist/esm/components/Chains/ChainList.js +17 -0
- package/dist/esm/components/Chains/ChainList.js.map +1 -0
- package/dist/esm/components/Chains/ChainList.style.d.ts +14 -0
- package/dist/esm/components/Chains/ChainList.style.js +38 -0
- package/dist/esm/components/Chains/ChainList.style.js.map +1 -0
- package/dist/esm/components/Chains/ChainListItem.d.ts +11 -0
- package/dist/esm/components/Chains/ChainListItem.js +11 -0
- package/dist/esm/components/Chains/ChainListItem.js.map +1 -0
- package/dist/esm/components/Chains/ChainSearchInput.d.ts +10 -0
- package/dist/esm/components/Chains/ChainSearchInput.js +19 -0
- package/dist/esm/components/Chains/ChainSearchInput.js.map +1 -0
- package/dist/esm/components/Chains/ChainsExpanded.d.ts +7 -0
- package/dist/esm/components/Chains/ChainsExpanded.js +11 -0
- package/dist/esm/components/Chains/ChainsExpanded.js.map +1 -0
- package/dist/esm/components/Chains/ChainsExpanded.style.d.ts +6 -0
- package/dist/esm/components/Chains/ChainsExpanded.style.js +16 -0
- package/dist/esm/components/Chains/ChainsExpanded.style.js.map +1 -0
- package/dist/esm/components/Chains/SelectChainContent.d.ts +9 -0
- package/dist/esm/components/Chains/SelectChainContent.js +60 -0
- package/dist/esm/components/Chains/SelectChainContent.js.map +1 -0
- package/dist/esm/components/Chains/VirtualizedChainList.d.ts +11 -0
- package/dist/esm/components/Chains/VirtualizedChainList.js +40 -0
- package/dist/esm/components/Chains/VirtualizedChainList.js.map +1 -0
- package/dist/esm/components/Expansion/Expansion.d.ts +1 -0
- package/dist/esm/components/Expansion/Expansion.js +41 -0
- package/dist/esm/components/Expansion/Expansion.js.map +1 -0
- package/dist/esm/components/Expansion/ExpansionTransition.d.ts +9 -0
- package/dist/esm/components/Expansion/ExpansionTransition.js +45 -0
- package/dist/esm/components/Expansion/ExpansionTransition.js.map +1 -0
- package/dist/esm/components/Header/Header.js +1 -1
- package/dist/esm/components/Header/Header.js.map +1 -1
- package/dist/esm/components/Header/Header.style.d.ts +1 -1
- package/dist/esm/components/Header/Header.style.js +0 -1
- package/dist/esm/components/Header/Header.style.js.map +1 -1
- package/dist/esm/components/Header/NavigationHeader.js +2 -2
- package/dist/esm/components/Header/NavigationHeader.js.map +1 -1
- package/dist/esm/components/Header/SettingsButton.style.d.ts +1 -1
- package/dist/esm/components/Header/SettingsButton.style.js +1 -1
- package/dist/esm/components/Header/SettingsButton.style.js.map +1 -1
- package/dist/esm/components/ListItem/ListItem.js +1 -1
- package/dist/esm/components/ListItem/ListItem.js.map +1 -1
- package/dist/esm/components/ListItemButton.js +13 -1
- package/dist/esm/components/ListItemButton.js.map +1 -1
- package/dist/esm/components/ListItemText.js +1 -1
- package/dist/esm/components/ListItemText.js.map +1 -1
- package/dist/esm/components/ProgressToNextUpdate.js +1 -1
- package/dist/esm/components/ProgressToNextUpdate.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteCard.js +4 -4
- package/dist/esm/components/RouteCard/RouteCard.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteCardEssentials.js +5 -5
- package/dist/esm/components/RouteCard/RouteCardEssentials.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteNotFoundCard.js +1 -0
- package/dist/esm/components/RouteCard/RouteNotFoundCard.js.map +1 -1
- package/dist/esm/components/RouteCard/getMatchingLabels.js +5 -3
- package/dist/esm/components/RouteCard/getMatchingLabels.js.map +1 -1
- package/dist/esm/components/Routes/Routes.js +1 -1
- package/dist/esm/components/Routes/Routes.js.map +1 -1
- package/dist/esm/components/Routes/RoutesContent.d.ts +14 -0
- package/dist/esm/components/Routes/RoutesContent.js +55 -0
- package/dist/esm/components/Routes/RoutesContent.js.map +1 -0
- package/dist/esm/components/Routes/RoutesExpanded.d.ts +7 -2
- package/dist/esm/components/Routes/RoutesExpanded.js +12 -70
- package/dist/esm/components/Routes/RoutesExpanded.js.map +1 -1
- package/dist/esm/components/Routes/RoutesExpanded.style.d.ts +1 -3
- package/dist/esm/components/Routes/RoutesExpanded.style.js +4 -16
- package/dist/esm/components/Routes/RoutesExpanded.style.js.map +1 -1
- package/dist/esm/components/Search/SearchInput.d.ts +5 -2
- package/dist/esm/components/Search/SearchInput.js +7 -3
- package/dist/esm/components/Search/SearchInput.js.map +1 -1
- package/dist/esm/components/Search/SearchInput.style.d.ts +4 -1
- package/dist/esm/components/Search/SearchInput.style.js +25 -3
- package/dist/esm/components/Search/SearchInput.style.js.map +1 -1
- package/dist/esm/components/Search/SearchNotFound.style.js +2 -1
- package/dist/esm/components/Search/SearchNotFound.style.js.map +1 -1
- package/dist/esm/components/Select.js +1 -1
- package/dist/esm/components/Select.js.map +1 -1
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js +1 -1
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js.map +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.js +2 -7
- package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.d.ts +2 -2
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.js +0 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.js.map +1 -1
- package/dist/esm/components/Step/CircularProgress.style.js +1 -1
- package/dist/esm/components/Step/CircularProgress.style.js.map +1 -1
- package/dist/esm/components/StepActions/StepActions.js +3 -3
- package/dist/esm/components/StepActions/StepActions.style.js +1 -1
- package/dist/esm/components/StepActions/StepActions.style.js.map +1 -1
- package/dist/esm/components/TextFitter/TextFitter.js +1 -1
- package/dist/esm/components/TextFitter/TextFitter.js.map +1 -1
- package/dist/esm/components/Token/Token.js +2 -2
- package/dist/esm/components/Token/Token.js.map +1 -1
- package/dist/esm/components/Token/Token.style.js +1 -1
- package/dist/esm/components/Token/Token.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheet.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.style.js +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenList.js +3 -3
- package/dist/esm/components/TokenList/TokenList.js.map +1 -1
- package/dist/esm/components/TokenList/TokenList.style.d.ts +2 -1
- package/dist/esm/components/TokenList/TokenList.style.js +6 -1
- package/dist/esm/components/TokenList/TokenList.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenListItem.js +16 -7
- package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
- package/dist/esm/components/TokenList/VirtualizedTokenList.js +13 -7
- package/dist/esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
- package/dist/esm/components/TokenList/types.d.ts +3 -0
- package/dist/esm/components/TokenRate/TokenRate.js +1 -1
- package/dist/esm/components/TokenRate/TokenRate.js.map +1 -1
- package/dist/esm/components/TokenRate/TokenRate.style.js +1 -1
- package/dist/esm/components/TokenRate/TokenRate.style.js.map +1 -1
- package/dist/esm/components/TransactionDetails.js +7 -9
- package/dist/esm/components/TransactionDetails.js.map +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/config/version.js.map +1 -1
- package/dist/esm/hooks/timer/time.js +1 -1
- package/dist/esm/hooks/timer/time.js.map +1 -1
- package/dist/esm/hooks/timer/useTimer.js.map +1 -1
- package/dist/esm/hooks/useAvailableChains.js +3 -2
- package/dist/esm/hooks/useAvailableChains.js.map +1 -1
- package/dist/esm/hooks/useChains.js +4 -4
- package/dist/esm/hooks/useChains.js.map +1 -1
- package/dist/esm/hooks/useExpansionRoutes.d.ts +2 -0
- package/dist/esm/hooks/useExpansionRoutes.js +26 -0
- package/dist/esm/hooks/useExpansionRoutes.js.map +1 -0
- package/dist/esm/hooks/useHasChainExpansion.d.ts +2 -0
- package/dist/esm/hooks/useHasChainExpansion.js +16 -0
- package/dist/esm/hooks/useHasChainExpansion.js.map +1 -0
- package/dist/esm/hooks/useIsBatchingSupported.js +4 -1
- package/dist/esm/hooks/useIsBatchingSupported.js.map +1 -1
- package/dist/esm/hooks/useListHeight.js +1 -1
- package/dist/esm/hooks/useListHeight.js.map +1 -1
- package/dist/esm/hooks/useRouteExecution.js +3 -3
- package/dist/esm/hooks/useRouteExecution.js.map +1 -1
- package/dist/esm/hooks/useRoutes.js +6 -3
- package/dist/esm/hooks/useRoutes.js.map +1 -1
- package/dist/esm/hooks/useToAddressReset.js +10 -2
- package/dist/esm/hooks/useToAddressReset.js.map +1 -1
- package/dist/esm/hooks/useTokenBalance.js.map +1 -1
- package/dist/esm/hooks/useTokenBalances.js +1 -0
- package/dist/esm/hooks/useTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useTokenSearch.js +6 -4
- package/dist/esm/hooks/useTokenSearch.js.map +1 -1
- package/dist/esm/hooks/useTokens.js +5 -3
- package/dist/esm/hooks/useTokens.js.map +1 -1
- package/dist/esm/hooks/useTools.js +5 -3
- package/dist/esm/hooks/useTools.js.map +1 -1
- package/dist/esm/hooks/useTransactionDetails.js.map +1 -1
- package/dist/esm/hooks/useWidgetEvents.js.map +1 -1
- package/dist/esm/i18n/bn.json +2 -1
- package/dist/esm/i18n/de.json +2 -1
- package/dist/esm/i18n/en.json +2 -1
- package/dist/esm/i18n/es.json +2 -1
- package/dist/esm/i18n/fr.json +2 -1
- package/dist/esm/i18n/hi.json +1 -0
- package/dist/esm/i18n/id.json +2 -1
- package/dist/esm/i18n/it.json +2 -1
- package/dist/esm/i18n/ja.json +2 -1
- package/dist/esm/i18n/ko.json +2 -1
- package/dist/esm/i18n/pl.json +350 -0
- package/dist/esm/i18n/pt.json +2 -1
- package/dist/esm/i18n/th.json +2 -1
- package/dist/esm/i18n/tr.json +2 -1
- package/dist/esm/i18n/uk.json +14 -13
- package/dist/esm/i18n/vi.json +2 -1
- package/dist/esm/i18n/zh.json +2 -1
- package/dist/esm/index.d.ts +8 -8
- package/dist/esm/index.js +8 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.js +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.js.map +1 -1
- package/dist/esm/pages/SelectChainPage/SelectChainPage.js +7 -33
- package/dist/esm/pages/SelectChainPage/SelectChainPage.js.map +1 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js +1 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js.map +1 -1
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.js +1 -1
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.js.map +1 -1
- package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js +20 -11
- package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/BookmarksPage.js +1 -1
- package/dist/esm/pages/SendToWallet/BookmarksPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.d.ts +2 -2
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.js +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.js +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +1 -3
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryPage.js +8 -5
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryPage.js.map +1 -1
- package/dist/esm/pages/TransactionPage/RouteTracker.js +2 -2
- package/dist/esm/pages/TransactionPage/RouteTracker.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js +4 -4
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js.map +1 -1
- package/dist/esm/providers/I18nProvider/I18nProvider.js +8 -4
- package/dist/esm/providers/I18nProvider/I18nProvider.js.map +1 -1
- package/dist/esm/providers/QueryClientProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/SDKProviders.js +1 -1
- package/dist/esm/providers/WalletProvider/SDKProviders.js.map +1 -1
- package/dist/esm/providers/WalletProvider/SuiBaseProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/SuiBaseProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/WalletProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/useExternalWalletProvider.js +1 -1
- package/dist/esm/stores/chains/ChainOrderStore.js +5 -3
- package/dist/esm/stores/chains/ChainOrderStore.js.map +1 -1
- package/dist/esm/stores/form/FormStore.js +1 -1
- package/dist/esm/stores/form/FormStore.js.map +1 -1
- package/dist/esm/stores/form/FormUpdater.js +21 -5
- package/dist/esm/stores/form/FormUpdater.js.map +1 -1
- package/dist/esm/stores/form/URLSearchParamsBuilder.js +1 -1
- package/dist/esm/stores/form/URLSearchParamsBuilder.js.map +1 -1
- package/dist/esm/stores/form/useFormRef.js.map +1 -1
- package/dist/esm/stores/routes/createRouteExecutionStore.js +1 -1
- package/dist/esm/stores/routes/createRouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/settings/useSettingsStore.js.map +1 -1
- package/dist/esm/types/widget.d.ts +25 -6
- package/dist/esm/types/widget.js +6 -0
- package/dist/esm/types/widget.js.map +1 -1
- package/dist/esm/utils/deepEqual.js +2 -2
- package/dist/esm/utils/deepEqual.js.map +1 -1
- package/dist/esm/utils/item.d.ts +5 -15
- package/dist/esm/utils/item.js +23 -19
- package/dist/esm/utils/item.js.map +1 -1
- package/dist/esm/utils/widgetSize.d.ts +3 -0
- package/dist/esm/utils/widgetSize.js +11 -0
- package/dist/esm/utils/widgetSize.js.map +1 -0
- package/package.json +7 -6
- package/package.json.tmp +12 -6
- package/src/AppDefault.tsx +3 -3
- package/src/AppProvider.tsx +2 -2
- package/src/components/ActiveTransactions/ActiveTransactions.style.ts +1 -1
- package/src/components/AmountInput/AmountInput.style.tsx +1 -1
- package/src/components/AppContainer.tsx +6 -14
- package/src/components/Avatar/Avatar.style.tsx +2 -2
- package/src/components/Card/CardButton.style.tsx +1 -1
- package/src/components/Card/CardHeader.tsx +1 -1
- package/src/components/Card/CardLabel.tsx +1 -1
- package/src/components/Card/CardTitle.tsx +1 -1
- package/src/components/ChainSelect/ChainSelect.tsx +1 -1
- package/src/components/ChainSelect/useChainSelect.ts +37 -23
- package/src/components/Chains/ChainList.style.tsx +59 -0
- package/src/components/Chains/ChainList.tsx +86 -0
- package/src/components/Chains/ChainListItem.tsx +52 -0
- package/src/components/Chains/ChainSearchInput.tsx +52 -0
- package/src/components/Chains/ChainsExpanded.style.tsx +21 -0
- package/src/components/Chains/ChainsExpanded.tsx +28 -0
- package/src/components/Chains/SelectChainContent.tsx +116 -0
- package/src/components/Chains/VirtualizedChainList.tsx +84 -0
- package/src/components/Expansion/Expansion.tsx +62 -0
- package/src/components/Expansion/ExpansionTransition.tsx +76 -0
- package/src/components/Header/Header.style.ts +0 -1
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/Header/NavigationHeader.tsx +2 -2
- package/src/components/Header/SettingsButton.style.tsx +1 -1
- package/src/components/ListItem/ListItem.tsx +1 -1
- package/src/components/ListItemButton.tsx +17 -1
- package/src/components/ListItemText.tsx +1 -1
- package/src/components/ProgressToNextUpdate.tsx +1 -1
- package/src/components/RouteCard/RouteCard.tsx +4 -4
- package/src/components/RouteCard/RouteCardEssentials.tsx +5 -5
- package/src/components/RouteCard/RouteNotFoundCard.tsx +1 -0
- package/src/components/RouteCard/getMatchingLabels.ts +11 -3
- package/src/components/Routes/Routes.tsx +1 -1
- package/src/components/Routes/RoutesContent.tsx +137 -0
- package/src/components/Routes/RoutesExpanded.style.ts +4 -18
- package/src/components/Routes/RoutesExpanded.tsx +33 -158
- package/src/components/Search/SearchInput.style.tsx +36 -3
- package/src/components/Search/SearchInput.tsx +31 -5
- package/src/components/Search/SearchNotFound.style.tsx +2 -1
- package/src/components/Select.tsx +1 -1
- package/src/components/SelectTokenButton/SelectTokenButton.style.tsx +1 -1
- package/src/components/SendToWallet/SendToWalletButton.tsx +2 -3
- package/src/components/Skeleton/WidgetSkeleton.style.tsx +0 -1
- package/src/components/Step/CircularProgress.style.tsx +1 -1
- package/src/components/StepActions/StepActions.style.tsx +1 -1
- package/src/components/StepActions/StepActions.tsx +3 -3
- package/src/components/TextFitter/TextFitter.tsx +1 -1
- package/src/components/Token/Token.style.tsx +1 -1
- package/src/components/Token/Token.tsx +2 -2
- package/src/components/TokenList/TokenDetailsSheet.tsx +1 -0
- package/src/components/TokenList/TokenDetailsSheetContent.style.tsx +1 -1
- package/src/components/TokenList/TokenDetailsSheetContent.tsx +1 -1
- package/src/components/TokenList/TokenList.style.tsx +11 -1
- package/src/components/TokenList/TokenList.tsx +6 -2
- package/src/components/TokenList/TokenListItem.tsx +53 -37
- package/src/components/TokenList/VirtualizedTokenList.tsx +17 -5
- package/src/components/TokenList/types.ts +3 -0
- package/src/components/TokenRate/TokenRate.style.ts +1 -1
- package/src/components/TokenRate/TokenRate.tsx +1 -1
- package/src/components/TransactionDetails.tsx +9 -9
- package/src/config/version.ts +1 -1
- package/src/hooks/timer/time.ts +1 -1
- package/src/hooks/timer/useTimer.ts +1 -1
- package/src/hooks/useAvailableChains.ts +8 -2
- package/src/hooks/useChains.ts +10 -4
- package/src/hooks/useExpansionRoutes.ts +29 -0
- package/src/hooks/useHasChainExpansion.ts +19 -0
- package/src/hooks/useIsBatchingSupported.ts +5 -2
- package/src/hooks/useListHeight.ts +1 -1
- package/src/hooks/useRouteExecution.ts +3 -3
- package/src/hooks/useRoutes.ts +8 -2
- package/src/hooks/useToAddressReset.ts +32 -21
- package/src/hooks/useTokenBalance.ts +1 -1
- package/src/hooks/useTokenBalances.ts +1 -0
- package/src/hooks/useTokenSearch.ts +23 -6
- package/src/hooks/useTokens.ts +16 -6
- package/src/hooks/useTools.ts +12 -4
- package/src/hooks/useTransactionDetails.ts +1 -1
- package/src/hooks/useWidgetEvents.ts +1 -0
- package/src/i18n/bn.json +2 -1
- package/src/i18n/de.json +2 -1
- package/src/i18n/en.json +2 -1
- package/src/i18n/es.json +2 -1
- package/src/i18n/fr.json +2 -1
- package/src/i18n/hi.json +1 -0
- package/src/i18n/id.json +2 -1
- package/src/i18n/it.json +2 -1
- package/src/i18n/ja.json +2 -1
- package/src/i18n/ko.json +2 -1
- package/src/i18n/pl.json +350 -0
- package/src/i18n/pt.json +2 -1
- package/src/i18n/th.json +2 -1
- package/src/i18n/tr.json +2 -1
- package/src/i18n/uk.json +14 -13
- package/src/i18n/vi.json +2 -1
- package/src/i18n/zh.json +2 -1
- package/src/index.ts +8 -8
- package/src/pages/RoutesPage/RoutesPage.tsx +1 -1
- package/src/pages/SelectChainPage/SelectChainPage.tsx +18 -71
- package/src/pages/SelectEnabledToolsPage.tsx +1 -1
- package/src/pages/SelectTokenPage/SearchTokenInput.tsx +2 -0
- package/src/pages/SelectTokenPage/SelectTokenPage.tsx +44 -22
- package/src/pages/SendToWallet/BookmarksPage.tsx +1 -1
- package/src/pages/SendToWallet/SendToWalletPage.style.tsx +3 -3
- package/src/pages/SettingsPage/SettingsCard/SettingCard.style.tsx +1 -1
- package/src/pages/SettingsPage/SettingsCard/SettingCardExpandable.tsx +1 -1
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +1 -1
- package/src/pages/TransactionHistoryPage/TransactionHistoryPage.tsx +12 -7
- package/src/pages/TransactionPage/RouteTracker.tsx +2 -2
- package/src/pages/TransactionPage/TokenValueBottomSheet.tsx +4 -4
- package/src/providers/I18nProvider/I18nProvider.tsx +10 -4
- package/src/providers/QueryClientProvider.tsx +1 -1
- package/src/providers/WalletProvider/SDKProviders.tsx +1 -1
- package/src/providers/WalletProvider/SuiBaseProvider.tsx +1 -1
- package/src/providers/WalletProvider/WalletProvider.tsx +1 -1
- package/src/providers/WalletProvider/useExternalWalletProvider.ts +1 -1
- package/src/stores/chains/ChainOrderStore.tsx +8 -3
- package/src/stores/form/FormStore.tsx +1 -1
- package/src/stores/form/FormUpdater.tsx +40 -6
- package/src/stores/form/URLSearchParamsBuilder.tsx +1 -1
- package/src/stores/form/useFormRef.ts +50 -54
- package/src/stores/routes/createRouteExecutionStore.ts +1 -1
- package/src/stores/settings/useSettingsStore.ts +1 -0
- package/src/types/widget.ts +29 -6
- package/src/utils/deepEqual.ts +2 -2
- package/src/utils/item.ts +46 -40
- package/src/utils/widgetSize.ts +17 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TokenAmount } from '@lifi/sdk'
|
|
2
|
-
import {
|
|
2
|
+
import { isRelayerStep } from '@lifi/sdk'
|
|
3
3
|
import ExpandLess from '@mui/icons-material/ExpandLess'
|
|
4
4
|
import ExpandMore from '@mui/icons-material/ExpandMore'
|
|
5
5
|
import { Box, Collapse } from '@mui/material'
|
|
@@ -14,10 +14,10 @@ import { CardIconButton } from '../Card/CardIconButton.js'
|
|
|
14
14
|
import { CardLabel, CardLabelTypography } from '../Card/CardLabel.js'
|
|
15
15
|
import { StepActions } from '../StepActions/StepActions.js'
|
|
16
16
|
import { Token } from '../Token/Token.js'
|
|
17
|
+
import { getMatchingLabels } from './getMatchingLabels.js'
|
|
17
18
|
import { TokenContainer } from './RouteCard.style.js'
|
|
18
19
|
import { RouteCardEssentials } from './RouteCardEssentials.js'
|
|
19
20
|
import { RouteCardEssentialsExpanded } from './RouteCardEssentialsExpanded.js'
|
|
20
|
-
import { getMatchingLabels } from './getMatchingLabels.js'
|
|
21
21
|
import type { RouteCardProps } from './types.js'
|
|
22
22
|
|
|
23
23
|
export const RouteCard: React.FC<
|
|
@@ -53,8 +53,8 @@ export const RouteCard: React.FC<
|
|
|
53
53
|
(tag) => tag === 'CHEAPEST' || tag === 'FASTEST'
|
|
54
54
|
)
|
|
55
55
|
const tags: string[] = mainTag ? [mainTag] : []
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
56
|
+
const hasRelayerSupport = route.steps.every(isRelayerStep)
|
|
57
|
+
if (hasRelayerSupport) {
|
|
58
58
|
tags.push('GASLESS')
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isRelayerStep } from '@lifi/sdk'
|
|
2
2
|
import AccessTimeFilled from '@mui/icons-material/AccessTimeFilled'
|
|
3
3
|
import LocalGasStationRounded from '@mui/icons-material/LocalGasStationRounded'
|
|
4
4
|
import { Box, Tooltip, Typography } from '@mui/material'
|
|
@@ -22,7 +22,7 @@ export const RouteCardEssentials: React.FC<RouteCardEssentialsProps> = ({
|
|
|
22
22
|
)
|
|
23
23
|
const { gasCosts, feeCosts, combinedFeesUSD } =
|
|
24
24
|
getAccumulatedFeeCostsBreakdown(route)
|
|
25
|
-
const
|
|
25
|
+
const hasRelayerSupport = route.steps.every(isRelayerStep)
|
|
26
26
|
return (
|
|
27
27
|
<Box
|
|
28
28
|
sx={{
|
|
@@ -43,7 +43,7 @@ export const RouteCardEssentials: React.FC<RouteCardEssentialsProps> = ({
|
|
|
43
43
|
<FeeBreakdownTooltip
|
|
44
44
|
gasCosts={gasCosts}
|
|
45
45
|
feeCosts={feeCosts}
|
|
46
|
-
relayerSupport={
|
|
46
|
+
relayerSupport={hasRelayerSupport}
|
|
47
47
|
>
|
|
48
48
|
<Box
|
|
49
49
|
sx={{
|
|
@@ -56,7 +56,7 @@ export const RouteCardEssentials: React.FC<RouteCardEssentialsProps> = ({
|
|
|
56
56
|
<LocalGasStationRounded fontSize="inherit" />
|
|
57
57
|
</IconTypography>
|
|
58
58
|
<Typography
|
|
59
|
-
data-value={
|
|
59
|
+
data-value={hasRelayerSupport ? 0 : combinedFeesUSD}
|
|
60
60
|
sx={{
|
|
61
61
|
fontSize: 14,
|
|
62
62
|
color: 'text.primary',
|
|
@@ -64,7 +64,7 @@ export const RouteCardEssentials: React.FC<RouteCardEssentialsProps> = ({
|
|
|
64
64
|
lineHeight: 1,
|
|
65
65
|
}}
|
|
66
66
|
>
|
|
67
|
-
{
|
|
67
|
+
{hasRelayerSupport
|
|
68
68
|
? t('main.fees.free')
|
|
69
69
|
: t('format.currency', {
|
|
70
70
|
value: combinedFeesUSD,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Route } from '@lifi/sdk'
|
|
2
2
|
import type { RouteLabel, RouteLabelRule } from '../../types/widget.js'
|
|
3
|
-
import {
|
|
3
|
+
import { getConfigItemSets, isItemAllowedForSets } from '../../utils/item.js'
|
|
4
4
|
|
|
5
5
|
export const getMatchingLabels = (
|
|
6
6
|
route: Route,
|
|
@@ -19,11 +19,19 @@ export const getMatchingLabels = (
|
|
|
19
19
|
const toolNames = route.steps.flatMap((step) =>
|
|
20
20
|
step.includedSteps.map((s) => s.tool)
|
|
21
21
|
)
|
|
22
|
+
const bridgesConfigSets = getConfigItemSets(
|
|
23
|
+
rule.bridges,
|
|
24
|
+
(bridges) => new Set(bridges)
|
|
25
|
+
)
|
|
26
|
+
const exchangesConfigSets = getConfigItemSets(
|
|
27
|
+
rule.exchanges,
|
|
28
|
+
(exchanges) => new Set(exchanges)
|
|
29
|
+
)
|
|
22
30
|
conditions.push(
|
|
23
31
|
toolNames.some(
|
|
24
32
|
(toolName) =>
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
isItemAllowedForSets(toolName, bridgesConfigSets) &&
|
|
34
|
+
isItemAllowedForSets(toolName, exchangesConfigSets)
|
|
27
35
|
)
|
|
28
36
|
)
|
|
29
37
|
}
|
|
@@ -54,7 +54,7 @@ export const Routes: React.FC<CardProps> = (props) => {
|
|
|
54
54
|
<Card {...props}>
|
|
55
55
|
<CardTitle>{title}</CardTitle>
|
|
56
56
|
<ProgressToNextUpdate
|
|
57
|
-
updatedAt={dataUpdatedAt ||
|
|
57
|
+
updatedAt={dataUpdatedAt || Date.now()}
|
|
58
58
|
timeToUpdate={refetchTime}
|
|
59
59
|
isLoading={isFetching}
|
|
60
60
|
onClick={() => refetch()}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type { ExtendedChain, Route } from '@lifi/sdk'
|
|
2
|
+
import { useAccount } from '@lifi/wallet-management'
|
|
3
|
+
import { Stack, Typography } from '@mui/material'
|
|
4
|
+
import { useEffect } from 'react'
|
|
5
|
+
import { useTranslation } from 'react-i18next'
|
|
6
|
+
import { useNavigate } from 'react-router-dom'
|
|
7
|
+
import { useToAddressRequirements } from '../../hooks/useToAddressRequirements.js'
|
|
8
|
+
import { useWidgetEvents } from '../../hooks/useWidgetEvents.js'
|
|
9
|
+
import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'
|
|
10
|
+
import { useFieldValues } from '../../stores/form/useFieldValues.js'
|
|
11
|
+
import { WidgetEvent } from '../../types/events.js'
|
|
12
|
+
import { navigationRoutes } from '../../utils/navigationRoutes.js'
|
|
13
|
+
import { PageContainer } from '../PageContainer.js'
|
|
14
|
+
import { ProgressToNextUpdate } from '../ProgressToNextUpdate.js'
|
|
15
|
+
import { RouteCard } from '../RouteCard/RouteCard.js'
|
|
16
|
+
import { RouteCardSkeleton } from '../RouteCard/RouteCardSkeleton.js'
|
|
17
|
+
import { RouteNotFoundCard } from '../RouteCard/RouteNotFoundCard.js'
|
|
18
|
+
import {
|
|
19
|
+
Container,
|
|
20
|
+
Header,
|
|
21
|
+
ScrollableContainer,
|
|
22
|
+
} from './RoutesExpanded.style.js'
|
|
23
|
+
|
|
24
|
+
interface RoutesContentProps {
|
|
25
|
+
routes: Route[]
|
|
26
|
+
isFetching: boolean
|
|
27
|
+
isLoading: boolean
|
|
28
|
+
expanded: boolean
|
|
29
|
+
setReviewableRoute: (route: Route) => void
|
|
30
|
+
dataUpdatedAt: number
|
|
31
|
+
refetchTime: number
|
|
32
|
+
fromChain: ExtendedChain | undefined
|
|
33
|
+
refetch: () => void
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const RoutesContent = ({
|
|
37
|
+
routes,
|
|
38
|
+
isFetching,
|
|
39
|
+
isLoading,
|
|
40
|
+
expanded,
|
|
41
|
+
setReviewableRoute,
|
|
42
|
+
dataUpdatedAt,
|
|
43
|
+
refetchTime,
|
|
44
|
+
fromChain,
|
|
45
|
+
refetch,
|
|
46
|
+
}: RoutesContentProps) => {
|
|
47
|
+
const { t } = useTranslation()
|
|
48
|
+
|
|
49
|
+
const navigate = useNavigate()
|
|
50
|
+
const { subvariant, subvariantOptions } = useWidgetConfig()
|
|
51
|
+
|
|
52
|
+
const { account } = useAccount({ chainType: fromChain?.chainType })
|
|
53
|
+
const [toAddress] = useFieldValues('toAddress')
|
|
54
|
+
const { requiredToAddress } = useToAddressRequirements()
|
|
55
|
+
|
|
56
|
+
const emitter = useWidgetEvents()
|
|
57
|
+
|
|
58
|
+
const handleRouteClick = (route: Route) => {
|
|
59
|
+
setReviewableRoute(route)
|
|
60
|
+
navigate(navigationRoutes.transactionExecution, {
|
|
61
|
+
state: { routeId: route.id },
|
|
62
|
+
})
|
|
63
|
+
emitter.emit(WidgetEvent.RouteSelected, { route, routes: routes! })
|
|
64
|
+
}
|
|
65
|
+
const currentRoute = routes?.[0]
|
|
66
|
+
|
|
67
|
+
const routeNotFound = !currentRoute && !isLoading && !isFetching && expanded
|
|
68
|
+
const toAddressUnsatisfied = currentRoute && requiredToAddress && !toAddress
|
|
69
|
+
const allowInteraction = account.isConnected && !toAddressUnsatisfied
|
|
70
|
+
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
emitter.emit(WidgetEvent.WidgetExpanded, expanded)
|
|
73
|
+
}, [emitter, expanded])
|
|
74
|
+
|
|
75
|
+
const title =
|
|
76
|
+
subvariant === 'custom'
|
|
77
|
+
? subvariantOptions?.custom === 'deposit'
|
|
78
|
+
? t('header.deposit')
|
|
79
|
+
: t('header.youPay')
|
|
80
|
+
: t('header.receive')
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<Container enableColorScheme minimumHeight={isLoading}>
|
|
84
|
+
<ScrollableContainer>
|
|
85
|
+
<Header>
|
|
86
|
+
<Typography
|
|
87
|
+
noWrap
|
|
88
|
+
sx={{
|
|
89
|
+
fontSize: 18,
|
|
90
|
+
fontWeight: '700',
|
|
91
|
+
flex: 1,
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
{title}
|
|
95
|
+
</Typography>
|
|
96
|
+
<ProgressToNextUpdate
|
|
97
|
+
updatedAt={dataUpdatedAt || Date.now()}
|
|
98
|
+
timeToUpdate={refetchTime}
|
|
99
|
+
isLoading={isFetching}
|
|
100
|
+
onClick={() => refetch()}
|
|
101
|
+
sx={{ marginRight: -1 }}
|
|
102
|
+
/>
|
|
103
|
+
</Header>
|
|
104
|
+
<PageContainer>
|
|
105
|
+
<Stack
|
|
106
|
+
direction="column"
|
|
107
|
+
spacing={2}
|
|
108
|
+
sx={{
|
|
109
|
+
flex: 1,
|
|
110
|
+
paddingBottom: 3,
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
{routeNotFound ? (
|
|
114
|
+
<RouteNotFoundCard />
|
|
115
|
+
) : (isLoading || isFetching) && !routes?.length ? (
|
|
116
|
+
Array.from({ length: 3 }).map((_, index) => (
|
|
117
|
+
<RouteCardSkeleton key={index} />
|
|
118
|
+
))
|
|
119
|
+
) : (
|
|
120
|
+
routes?.map((route: Route, index: number) => (
|
|
121
|
+
<RouteCard
|
|
122
|
+
key={index}
|
|
123
|
+
route={route}
|
|
124
|
+
onClick={
|
|
125
|
+
allowInteraction ? () => handleRouteClick(route) : undefined
|
|
126
|
+
}
|
|
127
|
+
active={index === 0}
|
|
128
|
+
expanded={routes?.length === 1}
|
|
129
|
+
/>
|
|
130
|
+
))
|
|
131
|
+
)}
|
|
132
|
+
</Stack>
|
|
133
|
+
</PageContainer>
|
|
134
|
+
</ScrollableContainer>
|
|
135
|
+
</Container>
|
|
136
|
+
)
|
|
137
|
+
}
|
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import type { ScopedCssBaselineProps } from '@mui/material'
|
|
2
|
-
import { Box,
|
|
2
|
+
import { Box, ScopedCssBaseline, styled } from '@mui/material'
|
|
3
3
|
import { defaultMaxHeight } from '../../config/constants.js'
|
|
4
4
|
|
|
5
|
-
export const
|
|
6
|
-
zIndex: 0,
|
|
7
|
-
...(theme.container.display === 'flex'
|
|
8
|
-
? { display: 'flex', maxHeight: '100%' }
|
|
9
|
-
: { height: 'auto' }),
|
|
10
|
-
}))
|
|
11
|
-
|
|
12
|
-
export const RoutesExpandedCollapse = styled(Collapse)(({ theme }) => ({
|
|
13
|
-
...(theme.container?.display === 'flex' ? { height: '100%' } : {}),
|
|
14
|
-
}))
|
|
15
|
-
|
|
16
|
-
export const RouteTopLevelGrow = styled(Grow)(({ theme }) => ({
|
|
17
|
-
...(theme.container?.display === 'flex' ? { height: '100%' } : {}),
|
|
18
|
-
}))
|
|
5
|
+
export const routesExpansionWidth = '436px'
|
|
19
6
|
|
|
20
7
|
export const ScrollableContainer = styled(Box)({
|
|
21
8
|
overflowY: 'auto',
|
|
@@ -35,10 +22,10 @@ export const Container = styled(ScopedCssBaseline, {
|
|
|
35
22
|
})<ContainerProps>(({ theme, minimumHeight }) => ({
|
|
36
23
|
backgroundColor: theme.vars.palette.background.default,
|
|
37
24
|
overflow: 'auto',
|
|
38
|
-
width:
|
|
39
|
-
marginLeft: theme.spacing(3),
|
|
25
|
+
width: routesExpansionWidth,
|
|
40
26
|
display: 'flex',
|
|
41
27
|
flexDirection: 'column',
|
|
28
|
+
whiteSpace: 'normal',
|
|
42
29
|
...(theme.container?.display !== 'flex'
|
|
43
30
|
? {
|
|
44
31
|
maxHeight:
|
|
@@ -53,7 +40,6 @@ export const Container = styled(ScopedCssBaseline, {
|
|
|
53
40
|
|
|
54
41
|
export const Header = styled(Box)(({ theme }) => ({
|
|
55
42
|
backgroundColor: theme.vars.palette.background.default,
|
|
56
|
-
backdropFilter: 'blur(12px)',
|
|
57
43
|
display: 'flex',
|
|
58
44
|
justifyContent: 'space-between',
|
|
59
45
|
alignItems: 'center',
|
|
@@ -1,72 +1,22 @@
|
|
|
1
1
|
import type { Route } from '@lifi/sdk'
|
|
2
|
-
import {
|
|
3
|
-
import { Collapse, Grow, Stack, Typography } from '@mui/material'
|
|
4
|
-
import { type PropsWithChildren, useEffect, useRef } from 'react'
|
|
5
|
-
import { useTranslation } from 'react-i18next'
|
|
6
|
-
import type { RouteObject } from 'react-router-dom'
|
|
7
|
-
import { useRoutes as useDOMRoutes, useNavigate } from 'react-router-dom'
|
|
2
|
+
import { useEffect, useRef } from 'react'
|
|
8
3
|
import { useRoutes } from '../../hooks/useRoutes.js'
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { WidgetEvent } from '../../types/events.js'
|
|
14
|
-
import { navigationRoutes } from '../../utils/navigationRoutes.js'
|
|
15
|
-
import { PageContainer } from '../PageContainer.js'
|
|
16
|
-
import { ProgressToNextUpdate } from '../ProgressToNextUpdate.js'
|
|
17
|
-
import { RouteCard } from '../RouteCard/RouteCard.js'
|
|
18
|
-
import { RouteCardSkeleton } from '../RouteCard/RouteCardSkeleton.js'
|
|
19
|
-
import { RouteNotFoundCard } from '../RouteCard/RouteNotFoundCard.js'
|
|
20
|
-
import {
|
|
21
|
-
CollapseContainer,
|
|
22
|
-
Container,
|
|
23
|
-
Header,
|
|
24
|
-
RouteTopLevelGrow,
|
|
25
|
-
RoutesExpandedCollapse,
|
|
26
|
-
ScrollableContainer,
|
|
27
|
-
} from './RoutesExpanded.style.js'
|
|
4
|
+
import { ExpansionType } from '../../types/widget.js'
|
|
5
|
+
import { ExpansionTransition } from '../Expansion/ExpansionTransition.js'
|
|
6
|
+
import { RoutesContent } from './RoutesContent.js'
|
|
7
|
+
import { routesExpansionWidth } from './RoutesExpanded.style.js'
|
|
28
8
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{
|
|
33
|
-
path: '/',
|
|
34
|
-
element: true,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
path: '*',
|
|
38
|
-
element: null,
|
|
39
|
-
},
|
|
40
|
-
]
|
|
41
|
-
|
|
42
|
-
export const RoutesExpanded = () => {
|
|
43
|
-
const element = useDOMRoutes(routes)
|
|
44
|
-
const match = Boolean((element?.props as PropsWithChildren)?.children)
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<CollapseContainer>
|
|
48
|
-
<Collapse timeout={timeout} in={match} orientation="horizontal">
|
|
49
|
-
<RouteTopLevelGrow
|
|
50
|
-
timeout={timeout}
|
|
51
|
-
in={match}
|
|
52
|
-
mountOnEnter
|
|
53
|
-
unmountOnExit
|
|
54
|
-
>
|
|
55
|
-
<div>
|
|
56
|
-
<RoutesExpandedElement />
|
|
57
|
-
</div>
|
|
58
|
-
</RouteTopLevelGrow>
|
|
59
|
-
</Collapse>
|
|
60
|
-
</CollapseContainer>
|
|
61
|
-
)
|
|
9
|
+
interface RoutesExpandedProps {
|
|
10
|
+
expansionType: ExpansionType
|
|
11
|
+
setOpenExpansion: (open: boolean) => void
|
|
62
12
|
}
|
|
63
13
|
|
|
64
|
-
export const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
14
|
+
export const RoutesExpanded = ({
|
|
15
|
+
expansionType,
|
|
16
|
+
setOpenExpansion,
|
|
17
|
+
}: RoutesExpandedProps) => {
|
|
68
18
|
const routesRef = useRef<Route[]>(undefined)
|
|
69
|
-
|
|
19
|
+
|
|
70
20
|
const routesActiveRef = useRef(false)
|
|
71
21
|
const {
|
|
72
22
|
routes,
|
|
@@ -79,17 +29,6 @@ export const RoutesExpandedElement = () => {
|
|
|
79
29
|
refetch,
|
|
80
30
|
setReviewableRoute,
|
|
81
31
|
} = useRoutes()
|
|
82
|
-
const { account } = useAccount({ chainType: fromChain?.chainType })
|
|
83
|
-
const [toAddress] = useFieldValues('toAddress')
|
|
84
|
-
const { requiredToAddress } = useToAddressRequirements()
|
|
85
|
-
|
|
86
|
-
const handleRouteClick = (route: Route) => {
|
|
87
|
-
setReviewableRoute(route)
|
|
88
|
-
navigate(navigationRoutes.transactionExecution, {
|
|
89
|
-
state: { routeId: route.id },
|
|
90
|
-
})
|
|
91
|
-
emitter.emit(WidgetEvent.RouteSelected, { route, routes: routes! })
|
|
92
|
-
}
|
|
93
32
|
|
|
94
33
|
const onExit = () => {
|
|
95
34
|
// Clean routes cache on exit
|
|
@@ -104,96 +43,32 @@ export const RoutesExpandedElement = () => {
|
|
|
104
43
|
routesActiveRef.current = Boolean(routes)
|
|
105
44
|
}
|
|
106
45
|
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
routesActiveRef.current || isLoading || isFetching || isFetched
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
const routeNotFound = !currentRoute && !isLoading && !isFetching && expanded
|
|
114
|
-
const toAddressUnsatisfied = currentRoute && requiredToAddress && !toAddress
|
|
115
|
-
const allowInteraction = account.isConnected && !toAddressUnsatisfied
|
|
46
|
+
const expanded =
|
|
47
|
+
Boolean(routesActiveRef.current || isLoading || isFetching || isFetched) &&
|
|
48
|
+
expansionType === ExpansionType.Routes
|
|
116
49
|
|
|
117
50
|
useEffect(() => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const title =
|
|
122
|
-
subvariant === 'custom'
|
|
123
|
-
? subvariantOptions?.custom === 'deposit'
|
|
124
|
-
? t('header.deposit')
|
|
125
|
-
: t('header.youPay')
|
|
126
|
-
: t('header.receive')
|
|
51
|
+
// To update parent's width when expansion changes
|
|
52
|
+
setOpenExpansion(expanded)
|
|
53
|
+
}, [expanded, setOpenExpansion])
|
|
127
54
|
|
|
128
55
|
return (
|
|
129
|
-
<
|
|
130
|
-
timeout={timeout.enter as number}
|
|
56
|
+
<ExpansionTransition
|
|
131
57
|
in={expanded}
|
|
132
|
-
|
|
58
|
+
width={routesExpansionWidth}
|
|
133
59
|
onExited={onExit}
|
|
134
60
|
>
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
fontSize: 18,
|
|
148
|
-
fontWeight: '700',
|
|
149
|
-
flex: 1,
|
|
150
|
-
}}
|
|
151
|
-
>
|
|
152
|
-
{title}
|
|
153
|
-
</Typography>
|
|
154
|
-
<ProgressToNextUpdate
|
|
155
|
-
updatedAt={dataUpdatedAt || new Date().getTime()}
|
|
156
|
-
timeToUpdate={refetchTime}
|
|
157
|
-
isLoading={isFetching}
|
|
158
|
-
onClick={() => refetch()}
|
|
159
|
-
sx={{ marginRight: -1 }}
|
|
160
|
-
/>
|
|
161
|
-
</Header>
|
|
162
|
-
<PageContainer>
|
|
163
|
-
<Stack
|
|
164
|
-
direction="column"
|
|
165
|
-
spacing={2}
|
|
166
|
-
sx={{
|
|
167
|
-
flex: 1,
|
|
168
|
-
paddingBottom: 3,
|
|
169
|
-
}}
|
|
170
|
-
>
|
|
171
|
-
{routeNotFound ? (
|
|
172
|
-
<RouteNotFoundCard />
|
|
173
|
-
) : (isLoading || isFetching) && !routesRef.current?.length ? (
|
|
174
|
-
Array.from({ length: 3 }).map((_, index) => (
|
|
175
|
-
<RouteCardSkeleton key={index} />
|
|
176
|
-
))
|
|
177
|
-
) : (
|
|
178
|
-
routesRef.current?.map((route: Route, index: number) => (
|
|
179
|
-
<RouteCard
|
|
180
|
-
key={index}
|
|
181
|
-
route={route}
|
|
182
|
-
onClick={
|
|
183
|
-
allowInteraction
|
|
184
|
-
? () => handleRouteClick(route)
|
|
185
|
-
: undefined
|
|
186
|
-
}
|
|
187
|
-
active={index === 0}
|
|
188
|
-
expanded={routesRef.current?.length === 1}
|
|
189
|
-
/>
|
|
190
|
-
))
|
|
191
|
-
)}
|
|
192
|
-
</Stack>
|
|
193
|
-
</PageContainer>
|
|
194
|
-
</ScrollableContainer>
|
|
195
|
-
</Container>
|
|
196
|
-
</Grow>
|
|
197
|
-
</RoutesExpandedCollapse>
|
|
61
|
+
<RoutesContent
|
|
62
|
+
routes={routesRef.current || []}
|
|
63
|
+
isFetching={isFetching}
|
|
64
|
+
isLoading={isLoading}
|
|
65
|
+
expanded={expanded}
|
|
66
|
+
setReviewableRoute={setReviewableRoute}
|
|
67
|
+
dataUpdatedAt={dataUpdatedAt}
|
|
68
|
+
refetchTime={refetchTime}
|
|
69
|
+
fromChain={fromChain}
|
|
70
|
+
refetch={refetch}
|
|
71
|
+
/>
|
|
72
|
+
</ExpansionTransition>
|
|
198
73
|
)
|
|
199
74
|
}
|
|
@@ -1,8 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
inputAdornmentClasses,
|
|
4
|
+
inputBaseClasses,
|
|
5
|
+
List,
|
|
6
|
+
styled,
|
|
7
|
+
svgIconClasses,
|
|
8
|
+
} from '@mui/material'
|
|
2
9
|
import { Input as InputBase } from '../../components/Input.js'
|
|
3
10
|
|
|
4
|
-
|
|
5
|
-
|
|
11
|
+
interface InputProps {
|
|
12
|
+
size?: 'small' | 'medium'
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const Input = styled(InputBase, {
|
|
16
|
+
shouldForwardProp: (prop) => prop !== 'size',
|
|
17
|
+
})<InputProps>(({ theme, size = 'medium' }) => ({
|
|
18
|
+
paddingRight: size === 'small' ? theme.spacing(1.25) : theme.spacing(1.75),
|
|
19
|
+
paddingLeft: theme.spacing(1.25),
|
|
20
|
+
fontSize: size === 'small' ? '0.875rem' : '1rem',
|
|
21
|
+
borderRadius: theme.vars.shape.borderRadius,
|
|
22
|
+
[`& .${inputBaseClasses.input}`]: {
|
|
23
|
+
padding: theme.spacing(1),
|
|
24
|
+
},
|
|
25
|
+
[`& .${inputAdornmentClasses.root}`]: {
|
|
26
|
+
marginLeft: 0,
|
|
27
|
+
marginRight: 0,
|
|
28
|
+
[`& .${svgIconClasses.root}`]: {
|
|
29
|
+
width: size === 'small' ? '1.25rem' : '1.5rem',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
[`& .${inputAdornmentClasses.root}.${inputAdornmentClasses.positionEnd}`]: {
|
|
33
|
+
marginRight: size === 'small' ? theme.spacing(-0.5) : theme.spacing(-1),
|
|
34
|
+
[`& .${svgIconClasses.root}`]: {
|
|
35
|
+
width: size === 'small' ? '1rem' : '1.25rem',
|
|
36
|
+
height: size === 'small' ? '1rem' : '1.25rem',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
6
39
|
}))
|
|
7
40
|
|
|
8
41
|
interface SearchStickyContainerProps {
|
|
@@ -1,38 +1,64 @@
|
|
|
1
|
+
import ClearIcon from '@mui/icons-material/Clear'
|
|
1
2
|
import Search from '@mui/icons-material/Search'
|
|
2
|
-
import { FormControl, InputAdornment } from '@mui/material'
|
|
3
|
-
import type { FocusEventHandler, FormEventHandler } from 'react'
|
|
3
|
+
import { FormControl, IconButton, InputAdornment } from '@mui/material'
|
|
4
|
+
import type { FocusEventHandler, FormEventHandler, RefObject } from 'react'
|
|
4
5
|
import { InputCard } from '../../components/Card/InputCard.js'
|
|
5
6
|
import { useHeaderHeight } from '../../stores/header/useHeaderStore.js'
|
|
6
7
|
import { Input, StickySearchInputContainer } from './SearchInput.style.js'
|
|
7
8
|
|
|
8
9
|
interface SearchInputProps {
|
|
10
|
+
inputRef?: RefObject<HTMLInputElement | null>
|
|
9
11
|
name?: string
|
|
10
12
|
value?: string
|
|
11
13
|
placeholder?: string
|
|
12
14
|
onChange?: FormEventHandler<HTMLInputElement>
|
|
13
15
|
onBlur?: FocusEventHandler<HTMLInputElement>
|
|
16
|
+
onClear?: () => void
|
|
14
17
|
autoFocus?: boolean
|
|
18
|
+
size?: 'small' | 'medium'
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
export const SearchInput = ({
|
|
22
|
+
inputRef,
|
|
18
23
|
name,
|
|
19
24
|
placeholder,
|
|
20
25
|
onChange,
|
|
21
26
|
onBlur,
|
|
27
|
+
onClear,
|
|
22
28
|
value,
|
|
23
29
|
autoFocus,
|
|
30
|
+
size = 'medium',
|
|
24
31
|
}: SearchInputProps) => {
|
|
25
32
|
return (
|
|
26
33
|
<InputCard>
|
|
27
34
|
<FormControl fullWidth>
|
|
28
35
|
<Input
|
|
29
|
-
|
|
36
|
+
inputRef={inputRef}
|
|
37
|
+
size={size}
|
|
30
38
|
placeholder={placeholder}
|
|
31
|
-
|
|
32
|
-
<InputAdornment position="
|
|
39
|
+
startAdornment={
|
|
40
|
+
<InputAdornment position="start">
|
|
33
41
|
<Search />
|
|
34
42
|
</InputAdornment>
|
|
35
43
|
}
|
|
44
|
+
endAdornment={
|
|
45
|
+
(value || inputRef?.current?.value) &&
|
|
46
|
+
onClear && (
|
|
47
|
+
<InputAdornment position="end">
|
|
48
|
+
<IconButton
|
|
49
|
+
size={size}
|
|
50
|
+
onClick={onClear}
|
|
51
|
+
aria-label="Clear"
|
|
52
|
+
tabIndex={-1}
|
|
53
|
+
sx={{
|
|
54
|
+
padding: 0.5,
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
<ClearIcon fontSize={size} />
|
|
58
|
+
</IconButton>
|
|
59
|
+
</InputAdornment>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
36
62
|
inputProps={{
|
|
37
63
|
inputMode: 'search',
|
|
38
64
|
onChange,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BoxProps } from '@mui/material'
|
|
2
|
-
import { Box,
|
|
2
|
+
import { Box, styled, Typography } from '@mui/material'
|
|
3
3
|
import { searchContainerHeight } from './SearchInput.style.js'
|
|
4
4
|
|
|
5
5
|
interface NotFoundContainerProps extends BoxProps {
|
|
@@ -22,6 +22,7 @@ export const NotFoundContainer = styled(Box, {
|
|
|
22
22
|
|
|
23
23
|
export const NotFoundMessage = styled(Typography)(({ theme }) => ({
|
|
24
24
|
fontSize: 14,
|
|
25
|
+
whiteSpace: 'normal',
|
|
25
26
|
color: theme.vars.palette.text.secondary,
|
|
26
27
|
textAlign: 'center',
|
|
27
28
|
flex: 1,
|