@lifi/widget 2.9.3 → 3.0.0-alpha.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/AppProvider.js +2 -2
- package/AppRoutes.js +75 -67
- package/cjs/AppProvider.js +1 -1
- package/cjs/AppRoutes.js +74 -66
- package/cjs/components/ActiveTransactions/ActiveTransactionItem.js +1 -5
- package/cjs/components/ActiveTransactions/ActiveTransactions.js +2 -2
- package/cjs/components/AmountInput/AmountInputEndAdornment.js +9 -10
- package/cjs/components/AmountInput/FormPriceHelperText.js +1 -1
- package/cjs/components/BaseTransactionButton/BaseTransactionButton.js +5 -4
- package/cjs/components/Card/CardLabel.d.ts +1 -1
- package/cjs/components/ChainSelect/ChainSelect.js +8 -5
- package/cjs/components/ChainSelect/useChainSelect.js +21 -2
- package/cjs/components/GasMessage/GasMessage.style.js +3 -6
- package/cjs/components/GasMessage/GasSufficiencyMessage.js +2 -1
- package/cjs/components/Header/Header.style.d.ts +8 -0
- package/cjs/components/Header/Header.style.js +16 -1
- package/cjs/components/Header/NavigationHeader.d.ts +1 -0
- package/cjs/components/Header/NavigationHeader.js +15 -8
- package/cjs/components/Header/NavigationTabs.js +2 -2
- package/cjs/components/Header/SettingsButton.d.ts +1 -0
- package/cjs/components/Header/SettingsButton.js +25 -0
- package/cjs/components/Header/SettingsButton.style.d.ts +11 -0
- package/cjs/components/Header/SettingsButton.style.js +43 -0
- package/cjs/components/Header/WalletHeader.js +11 -24
- package/cjs/components/Header/WalletMenu.d.ts +3 -1
- package/cjs/components/Header/WalletMenu.js +58 -24
- package/cjs/components/Header/WalletMenu.style.d.ts +1 -0
- package/cjs/components/Header/WalletMenu.style.js +27 -0
- package/cjs/components/Insurance/InsuranceCollapsed.js +1 -1
- package/cjs/components/NFT/NFT.js +3 -1
- package/cjs/components/NFT/types.d.ts +1 -1
- package/cjs/components/PoweredBy/PoweredBy.js +2 -1
- package/cjs/components/RouteCard/RouteCard.js +3 -3
- package/cjs/components/RouteCard/RouteCardEssentials.js +2 -1
- package/cjs/components/RouteCard/utils.d.ts +2 -3
- package/cjs/components/RouteCard/utils.js +4 -9
- package/cjs/components/SendToWallet/SendToWallet.js +24 -21
- package/cjs/components/SendToWallet/SendToWalletButton.js +3 -2
- package/{pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts → cjs/components/SettingsListItemButton.d.ts} +1 -1
- package/cjs/components/SettingsListItemButton.js +8 -0
- package/cjs/components/Step/DestinationWalletAddress.d.ts +2 -2
- package/cjs/components/Step/GasStepProcess.d.ts +2 -2
- package/cjs/components/Step/Step.d.ts +2 -2
- package/cjs/components/Step/Step.js +1 -1
- package/cjs/components/Step/StepList.d.ts +2 -2
- package/cjs/components/Step/StepList.js +4 -4
- package/cjs/components/Step/StepProcess.d.ts +2 -2
- package/cjs/components/Step/StepTimer.d.ts +2 -2
- package/cjs/components/StepActions/StepActions.d.ts +3 -3
- package/cjs/components/StepActions/StepActions.js +11 -14
- package/cjs/components/StepActions/types.d.ts +2 -2
- package/cjs/components/{Header/NavigationTabs.style.d.ts → Tabs/Tabs.style.d.ts} +2 -2
- package/cjs/components/{Header/NavigationTabs.style.js → Tabs/Tabs.style.js} +9 -31
- package/cjs/components/Tabs/index.d.ts +1 -0
- package/cjs/{providers/SDKProvider → components/Tabs}/index.js +1 -1
- package/cjs/components/Token/Token.d.ts +3 -3
- package/cjs/components/Token/Token.js +5 -5
- package/cjs/components/TokenList/TokenList.js +2 -2
- package/cjs/components/TokenList/TokenListItem.js +9 -5
- package/cjs/components/TokenList/TokenNotFound.js +1 -1
- package/cjs/components/TokenList/VirtualizedTokenList.js +2 -1
- package/cjs/config/queryClient.js +0 -4
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/index.d.ts +7 -1
- package/cjs/hooks/index.js +7 -1
- package/cjs/hooks/useAccount.d.ts +31 -0
- package/cjs/hooks/useAccount.js +53 -0
- package/cjs/hooks/useAvailableChains.d.ts +6 -0
- package/cjs/hooks/useAvailableChains.js +36 -0
- package/cjs/hooks/useChain.js +3 -6
- package/cjs/hooks/useChains.d.ts +1 -1
- package/cjs/hooks/useChains.js +7 -38
- package/cjs/hooks/useFromTokenSufficiency.d.ts +3 -3
- package/cjs/hooks/useFromTokenSufficiency.js +39 -41
- package/cjs/hooks/useGasRecommendation.d.ts +2 -2
- package/cjs/hooks/useGasRecommendation.js +23 -18
- package/cjs/hooks/useGasRefuel.js +18 -11
- package/cjs/hooks/useGasSufficiency.d.ts +6 -7
- package/cjs/hooks/useGasSufficiency.js +68 -71
- package/cjs/hooks/useLanguages.d.ts +6 -0
- package/cjs/hooks/useLanguages.js +28 -0
- package/cjs/hooks/useProcessMessage.d.ts +3 -3
- package/cjs/hooks/useProcessMessage.js +32 -28
- package/cjs/hooks/useRequiredToAddress.d.ts +1 -0
- package/cjs/hooks/useRequiredToAddress.js +19 -0
- package/cjs/hooks/useRouteExecution.d.ts +2 -2
- package/cjs/hooks/useRouteExecution.js +44 -58
- package/cjs/hooks/useRoutes.d.ts +1 -1
- package/cjs/hooks/useRoutes.js +128 -113
- package/cjs/hooks/useSettingMonitor.d.ts +11 -0
- package/cjs/hooks/useSettingMonitor.js +57 -0
- package/cjs/hooks/useTokenAddressBalance.d.ts +1 -1
- package/cjs/hooks/useTokenBalance.d.ts +5 -3
- package/cjs/hooks/useTokenBalance.js +77 -47
- package/cjs/hooks/useTokenBalances.d.ts +3 -3
- package/cjs/hooks/useTokenBalances.js +34 -24
- package/cjs/hooks/useTokenSearch.js +18 -17
- package/cjs/hooks/useTokens.d.ts +2 -1
- package/cjs/hooks/useTokens.js +18 -15
- package/cjs/hooks/useTools.d.ts +1 -1
- package/cjs/hooks/useTools.js +12 -11
- package/cjs/hooks/useTransactionDetails.d.ts +4 -0
- package/cjs/hooks/useTransactionDetails.js +56 -0
- package/cjs/hooks/useTransactionHistory.d.ts +5 -0
- package/cjs/hooks/useTransactionHistory.js +39 -0
- package/cjs/i18n/en.json +18 -9
- package/cjs/i18n/fr.json +7 -4
- package/cjs/i18n/pt.json +7 -4
- package/cjs/i18n/tr.json +7 -4
- package/cjs/i18n/uk.json +7 -4
- package/cjs/i18n/zh.json +7 -4
- package/cjs/icons/index.d.ts +1 -3
- package/cjs/icons/index.js +1 -3
- package/cjs/icons/lifi.d.ts +1 -0
- package/cjs/icons/lifi.js +4 -0
- package/cjs/index.d.ts +2 -3
- package/cjs/index.js +4 -4
- package/cjs/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +2 -2
- package/cjs/pages/LanguagesPage/LanguagesPage.d.ts +2 -0
- package/cjs/pages/LanguagesPage/LanguagesPage.js +22 -0
- package/cjs/pages/LanguagesPage/index.d.ts +1 -0
- package/cjs/pages/LanguagesPage/index.js +17 -0
- package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +15 -5
- package/cjs/pages/SelectWalletPage/EVMListItemButton.d.ts +8 -0
- package/cjs/pages/SelectWalletPage/EVMListItemButton.js +40 -0
- package/cjs/pages/SelectWalletPage/SVMListItemButton.d.ts +6 -0
- package/cjs/pages/SelectWalletPage/SVMListItemButton.js +34 -0
- package/cjs/pages/SelectWalletPage/SelectWalletPage.js +31 -32
- package/cjs/pages/SelectWalletPage/utils.d.ts +3 -0
- package/cjs/pages/SelectWalletPage/utils.js +21 -0
- package/{pages/SettingsPage/EnabledToolsButton.d.ts → cjs/pages/SettingsPage/BridgeAndExchangeSettings.d.ts} +1 -1
- package/cjs/pages/SettingsPage/BridgeAndExchangeSettings.js +36 -0
- package/cjs/pages/SettingsPage/GasPriceSettings.d.ts +2 -0
- package/cjs/pages/SettingsPage/GasPriceSettings.js +21 -0
- package/cjs/pages/SettingsPage/LanguageSetting.d.ts +2 -0
- package/cjs/pages/SettingsPage/LanguageSetting.js +26 -0
- package/cjs/pages/SettingsPage/ResetSettingsButton.js +3 -30
- package/cjs/pages/SettingsPage/RoutePrioritySettings.d.ts +2 -0
- package/cjs/pages/SettingsPage/RoutePrioritySettings.js +25 -0
- package/cjs/pages/SettingsPage/SendToWalletOptionSetting.d.ts +1 -0
- package/cjs/pages/SettingsPage/{ShowDestinationWallet.js → SendToWalletOptionSetting.js} +6 -9
- package/cjs/pages/SettingsPage/SettingsCard/BadgedValue.d.ts +8 -0
- package/cjs/pages/SettingsPage/SettingsCard/BadgedValue.js +7 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCard.d.ts +2 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCard.js +11 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +19 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCard.style.js +53 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCardButton.d.ts +7 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCardButton.js +8 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCardExpandable.d.ts +7 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +16 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingsAccordian.d.ts +6 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingsAccordian.js +36 -0
- package/cjs/pages/SettingsPage/SettingsCard/index.d.ts +6 -0
- package/cjs/pages/SettingsPage/SettingsCard/index.js +22 -0
- package/cjs/pages/SettingsPage/SettingsCard/types.d.ts +5 -0
- package/cjs/pages/SettingsPage/SettingsPage.js +9 -8
- package/cjs/pages/SettingsPage/SlippageSettings/SlippageSettings.d.ts +2 -0
- package/cjs/pages/SettingsPage/SlippageSettings/SlippageSettings.js +51 -0
- package/cjs/pages/SettingsPage/SlippageSettings/SlippageSettings.style.d.ts +16 -0
- package/cjs/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +74 -0
- package/cjs/pages/SettingsPage/SlippageSettings/index.d.ts +1 -0
- package/cjs/pages/SettingsPage/SlippageSettings/index.js +17 -0
- package/cjs/pages/SettingsPage/ThemeSettings.d.ts +2 -0
- package/cjs/pages/SettingsPage/ThemeSettings.js +39 -0
- package/cjs/pages/TransactionDetailsPage/ContactSupportButton.js +2 -2
- package/cjs/pages/TransactionDetailsPage/TransactionDetailsPage.js +33 -28
- package/cjs/pages/TransactionDetailsPage/TransactionDetailsSkeleton.d.ts +1 -0
- package/cjs/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js +31 -0
- package/cjs/pages/TransactionHistoryPage/TransactionHistoryItem.d.ts +4 -2
- package/cjs/pages/TransactionHistoryPage/TransactionHistoryItem.js +34 -7
- package/cjs/pages/TransactionHistoryPage/TransactionHistoryPage.js +21 -22
- package/cjs/pages/TransactionHistoryPage/TransactionHistorySkeleton.d.ts +1 -0
- package/cjs/pages/TransactionHistoryPage/TransactionHistorySkeleton.js +26 -0
- package/cjs/pages/TransactionHistoryPage/constants.d.ts +1 -0
- package/cjs/pages/TransactionHistoryPage/constants.js +4 -0
- package/cjs/pages/TransactionPage/ExchangeRateBottomSheet.js +11 -10
- package/cjs/pages/TransactionPage/StartTransactionButton.js +2 -2
- package/cjs/pages/TransactionPage/StatusBottomSheet.js +12 -8
- package/cjs/pages/TransactionPage/TransactionPage.js +1 -1
- package/cjs/providers/FormProvider/FormUpdater.js +4 -4
- package/cjs/providers/I18nProvider/I18nProvider.js +3 -7
- package/cjs/providers/I18nProvider/types.d.ts +4 -3
- package/cjs/providers/WalletProvider/EVMProvider.d.ts +3 -0
- package/cjs/providers/WalletProvider/EVMProvider.js +79 -0
- package/cjs/providers/WalletProvider/SDKProviders.d.ts +1 -0
- package/cjs/providers/WalletProvider/SDKProviders.js +31 -0
- package/cjs/providers/WalletProvider/SolanaProvider.d.ts +3 -0
- package/cjs/providers/WalletProvider/SolanaProvider.js +35 -0
- package/cjs/providers/WalletProvider/WalletProvider.d.ts +1 -15
- package/cjs/providers/WalletProvider/WalletProvider.js +5 -183
- package/cjs/providers/WalletProvider/index.d.ts +1 -1
- package/cjs/providers/WalletProvider/index.js +1 -1
- package/cjs/providers/WalletProvider/utils.d.ts +3 -0
- package/cjs/providers/WalletProvider/utils.js +25 -0
- package/cjs/providers/WidgetProvider/WidgetProvider.js +51 -35
- package/cjs/providers/index.d.ts +0 -1
- package/cjs/providers/index.js +0 -1
- package/cjs/stores/chains/ChainOrderStore.js +24 -0
- package/cjs/stores/header/useHeaderStore.d.ts +1 -1
- package/cjs/stores/header/useHeaderStore.js +2 -2
- package/cjs/stores/routes/createRouteExecutionStore.js +6 -60
- package/cjs/stores/routes/index.d.ts +0 -1
- package/cjs/stores/routes/index.js +0 -1
- package/cjs/stores/routes/types.d.ts +2 -2
- package/cjs/stores/routes/utils.d.ts +8 -8
- package/cjs/stores/routes/utils.js +7 -5
- package/cjs/stores/settings/useSettingsStore.js +2 -4
- package/cjs/stores/settings/useSplitSubvariantStore.d.ts +1 -1
- package/cjs/stores/settings/useSplitSubvariantStore.js +2 -2
- package/cjs/types/events.d.ts +6 -5
- package/cjs/types/events.js +1 -1
- package/cjs/types/widget.d.ts +7 -14
- package/cjs/utils/colors.d.ts +3 -0
- package/cjs/utils/colors.js +13 -1
- package/cjs/utils/converters.d.ts +3 -0
- package/cjs/utils/converters.js +172 -0
- package/cjs/utils/format.d.ts +1 -1
- package/cjs/utils/format.js +5 -12
- package/cjs/utils/index.d.ts +1 -0
- package/cjs/utils/index.js +1 -0
- package/cjs/utils/navigationRoutes.d.ts +1 -0
- package/cjs/utils/navigationRoutes.js +3 -1
- package/cjs/utils/svm.d.ts +1 -0
- package/cjs/utils/svm.js +14 -0
- package/components/ActiveTransactions/ActiveTransactionItem.js +1 -5
- package/components/ActiveTransactions/ActiveTransactions.js +2 -2
- package/components/AmountInput/AmountInputEndAdornment.js +10 -11
- package/components/AmountInput/FormPriceHelperText.js +1 -1
- package/components/BaseTransactionButton/BaseTransactionButton.js +6 -5
- package/components/Card/CardLabel.d.ts +1 -1
- package/components/ChainSelect/ChainSelect.js +8 -5
- package/components/ChainSelect/useChainSelect.js +22 -3
- package/components/GasMessage/GasMessage.style.js +3 -6
- package/components/GasMessage/GasSufficiencyMessage.js +2 -1
- package/components/Header/Header.style.d.ts +8 -0
- package/components/Header/Header.style.js +16 -1
- package/components/Header/NavigationHeader.d.ts +1 -0
- package/components/Header/NavigationHeader.js +16 -10
- package/components/Header/NavigationTabs.js +3 -3
- package/components/Header/SettingsButton.d.ts +1 -0
- package/components/Header/SettingsButton.js +21 -0
- package/components/Header/SettingsButton.style.d.ts +11 -0
- package/components/Header/SettingsButton.style.js +40 -0
- package/components/Header/WalletHeader.js +15 -28
- package/components/Header/WalletMenu.d.ts +3 -1
- package/components/Header/WalletMenu.js +58 -25
- package/components/Header/WalletMenu.style.d.ts +1 -0
- package/components/Header/WalletMenu.style.js +24 -0
- package/components/Insurance/InsuranceCollapsed.js +1 -1
- package/components/NFT/NFT.js +3 -1
- package/components/NFT/types.d.ts +1 -1
- package/components/PoweredBy/PoweredBy.js +2 -1
- package/components/RouteCard/RouteCard.js +3 -3
- package/components/RouteCard/RouteCardEssentials.js +2 -1
- package/components/RouteCard/utils.d.ts +2 -3
- package/components/RouteCard/utils.js +4 -9
- package/components/SendToWallet/SendToWallet.js +26 -23
- package/components/SendToWallet/SendToWalletButton.js +5 -4
- package/{cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts → components/SettingsListItemButton.d.ts} +1 -1
- package/components/SettingsListItemButton.js +5 -0
- package/components/Step/DestinationWalletAddress.d.ts +2 -2
- package/components/Step/GasStepProcess.d.ts +2 -2
- package/components/Step/Step.d.ts +2 -2
- package/components/Step/Step.js +2 -2
- package/components/Step/StepList.d.ts +2 -2
- package/components/Step/StepList.js +4 -4
- package/components/Step/StepProcess.d.ts +2 -2
- package/components/Step/StepTimer.d.ts +2 -2
- package/components/StepActions/StepActions.d.ts +3 -3
- package/components/StepActions/StepActions.js +12 -15
- package/components/StepActions/types.d.ts +2 -2
- package/components/{Header/NavigationTabs.style.d.ts → Tabs/Tabs.style.d.ts} +2 -2
- package/components/Tabs/Tabs.style.js +36 -0
- package/components/Tabs/index.d.ts +1 -0
- package/components/Tabs/index.js +1 -0
- package/components/Token/Token.d.ts +3 -3
- package/components/Token/Token.js +5 -5
- package/components/TokenList/TokenList.js +4 -4
- package/components/TokenList/TokenListItem.js +9 -6
- package/components/TokenList/TokenNotFound.js +2 -2
- package/components/TokenList/VirtualizedTokenList.js +2 -1
- package/config/queryClient.js +0 -4
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/index.d.ts +7 -1
- package/hooks/index.js +7 -1
- package/hooks/useAccount.d.ts +31 -0
- package/hooks/useAccount.js +48 -0
- package/hooks/useAvailableChains.d.ts +6 -0
- package/hooks/useAvailableChains.js +32 -0
- package/hooks/useChain.js +3 -6
- package/hooks/useChains.d.ts +1 -1
- package/hooks/useChains.js +9 -40
- package/hooks/useFromTokenSufficiency.d.ts +3 -3
- package/hooks/useFromTokenSufficiency.js +41 -43
- package/hooks/useGasRecommendation.d.ts +2 -2
- package/hooks/useGasRecommendation.js +23 -18
- package/hooks/useGasRefuel.js +19 -12
- package/hooks/useGasSufficiency.d.ts +6 -7
- package/hooks/useGasSufficiency.js +69 -72
- package/hooks/useLanguages.d.ts +6 -0
- package/hooks/useLanguages.js +24 -0
- package/hooks/useProcessMessage.d.ts +3 -3
- package/hooks/useProcessMessage.js +33 -29
- package/hooks/useRequiredToAddress.d.ts +1 -0
- package/hooks/useRequiredToAddress.js +15 -0
- package/hooks/useRouteExecution.d.ts +2 -2
- package/hooks/useRouteExecution.js +44 -58
- package/hooks/useRoutes.d.ts +1 -1
- package/hooks/useRoutes.js +131 -116
- package/hooks/useSettingMonitor.d.ts +11 -0
- package/hooks/useSettingMonitor.js +53 -0
- package/hooks/useTokenAddressBalance.d.ts +1 -1
- package/hooks/useTokenBalance.d.ts +5 -3
- package/hooks/useTokenBalance.js +74 -45
- package/hooks/useTokenBalances.d.ts +3 -3
- package/hooks/useTokenBalances.js +34 -24
- package/hooks/useTokenSearch.js +18 -17
- package/hooks/useTokens.d.ts +2 -1
- package/hooks/useTokens.js +19 -16
- package/hooks/useTools.d.ts +1 -1
- package/hooks/useTools.js +13 -12
- package/hooks/useTransactionDetails.d.ts +4 -0
- package/hooks/useTransactionDetails.js +52 -0
- package/hooks/useTransactionHistory.d.ts +5 -0
- package/hooks/useTransactionHistory.js +35 -0
- package/i18n/en.json +18 -9
- package/i18n/fr.json +7 -4
- package/i18n/pt.json +7 -4
- package/i18n/tr.json +7 -4
- package/i18n/uk.json +7 -4
- package/i18n/zh.json +7 -4
- package/icons/index.d.ts +1 -3
- package/icons/index.js +1 -3
- package/icons/lifi.d.ts +1 -0
- package/icons/lifi.js +1 -0
- package/index.d.ts +2 -3
- package/index.js +2 -4
- package/package.json +19 -19
- package/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +2 -2
- package/pages/LanguagesPage/LanguagesPage.d.ts +2 -0
- package/pages/LanguagesPage/LanguagesPage.js +18 -0
- package/pages/LanguagesPage/index.d.ts +1 -0
- package/pages/LanguagesPage/index.js +1 -0
- package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +16 -6
- package/pages/SelectWalletPage/EVMListItemButton.d.ts +8 -0
- package/pages/SelectWalletPage/EVMListItemButton.js +36 -0
- package/pages/SelectWalletPage/SVMListItemButton.d.ts +6 -0
- package/pages/SelectWalletPage/SVMListItemButton.js +30 -0
- package/pages/SelectWalletPage/SelectWalletPage.js +34 -35
- package/pages/SelectWalletPage/utils.d.ts +3 -0
- package/pages/SelectWalletPage/utils.js +17 -0
- package/{cjs/pages/SettingsPage/EnabledToolsButton.d.ts → pages/SettingsPage/BridgeAndExchangeSettings.d.ts} +1 -1
- package/pages/SettingsPage/BridgeAndExchangeSettings.js +32 -0
- package/pages/SettingsPage/GasPriceSettings.d.ts +2 -0
- package/pages/SettingsPage/GasPriceSettings.js +17 -0
- package/pages/SettingsPage/LanguageSetting.d.ts +2 -0
- package/pages/SettingsPage/LanguageSetting.js +22 -0
- package/pages/SettingsPage/ResetSettingsButton.js +4 -31
- package/pages/SettingsPage/RoutePrioritySettings.d.ts +2 -0
- package/pages/SettingsPage/RoutePrioritySettings.js +21 -0
- package/pages/SettingsPage/SendToWalletOptionSetting.d.ts +1 -0
- package/pages/SettingsPage/{ShowDestinationWallet.js → SendToWalletOptionSetting.js} +4 -7
- package/pages/SettingsPage/SettingsCard/BadgedValue.d.ts +8 -0
- package/pages/SettingsPage/SettingsCard/BadgedValue.js +3 -0
- package/pages/SettingsPage/SettingsCard/SettingCard.d.ts +2 -0
- package/pages/SettingsPage/SettingsCard/SettingCard.js +7 -0
- package/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +19 -0
- package/pages/SettingsPage/SettingsCard/SettingCard.style.js +50 -0
- package/pages/SettingsPage/SettingsCard/SettingCardButton.d.ts +7 -0
- package/pages/SettingsPage/SettingsCard/SettingCardButton.js +4 -0
- package/pages/SettingsPage/SettingsCard/SettingCardExpandable.d.ts +7 -0
- package/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +12 -0
- package/pages/SettingsPage/SettingsCard/SettingsAccordian.d.ts +6 -0
- package/pages/SettingsPage/SettingsCard/SettingsAccordian.js +31 -0
- package/pages/SettingsPage/SettingsCard/index.d.ts +6 -0
- package/pages/SettingsPage/SettingsCard/index.js +6 -0
- package/pages/SettingsPage/SettingsCard/types.d.ts +5 -0
- package/pages/SettingsPage/SettingsPage.js +10 -9
- package/pages/SettingsPage/SlippageSettings/SlippageSettings.d.ts +2 -0
- package/pages/SettingsPage/SlippageSettings/SlippageSettings.js +47 -0
- package/pages/SettingsPage/SlippageSettings/SlippageSettings.style.d.ts +16 -0
- package/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +71 -0
- package/pages/SettingsPage/SlippageSettings/index.d.ts +1 -0
- package/pages/SettingsPage/SlippageSettings/index.js +1 -0
- package/pages/SettingsPage/ThemeSettings.d.ts +2 -0
- package/pages/SettingsPage/ThemeSettings.js +35 -0
- package/pages/TransactionDetailsPage/ContactSupportButton.js +2 -2
- package/pages/TransactionDetailsPage/TransactionDetailsPage.js +38 -33
- package/pages/TransactionDetailsPage/TransactionDetailsSkeleton.d.ts +1 -0
- package/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js +27 -0
- package/pages/TransactionHistoryPage/TransactionHistoryItem.d.ts +4 -2
- package/pages/TransactionHistoryPage/TransactionHistoryItem.js +34 -7
- package/pages/TransactionHistoryPage/TransactionHistoryPage.js +24 -25
- package/pages/TransactionHistoryPage/TransactionHistorySkeleton.d.ts +1 -0
- package/pages/TransactionHistoryPage/TransactionHistorySkeleton.js +22 -0
- package/pages/TransactionHistoryPage/constants.d.ts +1 -0
- package/pages/TransactionHistoryPage/constants.js +1 -0
- package/pages/TransactionPage/ExchangeRateBottomSheet.js +11 -10
- package/pages/TransactionPage/StartTransactionButton.js +2 -2
- package/pages/TransactionPage/StatusBottomSheet.js +14 -10
- package/pages/TransactionPage/TransactionPage.js +1 -1
- package/providers/FormProvider/FormUpdater.js +4 -4
- package/providers/I18nProvider/I18nProvider.js +4 -8
- package/providers/I18nProvider/types.d.ts +4 -3
- package/providers/WalletProvider/EVMProvider.d.ts +3 -0
- package/providers/WalletProvider/EVMProvider.js +74 -0
- package/providers/WalletProvider/SDKProviders.d.ts +1 -0
- package/providers/WalletProvider/SDKProviders.js +27 -0
- package/providers/WalletProvider/SolanaProvider.d.ts +3 -0
- package/providers/WalletProvider/SolanaProvider.js +30 -0
- package/providers/WalletProvider/WalletProvider.d.ts +1 -15
- package/providers/WalletProvider/WalletProvider.js +5 -181
- package/providers/WalletProvider/index.d.ts +1 -1
- package/providers/WalletProvider/index.js +1 -1
- package/providers/WalletProvider/utils.d.ts +3 -0
- package/providers/WalletProvider/utils.js +21 -0
- package/providers/WidgetProvider/WidgetProvider.js +52 -36
- package/providers/index.d.ts +0 -1
- package/providers/index.js +0 -1
- package/stores/chains/ChainOrderStore.js +25 -1
- package/stores/header/useHeaderStore.d.ts +1 -1
- package/stores/header/useHeaderStore.js +2 -2
- package/stores/routes/createRouteExecutionStore.js +6 -60
- package/stores/routes/index.d.ts +0 -1
- package/stores/routes/index.js +0 -1
- package/stores/routes/types.d.ts +2 -2
- package/stores/routes/utils.d.ts +8 -8
- package/stores/routes/utils.js +5 -3
- package/stores/settings/useSettingsStore.js +2 -4
- package/stores/settings/useSplitSubvariantStore.d.ts +1 -1
- package/stores/settings/useSplitSubvariantStore.js +2 -2
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/events.d.ts +6 -5
- package/types/events.js +1 -1
- package/types/widget.d.ts +7 -14
- package/utils/colors.d.ts +3 -0
- package/utils/colors.js +10 -1
- package/utils/converters.d.ts +3 -0
- package/utils/converters.js +168 -0
- package/utils/format.d.ts +1 -1
- package/utils/format.js +5 -12
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/navigationRoutes.d.ts +1 -0
- package/utils/navigationRoutes.js +3 -1
- package/utils/svm.d.ts +1 -0
- package/utils/svm.js +10 -0
- package/cjs/components/LiFiLogo.d.ts +0 -5
- package/cjs/components/LiFiLogo.js +0 -10
- package/cjs/fonts/Inter-Black.woff +0 -0
- package/cjs/fonts/Inter-Black.woff2 +0 -0
- package/cjs/fonts/Inter-BlackItalic.woff +0 -0
- package/cjs/fonts/Inter-BlackItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Bold.woff +0 -0
- package/cjs/fonts/Inter-Bold.woff2 +0 -0
- package/cjs/fonts/Inter-BoldItalic.woff +0 -0
- package/cjs/fonts/Inter-BoldItalic.woff2 +0 -0
- package/cjs/fonts/Inter-ExtraBold.woff +0 -0
- package/cjs/fonts/Inter-ExtraBold.woff2 +0 -0
- package/cjs/fonts/Inter-ExtraBoldItalic.woff +0 -0
- package/cjs/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
- package/cjs/fonts/Inter-ExtraLight.woff +0 -0
- package/cjs/fonts/Inter-ExtraLight.woff2 +0 -0
- package/cjs/fonts/Inter-ExtraLightItalic.woff +0 -0
- package/cjs/fonts/Inter-ExtraLightItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Italic.woff +0 -0
- package/cjs/fonts/Inter-Italic.woff2 +0 -0
- package/cjs/fonts/Inter-Light.woff +0 -0
- package/cjs/fonts/Inter-Light.woff2 +0 -0
- package/cjs/fonts/Inter-LightItalic.woff +0 -0
- package/cjs/fonts/Inter-LightItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Medium.woff +0 -0
- package/cjs/fonts/Inter-Medium.woff2 +0 -0
- package/cjs/fonts/Inter-MediumItalic.woff +0 -0
- package/cjs/fonts/Inter-MediumItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Regular.woff +0 -0
- package/cjs/fonts/Inter-Regular.woff2 +0 -0
- package/cjs/fonts/Inter-SemiBold.woff +0 -0
- package/cjs/fonts/Inter-SemiBold.woff2 +0 -0
- package/cjs/fonts/Inter-SemiBoldItalic.woff +0 -0
- package/cjs/fonts/Inter-SemiBoldItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Thin.woff +0 -0
- package/cjs/fonts/Inter-Thin.woff2 +0 -0
- package/cjs/fonts/Inter-ThinItalic.woff +0 -0
- package/cjs/fonts/Inter-ThinItalic.woff2 +0 -0
- package/cjs/fonts/Inter-italic.var.woff2 +0 -0
- package/cjs/fonts/Inter-roman.var.woff2 +0 -0
- package/cjs/fonts/Inter.var.woff2 +0 -0
- package/cjs/fonts/inter.css +0 -217
- package/cjs/hooks/useGetTokenBalancesWithRetry.d.ts +0 -3
- package/cjs/hooks/useGetTokenBalancesWithRetry.js +0 -33
- package/cjs/icons/LiFiFullLogo.d.ts +0 -2
- package/cjs/icons/LiFiFullLogo.js +0 -6
- package/cjs/icons/LiFiLogo.d.ts +0 -2
- package/cjs/icons/LiFiLogo.js +0 -6
- package/cjs/icons/LiFiToolLogo.d.ts +0 -2
- package/cjs/icons/LiFiToolLogo.js +0 -6
- package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.js +0 -8
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.d.ts +0 -2
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +0 -27
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +0 -4
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.js +0 -19
- package/cjs/pages/SettingsPage/EnabledToolsButton.js +0 -25
- package/cjs/pages/SettingsPage/EnabledToolsButton.style.d.ts +0 -5
- package/cjs/pages/SettingsPage/EnabledToolsButton.style.js +0 -17
- package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
- package/cjs/pages/SettingsPage/GasPriceSelect.js +0 -17
- package/cjs/pages/SettingsPage/LanguageSelect.d.ts +0 -2
- package/cjs/pages/SettingsPage/LanguageSelect.js +0 -37
- package/cjs/pages/SettingsPage/RoutePrioritySelect.d.ts +0 -2
- package/cjs/pages/SettingsPage/RoutePrioritySelect.js +0 -23
- package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
- package/cjs/pages/SettingsPage/SlippageInput.d.ts +0 -1
- package/cjs/pages/SettingsPage/SlippageInput.js +0 -30
- package/cjs/providers/SDKProvider/SDKProvider.d.ts +0 -4
- package/cjs/providers/SDKProvider/SDKProvider.js +0 -41
- package/cjs/providers/SDKProvider/index.d.ts +0 -1
- package/cjs/providers/WalletProvider/types.d.ts +0 -17
- package/cjs/stores/routes/useTransactionHistory.d.ts +0 -2
- package/cjs/stores/routes/useTransactionHistory.js +0 -15
- package/components/Header/NavigationTabs.style.js +0 -58
- package/components/LiFiLogo.d.ts +0 -5
- package/components/LiFiLogo.js +0 -6
- package/fonts/Inter-Black.woff +0 -0
- package/fonts/Inter-Black.woff2 +0 -0
- package/fonts/Inter-BlackItalic.woff +0 -0
- package/fonts/Inter-BlackItalic.woff2 +0 -0
- package/fonts/Inter-Bold.woff +0 -0
- package/fonts/Inter-Bold.woff2 +0 -0
- package/fonts/Inter-BoldItalic.woff +0 -0
- package/fonts/Inter-BoldItalic.woff2 +0 -0
- package/fonts/Inter-ExtraBold.woff +0 -0
- package/fonts/Inter-ExtraBold.woff2 +0 -0
- package/fonts/Inter-ExtraBoldItalic.woff +0 -0
- package/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
- package/fonts/Inter-ExtraLight.woff +0 -0
- package/fonts/Inter-ExtraLight.woff2 +0 -0
- package/fonts/Inter-ExtraLightItalic.woff +0 -0
- package/fonts/Inter-ExtraLightItalic.woff2 +0 -0
- package/fonts/Inter-Italic.woff +0 -0
- package/fonts/Inter-Italic.woff2 +0 -0
- package/fonts/Inter-Light.woff +0 -0
- package/fonts/Inter-Light.woff2 +0 -0
- package/fonts/Inter-LightItalic.woff +0 -0
- package/fonts/Inter-LightItalic.woff2 +0 -0
- package/fonts/Inter-Medium.woff +0 -0
- package/fonts/Inter-Medium.woff2 +0 -0
- package/fonts/Inter-MediumItalic.woff +0 -0
- package/fonts/Inter-MediumItalic.woff2 +0 -0
- package/fonts/Inter-Regular.woff +0 -0
- package/fonts/Inter-Regular.woff2 +0 -0
- package/fonts/Inter-SemiBold.woff +0 -0
- package/fonts/Inter-SemiBold.woff2 +0 -0
- package/fonts/Inter-SemiBoldItalic.woff +0 -0
- package/fonts/Inter-SemiBoldItalic.woff2 +0 -0
- package/fonts/Inter-Thin.woff +0 -0
- package/fonts/Inter-Thin.woff2 +0 -0
- package/fonts/Inter-ThinItalic.woff +0 -0
- package/fonts/Inter-ThinItalic.woff2 +0 -0
- package/fonts/Inter-italic.var.woff2 +0 -0
- package/fonts/Inter-roman.var.woff2 +0 -0
- package/fonts/Inter.var.woff2 +0 -0
- package/fonts/inter.css +0 -217
- package/hooks/useGetTokenBalancesWithRetry.d.ts +0 -3
- package/hooks/useGetTokenBalancesWithRetry.js +0 -29
- package/icons/LiFiFullLogo.d.ts +0 -2
- package/icons/LiFiFullLogo.js +0 -2
- package/icons/LiFiLogo.d.ts +0 -2
- package/icons/LiFiLogo.js +0 -2
- package/icons/LiFiToolLogo.d.ts +0 -2
- package/icons/LiFiToolLogo.js +0 -2
- package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.js +0 -5
- package/pages/SettingsPage/ColorSchemeButtonGroup.d.ts +0 -2
- package/pages/SettingsPage/ColorSchemeButtonGroup.js +0 -23
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +0 -4
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.js +0 -16
- package/pages/SettingsPage/EnabledToolsButton.js +0 -21
- package/pages/SettingsPage/EnabledToolsButton.style.d.ts +0 -5
- package/pages/SettingsPage/EnabledToolsButton.style.js +0 -14
- package/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
- package/pages/SettingsPage/GasPriceSelect.js +0 -13
- package/pages/SettingsPage/LanguageSelect.d.ts +0 -2
- package/pages/SettingsPage/LanguageSelect.js +0 -33
- package/pages/SettingsPage/RoutePrioritySelect.d.ts +0 -2
- package/pages/SettingsPage/RoutePrioritySelect.js +0 -19
- package/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
- package/pages/SettingsPage/SlippageInput.d.ts +0 -1
- package/pages/SettingsPage/SlippageInput.js +0 -26
- package/providers/SDKProvider/SDKProvider.d.ts +0 -4
- package/providers/SDKProvider/SDKProvider.js +0 -36
- package/providers/SDKProvider/index.d.ts +0 -1
- package/providers/SDKProvider/index.js +0 -1
- package/providers/WalletProvider/types.d.ts +0 -17
- package/stores/routes/useTransactionHistory.d.ts +0 -2
- package/stores/routes/useTransactionHistory.js +0 -11
- /package/cjs/{providers/WalletProvider → pages/SettingsPage/SettingsCard}/types.js +0 -0
- /package/{providers/WalletProvider → pages/SettingsPage/SettingsCard}/types.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.0",
|
|
4
4
|
"description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -39,31 +39,31 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@emotion/react": "^11.11.1",
|
|
41
41
|
"@emotion/styled": "^11.11.0",
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"@
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
51
|
-
"@tanstack/react-query": "^
|
|
42
|
+
"@lifi/sdk": "^3.0.0-alpha.36",
|
|
43
|
+
"@lifi/wallet-management": "^3.0.0-alpha.0",
|
|
44
|
+
"@mui/icons-material": "^5.14.19",
|
|
45
|
+
"@mui/lab": "^5.0.0-alpha.154",
|
|
46
|
+
"@mui/material": "^5.14.19",
|
|
47
|
+
"@solana/wallet-adapter-base": "^0.9.23",
|
|
48
|
+
"@solana/wallet-adapter-react": "^0.15.35",
|
|
49
|
+
"@solana/wallet-adapter-wallets": "^0.19.23",
|
|
50
|
+
"@solana/web3.js": "^1.87.6",
|
|
51
|
+
"@tanstack/react-query": "^5.12.0",
|
|
52
52
|
"@tanstack/react-virtual": "^3.0.0-beta.68",
|
|
53
|
-
"
|
|
54
|
-
"i18next": "^23.6.0",
|
|
55
|
-
"i18next-browser-languagedetector": "^7.1.0",
|
|
53
|
+
"i18next": "^23.7.7",
|
|
56
54
|
"microdiff": "^1.3.2",
|
|
57
55
|
"mitt": "^3.0.1",
|
|
58
56
|
"react": "^18.2.0",
|
|
59
57
|
"react-dom": "^18.2.0",
|
|
60
|
-
"react-hook-form": "^7.
|
|
61
|
-
"react-i18next": "^13.
|
|
62
|
-
"react-intersection-observer": "^9.5.
|
|
63
|
-
"react-router-dom": "^6.
|
|
58
|
+
"react-hook-form": "^7.48.2",
|
|
59
|
+
"react-i18next": "^13.5.0",
|
|
60
|
+
"react-intersection-observer": "^9.5.3",
|
|
61
|
+
"react-router-dom": "^6.20.0",
|
|
64
62
|
"react-timer-hook": "^3.0.7",
|
|
65
63
|
"uuid": "^9.0.1",
|
|
66
|
-
"
|
|
64
|
+
"viem": "^2.0.0-beta.6",
|
|
65
|
+
"wagmi": "^2.0.0-beta.5",
|
|
66
|
+
"zustand": "^4.4.7"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@types/react": "^18.0.0",
|
|
@@ -5,12 +5,12 @@ import { useCallback, useEffect, useState } from 'react';
|
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { ActiveTransactionItem } from '../../components/ActiveTransactions';
|
|
7
7
|
import { Dialog } from '../../components/Dialog';
|
|
8
|
-
import {
|
|
8
|
+
import { useAccount } from '../../hooks';
|
|
9
9
|
import { useExecutingRoutesIds, useHeaderStoreContext, useRouteExecutionStore, } from '../../stores';
|
|
10
10
|
import { ActiveTransactionsEmpty } from './ActiveTransactionsEmpty';
|
|
11
11
|
export const ActiveTransactionsPage = () => {
|
|
12
12
|
const { t } = useTranslation();
|
|
13
|
-
const { account } =
|
|
13
|
+
const { account } = useAccount();
|
|
14
14
|
const executingRoutes = useExecutingRoutesIds(account.address);
|
|
15
15
|
const deleteRoutes = useRouteExecutionStore((store) => store.deleteRoutes);
|
|
16
16
|
const headerStoreContext = useHeaderStoreContext();
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import CheckIcon from '@mui/icons-material/Check';
|
|
4
|
+
import { Container, List } from '@mui/material';
|
|
5
|
+
import { ListItemText } from '../../components/ListItemText';
|
|
6
|
+
import { SettingsListItemButton } from '../../components/SettingsListItemButton';
|
|
7
|
+
import { useLanguages } from '../../hooks';
|
|
8
|
+
export const LanguagesPage = () => {
|
|
9
|
+
const { selectedLanguageCode, availableLanguages, setLanguageWithCode } = useLanguages();
|
|
10
|
+
const { t } = useTranslation();
|
|
11
|
+
if (availableLanguages.length < 1) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return (_jsx(Container, { disableGutters: true, children: _jsx(List, { sx: {
|
|
15
|
+
paddingLeft: 1.5,
|
|
16
|
+
paddingRight: 1.5,
|
|
17
|
+
}, children: availableLanguages.map((language) => (_jsxs(SettingsListItemButton, { onClick: () => setLanguageWithCode(language), children: [_jsx(ListItemText, { primary: t('language.name', { lng: language }) }), selectedLanguageCode === language && _jsx(CheckIcon, { color: "primary" })] }, language))) }) }));
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LanguagesPage';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LanguagesPage';
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import CheckIcon from '@mui/icons-material/Check';
|
|
3
5
|
import CheckBoxOutlineBlankOutlinedIcon from '@mui/icons-material/CheckBoxOutlineBlankOutlined';
|
|
4
6
|
import CheckBoxOutlinedIcon from '@mui/icons-material/CheckBoxOutlined';
|
|
5
7
|
import IndeterminateCheckBoxOutlinedIcon from '@mui/icons-material/IndeterminateCheckBoxOutlined';
|
|
6
|
-
import { Avatar, Container, IconButton, List, ListItemAvatar, } from '@mui/material';
|
|
7
|
-
import { useEffect } from 'react';
|
|
8
|
+
import { Avatar, Container, IconButton, List, ListItemAvatar, Tooltip, } from '@mui/material';
|
|
8
9
|
import { shallow } from 'zustand/shallow';
|
|
9
10
|
import { ListItemText } from '../../components/ListItemText';
|
|
10
11
|
import { useTools } from '../../hooks';
|
|
11
12
|
import { useHeaderStoreContext, useSettingsStore } from '../../stores';
|
|
12
|
-
import {
|
|
13
|
+
import { SettingsListItemButton } from '../../components/SettingsListItemButton';
|
|
14
|
+
const SelectAllCheckbox = ({ allCheckboxesSelected, anyCheckboxesSelected, onClick, }) => {
|
|
15
|
+
const { t } = useTranslation();
|
|
16
|
+
const tooltipTitle = allCheckboxesSelected
|
|
17
|
+
? t('tooltip.deselectAll')
|
|
18
|
+
: t('tooltip.selectAll');
|
|
19
|
+
return (_jsx(Tooltip, { title: tooltipTitle, arrow: true, children: _jsx(IconButton, { size: "medium", edge: "end", onClick: onClick, children: allCheckboxesSelected ? (_jsx(CheckBoxOutlinedIcon, {})) : anyCheckboxesSelected ? (_jsx(IndeterminateCheckBoxOutlinedIcon, {})) : (_jsx(CheckBoxOutlineBlankOutlinedIcon, {})) }) }));
|
|
20
|
+
};
|
|
13
21
|
export const SelectEnabledToolsPage = ({ type }) => {
|
|
14
22
|
const typeKey = type.toLowerCase();
|
|
15
23
|
const { tools } = useTools();
|
|
@@ -41,10 +49,12 @@ export const SelectEnabledToolsPage = ({ type }) => {
|
|
|
41
49
|
setTools(type, toolKeys, toolKeys);
|
|
42
50
|
}
|
|
43
51
|
};
|
|
44
|
-
return headerStoreContext
|
|
52
|
+
return headerStoreContext
|
|
53
|
+
.getState()
|
|
54
|
+
.setAction(_jsx(SelectAllCheckbox, { allCheckboxesSelected: allToolsSelected, anyCheckboxesSelected: !!enabledTools.length, onClick: toggleCheckboxes }));
|
|
45
55
|
}, [enabledTools.length, headerStoreContext, setTools, tools, type, typeKey]);
|
|
46
56
|
return (_jsx(Container, { disableGutters: true, children: _jsx(List, { sx: {
|
|
47
57
|
paddingLeft: 1.5,
|
|
48
58
|
paddingRight: 1.5,
|
|
49
|
-
}, children: tools?.[typeKey].map((tool) => (_jsxs(
|
|
59
|
+
}, children: tools?.[typeKey].map((tool) => (_jsxs(SettingsListItemButton, { onClick: () => handleClick(tool.key), children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, { src: tool.logoURI, alt: tool.name, children: tool.name[0] }) }), _jsx(ListItemText, { primary: tool.name }), enabledTools?.includes(tool.key) && _jsx(CheckIcon, { color: "primary" })] }, tool.name))) }) }));
|
|
50
60
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Connector } from 'wagmi';
|
|
2
|
+
interface EVMListItemButtonProps {
|
|
3
|
+
connectedConnector?: Connector;
|
|
4
|
+
connector: Connector;
|
|
5
|
+
onNotInstalled(connector: Connector): void;
|
|
6
|
+
}
|
|
7
|
+
export declare const EVMListItemButton: ({ connectedConnector, connector, onNotInstalled, }: EVMListItemButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChainType } from '@lifi/sdk';
|
|
3
|
+
import { getWalletIcon, isWalletInstalledAsync } from '@lifi/wallet-management';
|
|
4
|
+
import { Avatar, ListItemAvatar } from '@mui/material';
|
|
5
|
+
import { useConnect, useDisconnect } from 'wagmi';
|
|
6
|
+
import { ListItemButton } from '../../components/ListItemButton';
|
|
7
|
+
import { ListItemText } from '../../components/ListItemText';
|
|
8
|
+
import { useNavigateBack, useWidgetEvents } from '../../hooks';
|
|
9
|
+
import { WidgetEvent } from '../../types';
|
|
10
|
+
export const EVMListItemButton = ({ connectedConnector, connector, onNotInstalled, }) => {
|
|
11
|
+
const { navigateBack } = useNavigateBack();
|
|
12
|
+
const emitter = useWidgetEvents();
|
|
13
|
+
const { connectAsync } = useConnect();
|
|
14
|
+
const { disconnectAsync } = useDisconnect();
|
|
15
|
+
const handleEVMConnect = async () => {
|
|
16
|
+
const identityCheckPassed = await isWalletInstalledAsync(connector.id);
|
|
17
|
+
if (!identityCheckPassed) {
|
|
18
|
+
onNotInstalled(connector);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (connectedConnector) {
|
|
22
|
+
await disconnectAsync({ connector: connectedConnector });
|
|
23
|
+
}
|
|
24
|
+
await connectAsync({ connector }, {
|
|
25
|
+
onSuccess(data) {
|
|
26
|
+
emitter.emit(WidgetEvent.WalletConnected, {
|
|
27
|
+
address: data.accounts[0],
|
|
28
|
+
chainId: data.chainId,
|
|
29
|
+
chainType: ChainType.EVM,
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
navigateBack();
|
|
34
|
+
};
|
|
35
|
+
return (_jsxs(ListItemButton, { onClick: handleEVMConnect, children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, { src: connector.icon || getWalletIcon(connector.id), alt: connector.name, children: connector.name[0] }) }), _jsx(ListItemText, { primary: connector.name })] }, connector.uid));
|
|
36
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChainId, ChainType } from '@lifi/sdk';
|
|
3
|
+
import { Avatar, ListItemAvatar } from '@mui/material';
|
|
4
|
+
import { useWallet } from '@solana/wallet-adapter-react';
|
|
5
|
+
import { ListItemButton } from '../../components/ListItemButton';
|
|
6
|
+
import { ListItemText } from '../../components/ListItemText';
|
|
7
|
+
import { useNavigateBack, useWidgetEvents } from '../../hooks';
|
|
8
|
+
import { WidgetEvent } from '../../types';
|
|
9
|
+
export const SVMListItemButton = ({ wallet }) => {
|
|
10
|
+
const { navigateBack } = useNavigateBack();
|
|
11
|
+
const emitter = useWidgetEvents();
|
|
12
|
+
const { select, disconnect, connected } = useWallet();
|
|
13
|
+
const connect = async () => {
|
|
14
|
+
if (connected) {
|
|
15
|
+
await disconnect();
|
|
16
|
+
}
|
|
17
|
+
select(wallet.adapter.name);
|
|
18
|
+
// We use autoConnect on wallet selection
|
|
19
|
+
// await solanaConnect();
|
|
20
|
+
wallet.adapter.once('connect', (publicKey) => {
|
|
21
|
+
emitter.emit(WidgetEvent.WalletConnected, {
|
|
22
|
+
address: publicKey?.toString(),
|
|
23
|
+
chainId: ChainId.SOL,
|
|
24
|
+
chainType: ChainType.SVM,
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
navigateBack();
|
|
28
|
+
};
|
|
29
|
+
return (_jsxs(ListItemButton, { onClick: connect, children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, { src: wallet.adapter.icon, alt: wallet.adapter.name, children: wallet.adapter.name[0] }) }), _jsx(ListItemText, { primary: `${wallet.adapter.name} (Solana)` })] }, wallet.adapter.name));
|
|
30
|
+
};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { isWalletInstalled } from '@lifi/wallet-management';
|
|
3
|
+
import { Button, Container, DialogActions, DialogContent, DialogContentText, List, useMediaQuery, } from '@mui/material';
|
|
4
|
+
import { WalletReadyState } from '@solana/wallet-adapter-base';
|
|
5
|
+
import { useWallet } from '@solana/wallet-adapter-react';
|
|
6
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
5
7
|
import { useTranslation } from 'react-i18next';
|
|
8
|
+
import { useConnect, useAccount as useWagmiAccount } from 'wagmi';
|
|
6
9
|
import { Dialog } from '../../components/Dialog';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { useWallet } from '../../providers';
|
|
10
|
+
import { EVMListItemButton } from './EVMListItemButton';
|
|
11
|
+
import { SVMListItemButton } from './SVMListItemButton';
|
|
12
|
+
import { walletComparator } from './utils';
|
|
11
13
|
export const SelectWalletPage = () => {
|
|
12
14
|
const { t } = useTranslation();
|
|
13
|
-
const
|
|
14
|
-
const {
|
|
15
|
+
const account = useWagmiAccount();
|
|
16
|
+
const { connectors } = useConnect();
|
|
15
17
|
const [walletIdentity, setWalletIdentity] = useState({ show: false });
|
|
16
|
-
const
|
|
18
|
+
const { wallets: solanaWallets } = useWallet();
|
|
17
19
|
const isDesktopView = useMediaQuery((theme) => theme.breakpoints.up('sm'));
|
|
18
20
|
const closeDialog = () => {
|
|
19
21
|
setWalletIdentity((state) => ({
|
|
@@ -21,35 +23,32 @@ export const SelectWalletPage = () => {
|
|
|
21
23
|
show: false,
|
|
22
24
|
}));
|
|
23
25
|
};
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
show: true,
|
|
29
|
-
wallet,
|
|
30
|
-
});
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
navigateBack();
|
|
34
|
-
await connect(wallet);
|
|
35
|
-
}, [connect, navigateBack]);
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
Promise.all(supportedWallets.map((wallet) => wallet.installed())).then((installed) => {
|
|
38
|
-
// separate into installed and not installed wallets
|
|
39
|
-
const installedWallets = supportedWallets.filter((_, index) => installed[index]);
|
|
40
|
-
// always remove Default Wallet from not installed Wallets
|
|
41
|
-
const notInstalledWallets = supportedWallets.filter((wallet, index) => !installed[index] && wallet.name !== 'Default Wallet');
|
|
42
|
-
const allowedWallets = [...installedWallets];
|
|
43
|
-
if (isDesktopView) {
|
|
44
|
-
allowedWallets.push(...notInstalledWallets);
|
|
45
|
-
}
|
|
46
|
-
setWallets(allowedWallets);
|
|
26
|
+
const handleNotInstalled = useCallback(async (connector) => {
|
|
27
|
+
setWalletIdentity({
|
|
28
|
+
show: true,
|
|
29
|
+
connector,
|
|
47
30
|
});
|
|
48
31
|
}, []);
|
|
32
|
+
const wallets = useMemo(() => {
|
|
33
|
+
const evmInstalled = connectors.filter((connector) => isWalletInstalled(connector.id) &&
|
|
34
|
+
// We should not show already connected connectors
|
|
35
|
+
account.connector?.id !== connector.id);
|
|
36
|
+
const evmNotDetected = connectors.filter((connector) => !isWalletInstalled(connector.id));
|
|
37
|
+
const svmInstalled = solanaWallets?.filter((connector) => connector.adapter.readyState === WalletReadyState.Installed &&
|
|
38
|
+
// We should not show already connected connectors
|
|
39
|
+
!connector.adapter.connected);
|
|
40
|
+
const svmNotDetected = solanaWallets?.filter((connector) => connector.adapter.readyState !== WalletReadyState.Installed);
|
|
41
|
+
const installedWallets = [...evmInstalled, ...svmInstalled].sort(walletComparator);
|
|
42
|
+
if (isDesktopView) {
|
|
43
|
+
const notDetectedWallets = [...evmNotDetected, ...svmNotDetected].sort(walletComparator);
|
|
44
|
+
installedWallets.push(...notDetectedWallets);
|
|
45
|
+
}
|
|
46
|
+
return installedWallets;
|
|
47
|
+
}, [account.connector?.id, connectors, isDesktopView, solanaWallets]);
|
|
49
48
|
return (_jsxs(Container, { disableGutters: true, children: [_jsx(List, { sx: {
|
|
50
49
|
paddingLeft: 1.5,
|
|
51
50
|
paddingRight: 1.5,
|
|
52
|
-
}, children: wallets?.map((
|
|
53
|
-
name: walletIdentity.
|
|
51
|
+
}, children: wallets?.map((connector) => connector.uid ? (_jsx(EVMListItemButton, { connector: connector, connectedConnector: account.connector, onNotInstalled: handleNotInstalled }, connector.uid)) : (_jsx(SVMListItemButton, { wallet: connector }, connector.adapter.name))) }), _jsxs(Dialog, { open: walletIdentity.show, onClose: closeDialog, children: [_jsx(DialogContent, { children: _jsx(DialogContentText, { children: t('wallet.extensionNotFound', {
|
|
52
|
+
name: walletIdentity.connector?.name,
|
|
54
53
|
}) }) }), _jsx(DialogActions, { children: _jsx(Button, { variant: "contained", onClick: closeDialog, autoFocus: true, children: t('button.ok') }) })] })] }));
|
|
55
54
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getWalletPriority } from '@lifi/wallet-management';
|
|
2
|
+
export const walletComparator = (a, b) => {
|
|
3
|
+
let aId = a.id || a.adapter?.name;
|
|
4
|
+
let bId = b.id || b.adapter?.name;
|
|
5
|
+
const priorityA = getWalletPriority(aId);
|
|
6
|
+
const priorityB = getWalletPriority(bId);
|
|
7
|
+
if (priorityA !== priorityB) {
|
|
8
|
+
return priorityA - priorityB;
|
|
9
|
+
}
|
|
10
|
+
if (aId < bId) {
|
|
11
|
+
return -1;
|
|
12
|
+
}
|
|
13
|
+
if (aId > bId) {
|
|
14
|
+
return 1;
|
|
15
|
+
}
|
|
16
|
+
return 0;
|
|
17
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { useNavigate } from 'react-router-dom';
|
|
4
|
+
import { shallow } from 'zustand/shallow';
|
|
5
|
+
import AirlineStopsIcon from '@mui/icons-material/AirlineStops';
|
|
6
|
+
import SwapHorizIcon from '@mui/icons-material/SwapHoriz';
|
|
7
|
+
import { useSettingsStore } from '../../stores';
|
|
8
|
+
import { navigationRoutes } from '../../utils';
|
|
9
|
+
import { useSettingMonitor } from '../../hooks';
|
|
10
|
+
import { SettingCardButton, BadgedValue } from './SettingsCard';
|
|
11
|
+
const supportedIcons = {
|
|
12
|
+
Bridges: AirlineStopsIcon,
|
|
13
|
+
Exchanges: SwapHorizIcon,
|
|
14
|
+
};
|
|
15
|
+
export const BridgeAndExchangeSettings = ({ type }) => {
|
|
16
|
+
const { isBridgesChanged, isExchangesChanged } = useSettingMonitor();
|
|
17
|
+
const { t } = useTranslation();
|
|
18
|
+
const navigate = useNavigate();
|
|
19
|
+
const [enabledTools, tools] = useSettingsStore((state) => {
|
|
20
|
+
const enabledTools = Object.values(state[`_enabled${type}`] ?? {});
|
|
21
|
+
return [enabledTools.filter(Boolean).length, enabledTools.length];
|
|
22
|
+
}, shallow);
|
|
23
|
+
const customisationLookUp = {
|
|
24
|
+
Bridges: isBridgesChanged,
|
|
25
|
+
Exchanges: isExchangesChanged,
|
|
26
|
+
};
|
|
27
|
+
const handleClick = () => {
|
|
28
|
+
navigate(navigationRoutes[type.toLowerCase()]);
|
|
29
|
+
};
|
|
30
|
+
const Icon = supportedIcons[type];
|
|
31
|
+
return (_jsx(SettingCardButton, { onClick: handleClick, icon: _jsx(Icon, {}), title: t(`settings.enabled${type}`), children: _jsx(BadgedValue, { badgeColor: "info", showBadge: customisationLookUp[type], children: `${enabledTools}/${tools}` }) }));
|
|
32
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import EvStationIcon from '@mui/icons-material/EvStation';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { useSettings, useSettingsStore } from '../../stores';
|
|
5
|
+
import { Tab, Tabs } from '../../components/Tabs';
|
|
6
|
+
import { useSettingMonitor } from '../../hooks';
|
|
7
|
+
import { SettingCardExpandable, BadgedValue } from './SettingsCard';
|
|
8
|
+
export const GasPriceSettings = () => {
|
|
9
|
+
const { t } = useTranslation();
|
|
10
|
+
const setValue = useSettingsStore((state) => state.setValue);
|
|
11
|
+
const { isGasPriceChanged } = useSettingMonitor();
|
|
12
|
+
const { gasPrice } = useSettings(['gasPrice']);
|
|
13
|
+
const handleGasPriceChange = (_, gasPrice) => {
|
|
14
|
+
setValue('gasPrice', gasPrice);
|
|
15
|
+
};
|
|
16
|
+
return (_jsx(SettingCardExpandable, { value: _jsx(BadgedValue, { badgeColor: "info", showBadge: isGasPriceChanged, children: t(`settings.gasPrice.${gasPrice}`) }), icon: _jsx(EvStationIcon, {}), title: t(`settings.gasPrice.title`), children: _jsxs(Tabs, { value: gasPrice, "aria-label": "tabs", indicatorColor: "primary", onChange: handleGasPriceChange, sx: { mt: 1.5 }, children: [_jsx(Tab, { label: t(`settings.gasPrice.slow`), value: "slow", disableRipple: true }), _jsx(Tab, { label: t(`settings.gasPrice.normal`), value: "normal", disableRipple: true }), _jsx(Tab, { label: t(`settings.gasPrice.fast`), value: "fast", disableRipple: true })] }) }));
|
|
17
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useNavigate } from 'react-router-dom';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import LanguageIcon from '@mui/icons-material/Language';
|
|
5
|
+
import { useWidgetConfig } from '../../providers';
|
|
6
|
+
import { HiddenUI } from '../../types';
|
|
7
|
+
import { navigationRoutes } from '../../utils';
|
|
8
|
+
import { useLanguages } from '../../hooks';
|
|
9
|
+
import { SettingCardButton, SummaryValue } from './SettingsCard';
|
|
10
|
+
export const LanguageSetting = () => {
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
const navigate = useNavigate();
|
|
13
|
+
const { hiddenUI } = useWidgetConfig();
|
|
14
|
+
const { selectedLanguageDisplayName } = useLanguages();
|
|
15
|
+
if (hiddenUI?.includes(HiddenUI.Language)) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
const handleClick = () => {
|
|
19
|
+
navigate(navigationRoutes.languages);
|
|
20
|
+
};
|
|
21
|
+
return (_jsx(SettingCardButton, { onClick: handleClick, icon: _jsx(LanguageIcon, {}), title: t(`language.title`), children: _jsx(SummaryValue, { children: selectedLanguageDisplayName }) }));
|
|
22
|
+
};
|
|
@@ -3,51 +3,24 @@ import { Box, Button, DialogActions, DialogContent, DialogContentText, DialogTit
|
|
|
3
3
|
import { useCallback, useState } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { Dialog } from '../../components/Dialog';
|
|
6
|
-
import {
|
|
7
|
-
import { useWidgetConfig } from '../../providers';
|
|
8
|
-
import { defaultConfigurableSettings, setDefaultSettings, useSettingsStore, } from '../../stores';
|
|
6
|
+
import { useSettingMonitor } from '../../hooks';
|
|
9
7
|
import { ResetButtonContainer } from './ResetSettingsButton.style';
|
|
10
8
|
import { InfoRounded } from '@mui/icons-material';
|
|
11
|
-
import { shallow } from 'zustand/shallow';
|
|
12
9
|
export const ResetSettingsButton = () => {
|
|
13
|
-
const [enabledBridges, enabledExchanges, routePriority, slippage, gasPrice] = useSettingsStore((state) => [
|
|
14
|
-
state.enabledBridges,
|
|
15
|
-
state.enabledExchanges,
|
|
16
|
-
state.routePriority,
|
|
17
|
-
state.slippage,
|
|
18
|
-
state.gasPrice,
|
|
19
|
-
], shallow);
|
|
20
10
|
const { t } = useTranslation();
|
|
21
|
-
const {
|
|
22
|
-
const config = useWidgetConfig();
|
|
23
|
-
const resetSettings = useSettingsStore((state) => state.reset);
|
|
11
|
+
const { isCustomRouteSettings, reset } = useSettingMonitor();
|
|
24
12
|
const [open, setOpen] = useState(false);
|
|
25
13
|
const toggleDialog = useCallback(() => {
|
|
26
14
|
setOpen((open) => !open);
|
|
27
15
|
}, []);
|
|
28
16
|
const handleReset = () => {
|
|
29
|
-
|
|
30
|
-
resetSettings(config, tools.bridges.map((tool) => tool.key), tools.exchanges.map((tool) => tool.key));
|
|
31
|
-
setDefaultSettings(config);
|
|
32
|
-
}
|
|
17
|
+
reset();
|
|
33
18
|
toggleDialog();
|
|
34
19
|
};
|
|
35
|
-
const isSlippageChanged = config.slippage
|
|
36
|
-
? Number(slippage) !== config.slippage * 100
|
|
37
|
-
: slippage !== defaultConfigurableSettings.slippage;
|
|
38
|
-
const isRoutePriorityChanged = config.routePriority
|
|
39
|
-
? routePriority !== config.routePriority
|
|
40
|
-
: routePriority !== defaultConfigurableSettings.routePriority;
|
|
41
|
-
const isGasPriceChanged = gasPrice !== defaultConfigurableSettings.gasPrice;
|
|
42
|
-
const isCustomRouteSettings = tools?.bridges?.length !== enabledBridges?.length ||
|
|
43
|
-
tools?.exchanges?.length !== enabledExchanges?.length ||
|
|
44
|
-
isSlippageChanged ||
|
|
45
|
-
isRoutePriorityChanged ||
|
|
46
|
-
isGasPriceChanged;
|
|
47
20
|
if (!isCustomRouteSettings) {
|
|
48
21
|
return null;
|
|
49
22
|
}
|
|
50
|
-
return (_jsx(Box, { px: 3,
|
|
23
|
+
return (_jsx(Box, { px: 3, mb: 1, children: _jsxs(ResetButtonContainer, { children: [_jsxs(Box, { display: "flex", marginBottom: "12px", children: [_jsx(InfoRounded, { sx: {
|
|
51
24
|
marginRight: '8px',
|
|
52
25
|
} }), _jsx(Box, { fontSize: 14, children: t(`settings.resetSettings`) })] }), _jsx(Button, { onClick: toggleDialog, fullWidth: true, children: t('button.resetSettings') }), _jsxs(Dialog, { open: open, onClose: toggleDialog, children: [_jsx(DialogTitle, { children: t('warning.title.resetSettings') }), _jsx(DialogContent, { children: _jsx(DialogContentText, { children: t('warning.message.resetSettings') }) }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: toggleDialog, children: t('button.cancel') }), _jsx(Button, { variant: "contained", onClick: handleReset, autoFocus: true, children: t('button.reset') })] })] })] }) }));
|
|
53
26
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import RouteIcon from '@mui/icons-material/Route';
|
|
4
|
+
import { Orders } from '@lifi/sdk';
|
|
5
|
+
import { Tab, Tabs } from '../../components/Tabs';
|
|
6
|
+
import { useSettings, useSettingsStore } from '../../stores';
|
|
7
|
+
import { useSettingMonitor } from '../../hooks';
|
|
8
|
+
import { SettingCardExpandable, BadgedValue } from './SettingsCard';
|
|
9
|
+
export const RoutePrioritySettings = () => {
|
|
10
|
+
const { t } = useTranslation();
|
|
11
|
+
const setValue = useSettingsStore((state) => state.setValue);
|
|
12
|
+
const { isRoutePriorityChanged } = useSettingMonitor();
|
|
13
|
+
const { routePriority } = useSettings(['routePriority']);
|
|
14
|
+
const currentRoutePriority = routePriority ?? '';
|
|
15
|
+
const handleRoutePriorityChange = (_, routePriority) => {
|
|
16
|
+
setValue('routePriority', routePriority);
|
|
17
|
+
};
|
|
18
|
+
return (_jsx(SettingCardExpandable, { value: _jsx(BadgedValue, { badgeColor: "info", showBadge: isRoutePriorityChanged, children: t(`main.tags.${currentRoutePriority.toLowerCase()}`) }), icon: _jsx(RouteIcon, {}), title: t(`settings.routePriority`), children: _jsx(Tabs, { value: currentRoutePriority, "aria-label": "tabs", indicatorColor: "primary", onChange: handleRoutePriorityChange, orientation: "vertical", sx: { mt: 1.5 }, children: Orders.map((order) => {
|
|
19
|
+
return (_jsx(Tab, { label: t(`main.tags.${order.toLowerCase()}`), value: order, disableRipple: true }, order));
|
|
20
|
+
}) }) }));
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SendToWalletOptionSetting: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Typography } from '@mui/material';
|
|
3
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import WalletIcon from '@mui/icons-material/Wallet';
|
|
4
4
|
import { Switch } from '../../components/Switch';
|
|
5
5
|
import { useWidgetConfig } from '../../providers';
|
|
6
6
|
import { useSendToWalletStore, useSettings, useSettingsStore, } from '../../stores';
|
|
7
7
|
import { HiddenUI } from '../../types';
|
|
8
|
-
|
|
8
|
+
import { SettingCard, SummaryRowContainer, SummaryTitleContainer, SummaryValue, } from './SettingsCard';
|
|
9
|
+
export const SendToWalletOptionSetting = () => {
|
|
9
10
|
const { t } = useTranslation();
|
|
10
11
|
const { hiddenUI } = useWidgetConfig();
|
|
11
12
|
const setSendToWallet = useSendToWalletStore((state) => state.setSendToWallet);
|
|
@@ -18,9 +19,5 @@ export const ShowDestinationWallet = () => {
|
|
|
18
19
|
setValue('showDestinationWallet', checked);
|
|
19
20
|
setSendToWallet(false);
|
|
20
21
|
};
|
|
21
|
-
return (_jsx(
|
|
22
|
-
display: 'flex',
|
|
23
|
-
justifyContent: 'space-between',
|
|
24
|
-
alignItems: 'center',
|
|
25
|
-
}, children: [_jsx(Box, { sx: { display: 'flex', alignItems: 'center' }, children: _jsx(Typography, { variant: "subtitle1", color: "text.primary", lineHeight: "normal", children: t(`settings.showDestinationWallet`) }) }), _jsx(Switch, { checked: showDestinationWallet, onChange: onChange })] }) }));
|
|
22
|
+
return (_jsx(SettingCard, { children: _jsxs(SummaryRowContainer, { children: [_jsxs(SummaryTitleContainer, { children: [_jsx(WalletIcon, {}), _jsx(SummaryValue, { children: t(`settings.sendToWalletOption`) })] }), _jsx(Switch, { checked: showDestinationWallet, onChange: onChange })] }) }));
|
|
26
23
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import type { BadgeProps } from '@mui/material';
|
|
3
|
+
interface BadgedValueProps {
|
|
4
|
+
showBadge: boolean;
|
|
5
|
+
badgeColor?: BadgeProps['color'];
|
|
6
|
+
}
|
|
7
|
+
export declare const BadgedValue: React.FC<PropsWithChildren<BadgedValueProps>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { SummaryValue, Badge } from './SettingCard.style';
|
|
3
|
+
export const BadgedValue = ({ showBadge, badgeColor, children, }) => showBadge && badgeColor ? (_jsx(Badge, { variant: "dot", color: badgeColor, children: _jsx(SummaryValue, { children: children }) })) : (_jsx(SummaryValue, { children: children }));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const SettingsList: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
4
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
5
|
+
export declare const SummaryTitleContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
6
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
7
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
8
|
+
export declare const SummaryRowContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
9
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
10
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
11
|
+
export declare const SummaryRowButton: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonBaseOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
12
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
13
|
+
}, "className" | "style" | "classes" | "action" | "centerRipple" | "children" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
14
|
+
export declare const SummaryValue: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
15
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
16
|
+
}, "className" | "style" | "classes" | "children" | "sx" | "p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
17
|
+
export declare const Badge: import("@emotion/styled").StyledComponent<import("@mui/material").BadgeOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
18
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
19
|
+
}, "className" | "style" | "classes" | "children" | "sx" | "color" | "variant" | "max" | "components" | "componentsProps" | "slots" | "slotProps" | "invisible" | "anchorOrigin" | "badgeContent" | "overlap" | "showZero"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|