@lifi/widget 4.0.0 → 4.2.0
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/App.d.ts +4 -2
- package/dist/esm/App.d.ts.map +1 -1
- package/dist/esm/App.js +4 -4
- package/dist/esm/App.js.map +1 -1
- package/dist/esm/AppDefault.js +14 -0
- package/dist/esm/AppDefault.js.map +1 -1
- package/dist/esm/AppDrawer.d.ts +1 -1
- package/dist/esm/AppDrawer.d.ts.map +1 -1
- package/dist/esm/AppDrawer.js +5 -6
- package/dist/esm/AppDrawer.js.map +1 -1
- package/dist/esm/AppDrawerContext.js +2 -2
- package/dist/esm/AppDrawerContext.js.map +1 -1
- package/dist/esm/components/ActionRow/ActionRow.style.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.js +2 -1
- package/dist/esm/components/AmountInput/AmountInput.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.style.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.js +4 -2
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.style.js +1 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.style.js.map +1 -1
- package/dist/esm/components/AmountInput/PriceFormHelperText.js +4 -2
- package/dist/esm/components/AmountInput/PriceFormHelperText.js.map +1 -1
- package/dist/esm/components/AmountInput/PriceFormHelperText.style.js.map +1 -1
- package/dist/esm/components/AmountInputCard/AmountInputCard.style.js +98 -0
- package/dist/esm/components/AmountInputCard/AmountInputCard.style.js.map +1 -0
- package/dist/esm/components/AmountInputCard/AmountInputCardPair.js +25 -0
- package/dist/esm/components/AmountInputCard/AmountInputCardPair.js.map +1 -0
- package/dist/esm/components/AmountInputCard/BalanceDisplay.js +35 -0
- package/dist/esm/components/AmountInputCard/BalanceDisplay.js.map +1 -0
- package/dist/esm/components/AmountInputCard/BalanceDisplay.style.js +11 -0
- package/dist/esm/components/AmountInputCard/BalanceDisplay.style.js.map +1 -0
- package/dist/esm/components/AmountInputCard/FiatValueToggle.js +41 -0
- package/dist/esm/components/AmountInputCard/FiatValueToggle.js.map +1 -0
- package/dist/esm/components/AmountInputCard/PercentageChips.js +80 -0
- package/dist/esm/components/AmountInputCard/PercentageChips.js.map +1 -0
- package/dist/esm/components/AmountInputCard/PercentageChips.style.js +43 -0
- package/dist/esm/components/AmountInputCard/PercentageChips.style.js.map +1 -0
- package/dist/esm/components/AmountInputCard/ReceiveAmountCard.js +137 -0
- package/dist/esm/components/AmountInputCard/ReceiveAmountCard.js.map +1 -0
- package/dist/esm/components/AmountInputCard/SendAmountCard.js +102 -0
- package/dist/esm/components/AmountInputCard/SendAmountCard.js.map +1 -0
- package/dist/esm/components/AppContainer.js.map +1 -1
- package/dist/esm/components/Avatar/AccountAvatar.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.js +12 -3
- package/dist/esm/components/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.style.js.map +1 -1
- package/dist/esm/components/Avatar/SmallAvatar.js.map +1 -1
- package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js +1 -0
- package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js.map +1 -1
- package/dist/esm/components/BottomSheet/BottomSheet.js +3 -3
- package/dist/esm/components/BottomSheet/BottomSheet.js.map +1 -1
- package/dist/esm/components/ButtonTertiary.js.map +1 -1
- package/dist/esm/components/Card/Card.js.map +1 -1
- package/dist/esm/components/Card/CardButton.style.js.map +1 -1
- package/dist/esm/components/Card/CardHeader.js.map +1 -1
- package/dist/esm/components/Card/CardIconButton.js.map +1 -1
- package/dist/esm/components/Card/CardLabel.js.map +1 -1
- package/dist/esm/components/Card/CardTitle.js.map +1 -1
- package/dist/esm/components/Card/InputCard.js.map +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.js.map +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.style.js.map +1 -1
- package/dist/esm/components/ChainSelect/useChainSelect.js.map +1 -1
- package/dist/esm/components/Chains/AllChainsAvatar.js.map +1 -1
- package/dist/esm/components/Chains/ChainList.js.map +1 -1
- package/dist/esm/components/Chains/ChainList.style.js.map +1 -1
- package/dist/esm/components/Chains/ChainsExpanded.style.js.map +1 -1
- package/dist/esm/components/Chains/VirtualizedChainList.js +2 -1
- package/dist/esm/components/Chains/VirtualizedChainList.js.map +1 -1
- package/dist/esm/components/ContextMenu.style.js.map +1 -1
- package/dist/esm/components/ContractComponent/NFT/NFT.style.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.style.js.map +1 -1
- package/dist/esm/components/EmptyListIndicator/EmptyListIndicator.style.js.map +1 -1
- package/dist/esm/components/ExecutionStatusCard/StatusIcon.js.map +1 -1
- package/dist/esm/components/ExecutionStatusCard/StatusIcon.style.js.map +1 -1
- package/dist/esm/components/ExecutionStatusCard/iconKey.js.map +1 -1
- package/dist/esm/components/Expansion/Expansion.style.js.map +1 -1
- package/dist/esm/components/Header/ActivitiesButton.style.js.map +1 -1
- package/dist/esm/components/Header/CloseDrawerButton.js +1 -0
- package/dist/esm/components/Header/CloseDrawerButton.js.map +1 -1
- package/dist/esm/components/Header/Header.js +7 -10
- package/dist/esm/components/Header/Header.js.map +1 -1
- package/dist/esm/components/Header/Header.style.js.map +1 -1
- package/dist/esm/components/Header/HeaderNavigationTabs.js +39 -0
- package/dist/esm/components/Header/HeaderNavigationTabs.js.map +1 -0
- package/dist/esm/components/Header/HeaderTabs.js +33 -0
- package/dist/esm/components/Header/HeaderTabs.js.map +1 -0
- package/dist/esm/components/Header/NavigationHeader.js +7 -5
- package/dist/esm/components/Header/NavigationHeader.js.map +1 -1
- package/dist/esm/components/Header/SettingsButton.style.js.map +1 -1
- package/dist/esm/components/Header/WalletMenu.style.js.map +1 -1
- package/dist/esm/components/IconCircle/IconCircle.style.js +1 -1
- package/dist/esm/components/IconCircle/IconCircle.style.js.map +1 -1
- package/dist/esm/components/IconTypography.js.map +1 -1
- package/dist/esm/components/Input.js.map +1 -1
- package/dist/esm/components/LimitOrderSettings/LimitOrderSettings.js +99 -0
- package/dist/esm/components/LimitOrderSettings/LimitOrderSettings.js.map +1 -0
- package/dist/esm/components/LimitOrderSettings/LimitOrderSettings.style.js +52 -0
- package/dist/esm/components/LimitOrderSettings/LimitOrderSettings.style.js.map +1 -0
- package/dist/esm/components/LimitPriceCard/LimitPriceCard.js +115 -0
- package/dist/esm/components/LimitPriceCard/LimitPriceCard.js.map +1 -0
- package/dist/esm/components/LimitPriceCard/LimitPriceCard.style.js +89 -0
- package/dist/esm/components/LimitPriceCard/LimitPriceCard.style.js.map +1 -0
- package/dist/esm/components/LimitPriceCard/LimitPricePresets.js +91 -0
- package/dist/esm/components/LimitPriceCard/LimitPricePresets.js.map +1 -0
- package/dist/esm/components/ListItem/ListItem.js.map +1 -1
- package/dist/esm/components/ListItem/ListItemButton.js.map +1 -1
- package/dist/esm/components/ListItemButton.js.map +1 -1
- package/dist/esm/components/ListItemText.js.map +1 -1
- package/dist/esm/components/Menu.js.map +1 -1
- package/dist/esm/components/Messages/AlertMessage.style.js.map +1 -1
- package/dist/esm/components/Messages/GasRefuelMessage.style.js.map +1 -1
- package/dist/esm/components/Messages/WarningMessages.js.map +1 -1
- package/dist/esm/components/PageContainer.js.map +1 -1
- package/dist/esm/components/PoweredBy/PoweredBy.js.map +1 -1
- package/dist/esm/components/PoweredBy/PoweredBy.style.js.map +1 -1
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.js +1 -0
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.js.map +1 -1
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.style.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteDetails.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteDetails.style.js +2 -2
- package/dist/esm/components/RouteCard/RouteDetails.style.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteProviderCard.js +118 -0
- package/dist/esm/components/RouteCard/RouteProviderCard.js.map +1 -0
- package/dist/esm/components/RouteCard/RouteToken.style.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteTokens.js.map +1 -1
- package/dist/esm/components/RouteCard/getMatchingLabels.js.map +1 -1
- package/dist/esm/components/Routes/LimitOrderRoutes.js +34 -0
- package/dist/esm/components/Routes/LimitOrderRoutes.js.map +1 -0
- package/dist/esm/components/Routes/Routes.js +2 -2
- package/dist/esm/components/Routes/Routes.js.map +1 -1
- package/dist/esm/components/Routes/RoutesContent.js.map +1 -1
- package/dist/esm/components/Routes/RoutesExpanded.style.js.map +1 -1
- package/dist/esm/components/Search/SearchInput.style.js.map +1 -1
- package/dist/esm/components/Search/SearchNotFound.style.js.map +1 -1
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js.map +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.style.js.map +1 -1
- package/dist/esm/components/SettingsListItemButton.js.map +1 -1
- package/dist/esm/components/SettingsPanel/SettingsPanel.js +51 -0
- package/dist/esm/components/SettingsPanel/SettingsPanel.js.map +1 -0
- package/dist/esm/components/SettingsPanel/SettingsPanel.style.js +33 -0
- package/dist/esm/components/SettingsPanel/SettingsPanel.style.js.map +1 -0
- package/dist/esm/components/SettingsPanel/utils.js +14 -0
- package/dist/esm/components/SettingsPanel/utils.js.map +1 -0
- package/dist/esm/components/Skeleton/WidgetSkeleton.js +50 -47
- package/dist/esm/components/Skeleton/WidgetSkeleton.js.map +1 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.js.map +1 -1
- package/dist/esm/components/Step/StepActions.js.map +1 -1
- package/dist/esm/components/Step/StepActions.style.js.map +1 -1
- package/dist/esm/components/StepActions/SentToWalletRow.style.js.map +1 -1
- package/dist/esm/components/StepActions/StepActionRow.style.js.map +1 -1
- package/dist/esm/components/SwapButton/SwapButton.js +50 -0
- package/dist/esm/components/SwapButton/SwapButton.js.map +1 -0
- package/dist/esm/components/SwapButton/SwapButton.style.js +24 -0
- package/dist/esm/components/SwapButton/SwapButton.style.js.map +1 -0
- package/dist/esm/components/Switch.js.map +1 -1
- package/dist/esm/components/Tabs/NavigationTabs.js +3 -0
- package/dist/esm/components/Tabs/NavigationTabs.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.style.js.map +1 -1
- package/dist/esm/components/Timer/StepStatusTimer.style.js.map +1 -1
- package/dist/esm/components/Token/Token.style.js.map +1 -1
- package/dist/esm/components/TokenList/PinTokenButton.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheet.js +4 -4
- package/dist/esm/components/TokenList/TokenDetailsSheet.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.js +4 -4
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenList.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenListItem.js +2 -2
- package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
- package/dist/esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
- package/dist/esm/components/TokenList/useTokenSelect.js +3 -3
- package/dist/esm/components/TokenList/useTokenSelect.js.map +1 -1
- package/dist/esm/components/TokenPillButton/TokenPillButton.js +52 -0
- package/dist/esm/components/TokenPillButton/TokenPillButton.js.map +1 -0
- package/dist/esm/components/TokenPillButton/TokenPillButton.style.js +39 -0
- package/dist/esm/components/TokenPillButton/TokenPillButton.style.js.map +1 -0
- package/dist/esm/components/TokenRate/TokenRate.style.js.map +1 -1
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.js.map +1 -1
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.style.js.map +1 -1
- package/dist/esm/components/TransactionCard/TransactionCard.style.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/validate.js.map +1 -1
- package/dist/esm/hooks/useAccountsBalancesData.js.map +1 -1
- package/dist/esm/hooks/useAvailableChains.js +1 -1
- package/dist/esm/hooks/useChainSearch.js +2 -1
- package/dist/esm/hooks/useChainSearch.js.map +1 -1
- package/dist/esm/hooks/useChains.js +1 -1
- package/dist/esm/hooks/useExplorer.js.map +1 -1
- package/dist/esm/hooks/useFilteredByTokenBalances.js +1 -1
- package/dist/esm/hooks/useFilteredByTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useFromTokenSufficiency.js.map +1 -1
- package/dist/esm/hooks/useGasSufficiency.js.map +1 -1
- package/dist/esm/hooks/useLanguages.js +2 -2
- package/dist/esm/hooks/useLanguages.js.map +1 -1
- package/dist/esm/hooks/useLimitMarketRate.js +24 -0
- package/dist/esm/hooks/useLimitMarketRate.js.map +1 -0
- package/dist/esm/hooks/useLinkedLimitFields.js +49 -0
- package/dist/esm/hooks/useLinkedLimitFields.js.map +1 -0
- package/dist/esm/hooks/useRouteExecution.js.map +1 -1
- package/dist/esm/hooks/useRouteExecutionMessage.js.map +1 -1
- package/dist/esm/hooks/useRouteRequiredAccountConnection.js.map +1 -1
- package/dist/esm/hooks/useRoutes.js +23 -6
- package/dist/esm/hooks/useRoutes.js.map +1 -1
- package/dist/esm/hooks/useSwapOnly.js +2 -4
- package/dist/esm/hooks/useSwapOnly.js.map +1 -1
- package/dist/esm/hooks/useToAddressRequirements.js +2 -2
- package/dist/esm/hooks/useToAddressRequirements.js.map +1 -1
- package/dist/esm/hooks/useToken.js.map +1 -1
- package/dist/esm/hooks/useTokenBalance.js.map +1 -1
- package/dist/esm/hooks/useTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useTokenBalancesQueries.js.map +1 -1
- package/dist/esm/hooks/useTokenSearch.js +1 -1
- package/dist/esm/hooks/useTokenSearch.js.map +1 -1
- package/dist/esm/hooks/useTokens.js +17 -15
- package/dist/esm/hooks/useTokens.js.map +1 -1
- package/dist/esm/hooks/useTools.js +1 -1
- package/dist/esm/hooks/useTransactionDetails.js.map +1 -1
- package/dist/esm/hooks/useTransactionHistory.js.map +1 -1
- package/dist/esm/hooks/useTransactionList.js.map +1 -1
- package/dist/esm/hooks/useWideVariant.js +5 -2
- package/dist/esm/hooks/useWideVariant.js.map +1 -1
- package/dist/esm/i18n/en.json +25 -0
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/pages/ActivitiesPage/ActivitiesPage.js.map +1 -1
- package/dist/esm/pages/MainPage/LimitPageContent.js +23 -0
- package/dist/esm/pages/MainPage/LimitPageContent.js.map +1 -0
- package/dist/esm/pages/MainPage/MainPage.js +19 -22
- package/dist/esm/pages/MainPage/MainPage.js.map +1 -1
- package/dist/esm/pages/MainPage/MainPageActions.js +28 -0
- package/dist/esm/pages/MainPage/MainPageActions.js.map +1 -0
- package/dist/esm/pages/MainPage/ReviewButton.js +11 -4
- package/dist/esm/pages/MainPage/ReviewButton.js.map +1 -1
- package/dist/esm/pages/RoutePriorityPage.js +48 -0
- package/dist/esm/pages/RoutePriorityPage.js.map +1 -0
- package/dist/esm/pages/RoutesPage/RoutesPage.js.map +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.style.js.map +1 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js +3 -3
- package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js.map +1 -1
- package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js +3 -3
- package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js +2 -2
- package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/GasPriceSettings.js +1 -1
- package/dist/esm/pages/SettingsPage/ResetSettingsButton.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/RoutePrioritySettings.js +12 -27
- package/dist/esm/pages/SettingsPage/RoutePrioritySettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +3 -3
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingsAccordian.js +3 -3
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingsAccordian.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippagePage.js +133 -0
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippagePage.js.map +1 -0
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +14 -72
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +26 -14
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/ThemeSettings.js +4 -0
- package/dist/esm/pages/SettingsPage/ThemeSettings.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/ContactSupportButton.style.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js.map +1 -1
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js +3 -3
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js +16 -15
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.style.js.map +1 -1
- package/dist/esm/pages/TransactionPage/RouteTracker.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js +3 -3
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.style.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TransactionExecutionContent.js +27 -31
- package/dist/esm/pages/TransactionPage/TransactionExecutionContent.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TransactionReview.js +4 -1
- package/dist/esm/pages/TransactionPage/TransactionReview.js.map +1 -1
- package/dist/esm/pages/TransactionPage/utils.js.map +1 -1
- package/dist/esm/providers/I18nProvider/I18nProvider.js +1 -1
- package/dist/esm/providers/I18nProvider/I18nProvider.js.map +1 -1
- package/dist/esm/providers/I18nProvider/enResource.d.ts +1 -1
- package/dist/esm/providers/I18nProvider/enResource.js +1 -1
- package/dist/esm/providers/I18nProvider/i18n.js.map +1 -1
- package/dist/esm/providers/I18nProvider/types.d.ts +2 -2
- package/dist/esm/providers/QueryClientProvider.js +2 -2
- package/dist/esm/providers/QueryClientProvider.js.map +1 -1
- package/dist/esm/providers/SDKClientProvider.js +3 -3
- package/dist/esm/providers/SDKClientProvider.js.map +1 -1
- package/dist/esm/providers/WidgetProvider/WidgetProvider.js +4 -5
- package/dist/esm/providers/WidgetProvider/WidgetProvider.js.map +1 -1
- package/dist/esm/stores/StoreProvider.js +3 -4
- package/dist/esm/stores/StoreProvider.js.map +1 -1
- package/dist/esm/stores/bookmarks/BookmarkStore.js +3 -3
- package/dist/esm/stores/bookmarks/BookmarkStore.js.map +1 -1
- package/dist/esm/stores/bookmarks/createBookmarkStore.js.map +1 -1
- package/dist/esm/stores/chains/ChainOrderStore.js +4 -4
- package/dist/esm/stores/chains/ChainOrderStore.js.map +1 -1
- package/dist/esm/stores/chains/createChainOrderStore.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/URLSearchParamsBuilder.js +14 -3
- package/dist/esm/stores/form/URLSearchParamsBuilder.js.map +1 -1
- package/dist/esm/stores/form/createFormStore.js +6 -2
- package/dist/esm/stores/form/createFormStore.js.map +1 -1
- package/dist/esm/stores/form/getDefaultValuesFromQueryString.js +3 -0
- package/dist/esm/stores/form/getDefaultValuesFromQueryString.js.map +1 -1
- package/dist/esm/stores/form/types.d.ts +9 -1
- package/dist/esm/stores/form/types.d.ts.map +1 -1
- package/dist/esm/stores/form/types.js.map +1 -1
- package/dist/esm/stores/form/useClearAmountFields.js +1 -0
- package/dist/esm/stores/form/useClearAmountFields.js.map +1 -1
- package/dist/esm/stores/form/useFieldActions.js.map +1 -1
- package/dist/esm/stores/form/useFieldValues.js.map +1 -1
- package/dist/esm/stores/form/useFormRef.js.map +1 -1
- package/dist/esm/stores/form/useFormStore.js +2 -2
- package/dist/esm/stores/form/useFormStore.js.map +1 -1
- package/dist/esm/stores/header/useHeaderStore.js +3 -3
- package/dist/esm/stores/header/useHeaderStore.js.map +1 -1
- package/dist/esm/stores/inputMode/useInputModeStore.js.map +1 -1
- package/dist/esm/stores/navigationTabs/useNavigationTabLabel.js +22 -0
- package/dist/esm/stores/navigationTabs/useNavigationTabLabel.js.map +1 -0
- package/dist/esm/stores/navigationTabs/useNavigationTabsStore.js +64 -0
- package/dist/esm/stores/navigationTabs/useNavigationTabsStore.js.map +1 -0
- package/dist/esm/stores/navigationTabs/utils.js +122 -0
- package/dist/esm/stores/navigationTabs/utils.js.map +1 -0
- package/dist/esm/stores/pinnedTokens/PinnedTokensStore.js +3 -3
- package/dist/esm/stores/pinnedTokens/PinnedTokensStore.js.map +1 -1
- package/dist/esm/stores/pinnedTokens/createPinnedTokensStore.js.map +1 -1
- package/dist/esm/stores/routes/RouteExecutionStore.js +3 -3
- package/dist/esm/stores/routes/RouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/routes/createRouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/routes/useIntermediateRoutesStore.js.map +1 -1
- package/dist/esm/stores/routes/useRouteExecutionIndicator.js.map +1 -1
- package/dist/esm/stores/routes/utils.js.map +1 -1
- package/dist/esm/stores/settings/SettingsStore.js +3 -3
- package/dist/esm/stores/settings/SettingsStore.js.map +1 -1
- package/dist/esm/stores/settings/createSettingsStore.js +122 -96
- package/dist/esm/stores/settings/createSettingsStore.js.map +1 -1
- package/dist/esm/stores/settings/types.d.ts +0 -2
- package/dist/esm/stores/settings/types.d.ts.map +1 -1
- package/dist/esm/stores/settings/types.js.map +1 -1
- package/dist/esm/stores/settings/useSettingsActions.js.map +1 -1
- package/dist/esm/themes/createTheme.js.map +1 -1
- package/dist/esm/themes/utils.js.map +1 -1
- package/dist/esm/types/events.d.ts +10 -1
- package/dist/esm/types/events.d.ts.map +1 -1
- package/dist/esm/types/events.js +2 -0
- package/dist/esm/types/events.js.map +1 -1
- package/dist/esm/types/widget.d.ts +28 -2
- package/dist/esm/types/widget.d.ts.map +1 -1
- package/dist/esm/types/widget.js.map +1 -1
- package/dist/esm/utils/compactNumberFormatter.js.map +1 -1
- package/dist/esm/utils/converters.js.map +1 -1
- package/dist/esm/utils/deepEqual.js.map +1 -1
- package/dist/esm/utils/fees.js.map +1 -1
- package/dist/esm/utils/format.d.ts +1 -1
- package/dist/esm/utils/format.d.ts.map +1 -1
- package/dist/esm/utils/format.js +2 -2
- package/dist/esm/utils/format.js.map +1 -1
- package/dist/esm/utils/getActionMessage.js.map +1 -1
- package/dist/esm/utils/getErrorMessage.js.map +1 -1
- package/dist/esm/utils/item.js.map +1 -1
- package/dist/esm/utils/limitOrder.js +61 -0
- package/dist/esm/utils/limitOrder.js.map +1 -0
- package/dist/esm/utils/{variant.js → mode.js} +2 -2
- package/dist/esm/utils/mode.js.map +1 -0
- package/dist/esm/utils/navigationRoutes.d.ts +2 -0
- package/dist/esm/utils/navigationRoutes.d.ts.map +1 -1
- package/dist/esm/utils/navigationRoutes.js +6 -0
- package/dist/esm/utils/navigationRoutes.js.map +1 -1
- package/dist/esm/utils/prepareActions.js +1 -1
- package/dist/esm/utils/prepareActions.js.map +1 -1
- package/dist/esm/utils/timer.js.map +1 -1
- package/dist/esm/utils/token.js +1 -1
- package/dist/esm/utils/token.js.map +1 -1
- package/dist/esm/utils/tokenList.js.map +1 -1
- package/package.json +13 -13
- package/src/App.tsx +7 -7
- package/src/AppDefault.tsx +16 -0
- package/src/AppDrawer.tsx +77 -78
- package/src/AppDrawerContext.ts +2 -2
- package/src/components/AmountInput/AmountInputEndAdornment.style.ts +1 -1
- package/src/components/AmountInput/AmountInputEndAdornment.tsx +5 -2
- package/src/components/AmountInputCard/AmountInputCard.style.tsx +157 -0
- package/src/components/AmountInputCard/AmountInputCardPair.tsx +25 -0
- package/src/components/AmountInputCard/BalanceDisplay.style.tsx +9 -0
- package/src/components/AmountInputCard/BalanceDisplay.tsx +46 -0
- package/src/components/AmountInputCard/FiatValueToggle.tsx +55 -0
- package/src/components/AmountInputCard/PercentageChips.style.tsx +60 -0
- package/src/components/AmountInputCard/PercentageChips.tsx +100 -0
- package/src/components/AmountInputCard/ReceiveAmountCard.tsx +219 -0
- package/src/components/AmountInputCard/SendAmountCard.tsx +179 -0
- package/src/components/Avatar/Avatar.tsx +8 -3
- package/src/components/BaseTransactionButton/BaseTransactionButton.tsx +1 -0
- package/src/components/BottomSheet/BottomSheet.tsx +56 -52
- package/src/components/Header/CloseDrawerButton.tsx +5 -1
- package/src/components/Header/Header.tsx +20 -18
- package/src/components/Header/HeaderNavigationTabs.tsx +42 -0
- package/src/components/Header/HeaderTabs.tsx +48 -0
- package/src/components/Header/NavigationHeader.tsx +11 -8
- package/src/components/LimitOrderSettings/LimitOrderSettings.style.tsx +69 -0
- package/src/components/LimitOrderSettings/LimitOrderSettings.tsx +124 -0
- package/src/components/LimitPriceCard/LimitPriceCard.style.tsx +103 -0
- package/src/components/LimitPriceCard/LimitPriceCard.tsx +153 -0
- package/src/components/LimitPriceCard/LimitPricePresets.tsx +139 -0
- package/src/components/ReverseTokensButton/ReverseTokensButton.tsx +4 -1
- package/src/components/RouteCard/RouteProviderCard.tsx +113 -0
- package/src/components/Routes/LimitOrderRoutes.tsx +64 -0
- package/src/components/Routes/Routes.tsx +3 -2
- package/src/components/SettingsPanel/SettingsPanel.style.tsx +41 -0
- package/src/components/SettingsPanel/SettingsPanel.tsx +73 -0
- package/src/components/SettingsPanel/utils.ts +27 -0
- package/src/components/Skeleton/WidgetSkeleton.tsx +1 -1
- package/src/components/SwapButton/SwapButton.style.tsx +28 -0
- package/src/components/SwapButton/SwapButton.tsx +71 -0
- package/src/components/Tabs/NavigationTabs.tsx +3 -0
- package/src/components/TokenList/TokenDetailsSheet.tsx +9 -7
- package/src/components/TokenList/TokenDetailsSheetContent.tsx +176 -177
- package/src/components/TokenList/useTokenSelect.ts +2 -2
- package/src/components/TokenPillButton/TokenPillButton.style.tsx +50 -0
- package/src/components/TokenPillButton/TokenPillButton.tsx +81 -0
- package/src/config/version.ts +1 -1
- package/src/hooks/useLimitMarketRate.ts +39 -0
- package/src/hooks/useLinkedLimitFields.ts +74 -0
- package/src/hooks/useRoutes.ts +45 -4
- package/src/hooks/useSwapOnly.ts +2 -5
- package/src/hooks/useToAddressRequirements.ts +2 -2
- package/src/hooks/useWideVariant.ts +8 -2
- package/src/pages/MainPage/LimitPageContent.tsx +18 -0
- package/src/pages/MainPage/MainPage.tsx +43 -30
- package/src/pages/MainPage/MainPageActions.tsx +35 -0
- package/src/pages/MainPage/ReviewButton.tsx +15 -3
- package/src/pages/RoutePriorityPage.tsx +55 -0
- package/src/pages/SendToWallet/BookmarkAddressSheet.tsx +176 -185
- package/src/pages/SendToWallet/ConfirmAddressSheet.tsx +9 -6
- package/src/pages/SettingsPage/RoutePrioritySettings.tsx +14 -38
- package/src/pages/SettingsPage/SettingsCard/SettingCardExpandable.tsx +58 -65
- package/src/pages/SettingsPage/SettingsCard/SettingsAccordian.tsx +4 -4
- package/src/pages/SettingsPage/SlippageSettings/SlippagePage.tsx +176 -0
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.style.tsx +32 -25
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +14 -128
- package/src/pages/SettingsPage/ThemeSettings.tsx +4 -0
- package/src/pages/TransactionPage/ConfirmToAddressSheet.tsx +9 -6
- package/src/pages/TransactionPage/ExchangeRateBottomSheet.tsx +53 -58
- package/src/pages/TransactionPage/TokenValueBottomSheet.tsx +24 -21
- package/src/pages/TransactionPage/TransactionExecutionContent.tsx +8 -6
- package/src/providers/QueryClientProvider.tsx +2 -2
- package/src/providers/SDKClientProvider.tsx +3 -7
- package/src/providers/WidgetProvider/WidgetProvider.tsx +6 -7
- package/src/stores/StoreProvider.tsx +3 -10
- package/src/stores/bookmarks/BookmarkStore.tsx +4 -4
- package/src/stores/chains/ChainOrderStore.tsx +4 -4
- package/src/stores/form/FormStore.tsx +2 -2
- package/src/stores/form/URLSearchParamsBuilder.tsx +25 -3
- package/src/stores/form/createFormStore.ts +7 -3
- package/src/stores/form/getDefaultValuesFromQueryString.ts +11 -0
- package/src/stores/form/types.ts +14 -1
- package/src/stores/form/useClearAmountFields.ts +1 -0
- package/src/stores/form/useFormStore.ts +2 -2
- package/src/stores/header/useHeaderStore.tsx +3 -5
- package/src/stores/navigationTabs/types.ts +33 -0
- package/src/stores/navigationTabs/useNavigationTabLabel.ts +28 -0
- package/src/stores/navigationTabs/useNavigationTabsStore.tsx +113 -0
- package/src/stores/navigationTabs/utils.ts +196 -0
- package/src/stores/pinnedTokens/PinnedTokensStore.tsx +4 -4
- package/src/stores/routes/RouteExecutionStore.tsx +4 -4
- package/src/stores/settings/SettingsStore.tsx +4 -4
- package/src/stores/settings/createSettingsStore.ts +48 -12
- package/src/stores/settings/types.ts +1 -16
- package/src/types/events.ts +12 -0
- package/src/types/widget.ts +40 -1
- package/src/utils/format.ts +6 -2
- package/src/utils/limitOrder.ts +88 -0
- package/src/utils/navigationRoutes.ts +6 -0
- package/dist/esm/components/Header/SplitNavigationTabs.js +0 -33
- package/dist/esm/components/Header/SplitNavigationTabs.js.map +0 -1
- package/dist/esm/stores/settings/useSplitModeStore.js +0 -36
- package/dist/esm/stores/settings/useSplitModeStore.js.map +0 -1
- package/dist/esm/utils/variant.js.map +0 -1
- package/src/components/Header/SplitNavigationTabs.tsx +0 -32
- package/src/stores/settings/useSplitModeStore.tsx +0 -58
- /package/src/utils/{variant.ts → mode.ts} +0 -0
|
@@ -2,13 +2,8 @@ import ErrorIcon from '@mui/icons-material/Error'
|
|
|
2
2
|
import TurnedIn from '@mui/icons-material/TurnedIn'
|
|
3
3
|
import WarningRounded from '@mui/icons-material/WarningRounded'
|
|
4
4
|
import { Button, Typography } from '@mui/material'
|
|
5
|
-
import type { ChangeEvent, RefObject } from 'react'
|
|
6
|
-
import {
|
|
7
|
-
type ForwardRefExoticComponent,
|
|
8
|
-
forwardRef,
|
|
9
|
-
type RefAttributes,
|
|
10
|
-
useState,
|
|
11
|
-
} from 'react'
|
|
5
|
+
import type { ChangeEvent, JSX, Ref, RefObject } from 'react'
|
|
6
|
+
import { useState } from 'react'
|
|
12
7
|
import { useTranslation } from 'react-i18next'
|
|
13
8
|
import { BottomSheet } from '../../components/BottomSheet/BottomSheet.js'
|
|
14
9
|
import type { BottomSheetBase } from '../../components/BottomSheet/types.js'
|
|
@@ -35,213 +30,209 @@ interface BookmarkAddressProps {
|
|
|
35
30
|
validatedWallet?: Bookmark
|
|
36
31
|
}
|
|
37
32
|
|
|
38
|
-
export const BookmarkAddressSheet
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
33
|
+
export const BookmarkAddressSheet = ({
|
|
34
|
+
validatedWallet,
|
|
35
|
+
onAddBookmark,
|
|
36
|
+
ref,
|
|
37
|
+
}: BookmarkAddressProps & {
|
|
38
|
+
ref?: Ref<BottomSheetBase>
|
|
39
|
+
}): JSX.Element => {
|
|
40
|
+
const { t } = useTranslation()
|
|
41
|
+
const [name, setName] = useState('')
|
|
42
|
+
const [address, setAddress] = useState('')
|
|
43
|
+
const [error, setError] = useState<BookmarkError>()
|
|
44
|
+
const { validateAddress, isValidating } = useAddressValidation()
|
|
45
|
+
const { getBookmark } = useBookmarkActions()
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
const nameValue = name.trim() || validatedWallet?.name || ''
|
|
48
|
+
const addressValue = address || validatedWallet?.address || ''
|
|
51
49
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
const handleCancel = () => {
|
|
51
|
+
setError(undefined)
|
|
52
|
+
;(ref as RefObject<BottomSheetBase>).current?.close()
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const validateWithAddressFromInput = async () => {
|
|
56
|
+
const validationResult = await validateAddress({ value: address })
|
|
57
|
+
if (!validationResult.isValid) {
|
|
58
|
+
setError({ type: 'address', message: validationResult.error })
|
|
59
|
+
return
|
|
55
60
|
}
|
|
56
61
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
return {
|
|
63
|
+
name: nameValue,
|
|
64
|
+
address: validationResult.address,
|
|
65
|
+
chainType: validationResult.chainType,
|
|
66
|
+
}
|
|
67
|
+
}
|
|
63
68
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
const validateWithValidatedWallet = (validatedWallet: Bookmark) => {
|
|
70
|
+
if (error) {
|
|
71
|
+
setError(undefined)
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
name: nameValue,
|
|
75
|
+
address: validatedWallet.address,
|
|
76
|
+
chainType: validatedWallet.chainType,
|
|
69
77
|
}
|
|
78
|
+
}
|
|
70
79
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
+
const handleBookmark = async () => {
|
|
81
|
+
if (isValidating) {
|
|
82
|
+
return
|
|
83
|
+
}
|
|
84
|
+
if (!nameValue) {
|
|
85
|
+
setError({
|
|
86
|
+
type: 'name',
|
|
87
|
+
message: t('error.title.bookmarkNameRequired'),
|
|
88
|
+
})
|
|
89
|
+
return
|
|
90
|
+
}
|
|
91
|
+
if (!addressValue) {
|
|
92
|
+
setError({
|
|
93
|
+
type: 'address',
|
|
94
|
+
message: t('error.title.walletAddressRequired'),
|
|
95
|
+
})
|
|
96
|
+
return
|
|
80
97
|
}
|
|
81
98
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return
|
|
92
|
-
}
|
|
93
|
-
if (!addressValue) {
|
|
99
|
+
// If the validatedWallet is supplied as a prop then we should assume
|
|
100
|
+
// the address has already been validated
|
|
101
|
+
const validatedBookmark = validatedWallet
|
|
102
|
+
? validateWithValidatedWallet(validatedWallet)
|
|
103
|
+
: await validateWithAddressFromInput()
|
|
104
|
+
|
|
105
|
+
if (validatedBookmark) {
|
|
106
|
+
const existingBookmark = getBookmark(validatedBookmark.address)
|
|
107
|
+
if (existingBookmark) {
|
|
94
108
|
setError({
|
|
95
109
|
type: 'address',
|
|
96
|
-
message: t('error.title.
|
|
110
|
+
message: t('error.title.bookmarkAlreadyExists', {
|
|
111
|
+
name: existingBookmark.name,
|
|
112
|
+
}),
|
|
97
113
|
})
|
|
98
114
|
return
|
|
99
115
|
}
|
|
116
|
+
;(ref as RefObject<BottomSheetBase>).current?.close()
|
|
100
117
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
if (validatedBookmark) {
|
|
108
|
-
const existingBookmark = getBookmark(validatedBookmark.address)
|
|
109
|
-
if (existingBookmark) {
|
|
110
|
-
setError({
|
|
111
|
-
type: 'address',
|
|
112
|
-
message: t('error.title.bookmarkAlreadyExists', {
|
|
113
|
-
name: existingBookmark.name,
|
|
114
|
-
}),
|
|
115
|
-
})
|
|
116
|
-
return
|
|
117
|
-
}
|
|
118
|
-
;(ref as RefObject<BottomSheetBase>).current?.close()
|
|
119
|
-
|
|
120
|
-
onAddBookmark({
|
|
121
|
-
name: validatedBookmark.name,
|
|
122
|
-
address: validatedBookmark.address,
|
|
123
|
-
chainType: validatedBookmark.chainType,
|
|
124
|
-
})
|
|
125
|
-
}
|
|
118
|
+
onAddBookmark({
|
|
119
|
+
name: validatedBookmark.name,
|
|
120
|
+
address: validatedBookmark.address,
|
|
121
|
+
chainType: validatedBookmark.chainType,
|
|
122
|
+
})
|
|
126
123
|
}
|
|
124
|
+
}
|
|
127
125
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
setAddress((e.target as HTMLInputElement).value.trim())
|
|
126
|
+
const handleAddressInputChange = (e: ChangeEvent) => {
|
|
127
|
+
if (error) {
|
|
128
|
+
setError(undefined)
|
|
133
129
|
}
|
|
130
|
+
setAddress((e.target as HTMLInputElement).value.trim())
|
|
131
|
+
}
|
|
134
132
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
setName((e.target as HTMLInputElement).value)
|
|
133
|
+
const handleNameInputChange = (e: ChangeEvent) => {
|
|
134
|
+
if (error) {
|
|
135
|
+
setError(undefined)
|
|
140
136
|
}
|
|
137
|
+
setName((e.target as HTMLInputElement).value)
|
|
138
|
+
}
|
|
141
139
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
const resetValues = () => {
|
|
141
|
+
setName('')
|
|
142
|
+
setAddress('')
|
|
143
|
+
}
|
|
146
144
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
145
|
+
return (
|
|
146
|
+
<BottomSheet ref={ref} onClose={resetValues}>
|
|
147
|
+
<SendToWalletSheetContainer>
|
|
148
|
+
<IconContainer>
|
|
149
|
+
<TurnedIn sx={{ fontSize: 40 }} />
|
|
150
|
+
</IconContainer>
|
|
151
|
+
<SheetTitle>{t('sendToWallet.bookmarkWallet')}</SheetTitle>
|
|
152
|
+
{validatedWallet ? (
|
|
153
|
+
<SheetAddressContainer>
|
|
154
|
+
{validatedWallet?.name ? (
|
|
155
|
+
<Typography
|
|
156
|
+
sx={{
|
|
157
|
+
fontWeight: 600,
|
|
158
|
+
mb: 0.5,
|
|
159
|
+
}}
|
|
160
|
+
>
|
|
161
|
+
{validatedWallet?.name}
|
|
162
|
+
</Typography>
|
|
163
|
+
) : null}
|
|
164
|
+
<Typography>{validatedWallet?.address}</Typography>
|
|
165
|
+
</SheetAddressContainer>
|
|
166
|
+
) : null}
|
|
167
|
+
<BookmarkInputFields>
|
|
168
|
+
<SendToWalletCard type={error?.type === 'name' ? 'error' : 'default'}>
|
|
169
|
+
<Input
|
|
170
|
+
size="small"
|
|
171
|
+
autoComplete="off"
|
|
172
|
+
autoCorrect="off"
|
|
173
|
+
autoCapitalize="off"
|
|
174
|
+
spellCheck="false"
|
|
175
|
+
onChange={handleNameInputChange}
|
|
176
|
+
value={name}
|
|
177
|
+
placeholder={validatedWallet?.name || t('sendToWallet.enterName')}
|
|
178
|
+
aria-label={validatedWallet?.name || t('sendToWallet.enterName')}
|
|
179
|
+
inputProps={{ maxLength: 128 }}
|
|
180
|
+
/>
|
|
181
|
+
</SendToWalletCard>
|
|
182
|
+
{!validatedWallet && (
|
|
170
183
|
<SendToWalletCard
|
|
171
|
-
type={error?.type === '
|
|
184
|
+
type={error?.type === 'address' ? 'error' : 'default'}
|
|
172
185
|
>
|
|
173
|
-
<
|
|
186
|
+
<AddressInput
|
|
174
187
|
size="small"
|
|
175
188
|
autoComplete="off"
|
|
176
189
|
autoCorrect="off"
|
|
177
190
|
autoCapitalize="off"
|
|
178
191
|
spellCheck="false"
|
|
179
|
-
onChange={
|
|
180
|
-
value={
|
|
181
|
-
placeholder={
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
aria-label={
|
|
185
|
-
|
|
186
|
-
}
|
|
192
|
+
onChange={handleAddressInputChange}
|
|
193
|
+
value={address}
|
|
194
|
+
placeholder={t('sendToWallet.enterAddress', {
|
|
195
|
+
context: 'long',
|
|
196
|
+
})}
|
|
197
|
+
aria-label={t('sendToWallet.enterAddress', {
|
|
198
|
+
context: 'long',
|
|
199
|
+
})}
|
|
200
|
+
maxRows={2}
|
|
187
201
|
inputProps={{ maxLength: 128 }}
|
|
202
|
+
multiline
|
|
188
203
|
/>
|
|
189
204
|
</SendToWalletCard>
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
</Typography>
|
|
225
|
-
}
|
|
226
|
-
icon={<WarningRounded />}
|
|
227
|
-
/>
|
|
228
|
-
<SendToWalletButtonRow>
|
|
229
|
-
<Button variant="text" onClick={handleCancel} fullWidth>
|
|
230
|
-
{t('button.cancel')}
|
|
231
|
-
</Button>
|
|
232
|
-
<Button
|
|
233
|
-
variant="contained"
|
|
234
|
-
onClick={handleBookmark}
|
|
235
|
-
loading={isValidating}
|
|
236
|
-
loadingPosition="center"
|
|
237
|
-
fullWidth
|
|
238
|
-
focusRipple
|
|
239
|
-
>
|
|
240
|
-
{t('button.bookmark')}
|
|
241
|
-
</Button>
|
|
242
|
-
</SendToWalletButtonRow>
|
|
243
|
-
</SendToWalletSheetContainer>
|
|
244
|
-
</BottomSheet>
|
|
245
|
-
)
|
|
246
|
-
}
|
|
247
|
-
)
|
|
205
|
+
)}
|
|
206
|
+
{error ? (
|
|
207
|
+
<ValidationAlert icon={<ErrorIcon />}>
|
|
208
|
+
{error.message}
|
|
209
|
+
</ValidationAlert>
|
|
210
|
+
) : null}
|
|
211
|
+
</BookmarkInputFields>
|
|
212
|
+
<AlertMessage
|
|
213
|
+
title={
|
|
214
|
+
<Typography variant="body2" sx={{ color: 'text.primary' }}>
|
|
215
|
+
{t('warning.message.fundsLossPrevention')}
|
|
216
|
+
</Typography>
|
|
217
|
+
}
|
|
218
|
+
icon={<WarningRounded />}
|
|
219
|
+
/>
|
|
220
|
+
<SendToWalletButtonRow>
|
|
221
|
+
<Button variant="text" onClick={handleCancel} fullWidth>
|
|
222
|
+
{t('button.cancel')}
|
|
223
|
+
</Button>
|
|
224
|
+
<Button
|
|
225
|
+
variant="contained"
|
|
226
|
+
onClick={handleBookmark}
|
|
227
|
+
loading={isValidating}
|
|
228
|
+
loadingPosition="center"
|
|
229
|
+
fullWidth
|
|
230
|
+
focusRipple
|
|
231
|
+
>
|
|
232
|
+
{t('button.bookmark')}
|
|
233
|
+
</Button>
|
|
234
|
+
</SendToWalletButtonRow>
|
|
235
|
+
</SendToWalletSheetContainer>
|
|
236
|
+
</BottomSheet>
|
|
237
|
+
)
|
|
238
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Wallet from '@mui/icons-material/Wallet'
|
|
2
2
|
import WarningRounded from '@mui/icons-material/WarningRounded'
|
|
3
3
|
import { Button, Typography } from '@mui/material'
|
|
4
|
-
import type {
|
|
5
|
-
import {
|
|
4
|
+
import type { JSX, Ref, RefObject } from 'react'
|
|
5
|
+
import { useRef } from 'react'
|
|
6
6
|
import { useTranslation } from 'react-i18next'
|
|
7
7
|
import { BottomSheet } from '../../components/BottomSheet/BottomSheet.js'
|
|
8
8
|
import type { BottomSheetBase } from '../../components/BottomSheet/types.js'
|
|
@@ -28,9 +28,12 @@ interface ConfirmAddressSheetContentProps extends ConfirmAddressSheetProps {
|
|
|
28
28
|
onClose: () => void
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export const ConfirmAddressSheet
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
export const ConfirmAddressSheet = ({
|
|
32
|
+
ref,
|
|
33
|
+
...props
|
|
34
|
+
}: ConfirmAddressSheetProps & {
|
|
35
|
+
ref?: Ref<BottomSheetBase>
|
|
36
|
+
}): JSX.Element => {
|
|
34
37
|
const handleClose = () => {
|
|
35
38
|
;(ref as RefObject<BottomSheetBase>).current?.close()
|
|
36
39
|
}
|
|
@@ -40,7 +43,7 @@ export const ConfirmAddressSheet: ForwardRefExoticComponent<
|
|
|
40
43
|
<ConfirmAddressSheetContent {...props} onClose={handleClose} />
|
|
41
44
|
</BottomSheet>
|
|
42
45
|
)
|
|
43
|
-
}
|
|
46
|
+
}
|
|
44
47
|
|
|
45
48
|
const ConfirmAddressSheetContent: React.FC<ConfirmAddressSheetContentProps> = ({
|
|
46
49
|
validatedBookmark,
|
|
@@ -1,57 +1,33 @@
|
|
|
1
|
-
import type { Order } from '@lifi/sdk'
|
|
2
1
|
import Route from '@mui/icons-material/Route'
|
|
2
|
+
import { useNavigate } from '@tanstack/react-router'
|
|
3
3
|
import { useTranslation } from 'react-i18next'
|
|
4
|
-
import {
|
|
4
|
+
import { CardButton } from '../../components/Card/CardButton.js'
|
|
5
5
|
import { useSettingMonitor } from '../../hooks/useSettingMonitor.js'
|
|
6
6
|
import { useSettings } from '../../stores/settings/useSettings.js'
|
|
7
|
-
import {
|
|
7
|
+
import { navigationRoutes } from '../../utils/navigationRoutes.js'
|
|
8
8
|
import { BadgedValue } from './SettingsCard/BadgedValue.js'
|
|
9
|
-
import { SettingCardExpandable } from './SettingsCard/SettingCardExpandable.js'
|
|
10
|
-
|
|
11
|
-
const Priorities: Order[] = ['CHEAPEST', 'FASTEST']
|
|
12
9
|
|
|
13
10
|
export const RoutePrioritySettings: React.FC = () => {
|
|
14
11
|
const { t } = useTranslation()
|
|
15
|
-
const
|
|
12
|
+
const navigate = useNavigate()
|
|
16
13
|
const { isRoutePriorityChanged } = useSettingMonitor()
|
|
17
14
|
const { routePriority } = useSettings(['routePriority'])
|
|
18
|
-
const currentRoutePriority = routePriority ?? ''
|
|
19
15
|
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
routePriority: Order
|
|
23
|
-
) => {
|
|
24
|
-
setValue('routePriority', routePriority)
|
|
16
|
+
const handleClick = () => {
|
|
17
|
+
navigate({ to: navigationRoutes.routePriority })
|
|
25
18
|
}
|
|
26
19
|
|
|
27
20
|
return (
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
<BadgedValue badgeColor="info" showBadge={isRoutePriorityChanged}>
|
|
31
|
-
{t(`main.tags.${currentRoutePriority.toLowerCase()}` as any)}
|
|
32
|
-
</BadgedValue>
|
|
33
|
-
}
|
|
21
|
+
<CardButton
|
|
22
|
+
onClick={handleClick}
|
|
34
23
|
icon={<Route />}
|
|
35
24
|
title={t('settings.routePriority')}
|
|
36
25
|
>
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
>
|
|
44
|
-
{Priorities.map((priority) => {
|
|
45
|
-
return (
|
|
46
|
-
<Tab
|
|
47
|
-
key={priority}
|
|
48
|
-
label={t(`main.tags.${priority.toLowerCase()}` as any)}
|
|
49
|
-
value={priority}
|
|
50
|
-
disableRipple
|
|
51
|
-
/>
|
|
52
|
-
)
|
|
53
|
-
})}
|
|
54
|
-
</CardTabs>
|
|
55
|
-
</SettingCardExpandable>
|
|
26
|
+
<BadgedValue badgeColor="info" showBadge={isRoutePriorityChanged}>
|
|
27
|
+
{routePriority === 'FASTEST'
|
|
28
|
+
? t('settings.routePriorityOptions.fastest.title')
|
|
29
|
+
: t('settings.routePriorityOptions.cheapest.title')}
|
|
30
|
+
</BadgedValue>
|
|
31
|
+
</CardButton>
|
|
56
32
|
)
|
|
57
33
|
}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { Collapse } from '@mui/material'
|
|
2
|
-
import type { PropsWithChildren, ReactNode } from 'react'
|
|
3
|
-
import {
|
|
4
|
-
type ForwardRefExoticComponent,
|
|
5
|
-
forwardRef,
|
|
6
|
-
type RefAttributes,
|
|
7
|
-
useId,
|
|
8
|
-
useImperativeHandle,
|
|
9
|
-
useRef,
|
|
10
|
-
} from 'react'
|
|
2
|
+
import type { JSX, PropsWithChildren, ReactNode, Ref } from 'react'
|
|
3
|
+
import { useId, useImperativeHandle, useRef } from 'react'
|
|
11
4
|
import { Card } from '../../../components/Card/Card.js'
|
|
12
5
|
import {
|
|
13
6
|
CardRowButton,
|
|
@@ -30,61 +23,61 @@ export interface SettingCardExpandableRef {
|
|
|
30
23
|
toggleExpanded: (forceExpanded?: boolean) => void
|
|
31
24
|
}
|
|
32
25
|
|
|
33
|
-
export const SettingCardExpandable
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
26
|
+
export const SettingCardExpandable = ({
|
|
27
|
+
icon,
|
|
28
|
+
title,
|
|
29
|
+
value,
|
|
30
|
+
children,
|
|
31
|
+
disabled,
|
|
32
|
+
keepValueVisible,
|
|
33
|
+
onEntered,
|
|
34
|
+
ref,
|
|
35
|
+
}: PropsWithChildren<SettingCardExpandableProps> & {
|
|
36
|
+
ref?: Ref<SettingCardExpandableRef>
|
|
37
|
+
}): JSX.Element => {
|
|
38
|
+
const { expanded, toggleExpanded } = useSettingsCardExpandable()
|
|
39
|
+
const buttonId = useId()
|
|
40
|
+
const collapseId = useId()
|
|
41
|
+
const buttonRef = useRef<HTMLButtonElement>(null)
|
|
48
42
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
43
|
+
useImperativeHandle(
|
|
44
|
+
ref,
|
|
45
|
+
() => ({
|
|
46
|
+
element: buttonRef.current,
|
|
47
|
+
isExpanded: expanded,
|
|
48
|
+
toggleExpanded,
|
|
49
|
+
}),
|
|
50
|
+
[expanded, toggleExpanded]
|
|
51
|
+
)
|
|
58
52
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
)
|
|
53
|
+
return (
|
|
54
|
+
<Card sx={{ p: 1 }}>
|
|
55
|
+
<CardRowButton
|
|
56
|
+
ref={buttonRef}
|
|
57
|
+
id={buttonId}
|
|
58
|
+
aria-expanded={expanded}
|
|
59
|
+
aria-controls={collapseId}
|
|
60
|
+
onClick={disabled ? undefined : () => toggleExpanded()}
|
|
61
|
+
disableRipple
|
|
62
|
+
sx={{ p: 1, cursor: disabled ? 'default' : 'pointer' }}
|
|
63
|
+
>
|
|
64
|
+
<CardTitleContainer>
|
|
65
|
+
{icon}
|
|
66
|
+
<CardValue>{title}</CardValue>
|
|
67
|
+
</CardTitleContainer>
|
|
68
|
+
{(!expanded || keepValueVisible) && value}
|
|
69
|
+
</CardRowButton>
|
|
70
|
+
<Collapse
|
|
71
|
+
id={collapseId}
|
|
72
|
+
role="region"
|
|
73
|
+
aria-labelledby={buttonId}
|
|
74
|
+
in={expanded}
|
|
75
|
+
mountOnEnter
|
|
76
|
+
unmountOnExit
|
|
77
|
+
onEntered={onEntered}
|
|
78
|
+
>
|
|
79
|
+
{children}
|
|
80
|
+
</Collapse>
|
|
81
|
+
</Card>
|
|
82
|
+
)
|
|
83
|
+
}
|