@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
|
@@ -1,88 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { formatInputAmount, formatSlippage } from "../../../utils/format.js";
|
|
1
|
+
import { navigationRoutes } from "../../../utils/navigationRoutes.js";
|
|
3
2
|
import { useSettings } from "../../../stores/settings/useSettings.js";
|
|
4
3
|
import { useSettingMonitor } from "../../../hooks/useSettingMonitor.js";
|
|
4
|
+
import { CardButton } from "../../../components/Card/CardButton.js";
|
|
5
5
|
import { BadgedValue } from "../SettingsCard/BadgedValue.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { useRef, useState } from "react";
|
|
9
|
-
import { Box, Typography } from "@mui/material";
|
|
10
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { useNavigate } from "@tanstack/react-router";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
8
|
import { useTranslation } from "react-i18next";
|
|
12
|
-
import WarningRounded from "@mui/icons-material/WarningRounded";
|
|
13
9
|
import Percent from "@mui/icons-material/Percent";
|
|
14
10
|
//#region src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx
|
|
15
|
-
const defaultSlippageInputValue = "0.5";
|
|
16
|
-
const maxFractionDigits = 5;
|
|
17
11
|
const SlippageSettings = () => {
|
|
18
12
|
const { t } = useTranslation();
|
|
19
|
-
const
|
|
13
|
+
const navigate = useNavigate();
|
|
14
|
+
const { isSlippageNotRecommended, isSlippageChanged } = useSettingMonitor();
|
|
20
15
|
const { slippage } = useSettings(["slippage"]);
|
|
21
|
-
const { setValue } = useSettingsActions();
|
|
22
|
-
const defaultValue = useRef(slippage);
|
|
23
|
-
const [focused, setFocused] = useState();
|
|
24
|
-
const [inputValue, setInputValue] = useState(!slippage || slippage === void 0 ? defaultSlippageInputValue : slippage);
|
|
25
|
-
const handleDefaultClick = () => {
|
|
26
|
-
setValue("slippage", void 0);
|
|
27
|
-
};
|
|
28
|
-
const formatAndSetSlippage = (value, returnInitial = false) => {
|
|
29
|
-
const formattedSlippage = formatSlippage(value, defaultValue.current, returnInitial);
|
|
30
|
-
const formattedValue = Number(formattedSlippage) === 0 && !returnInitial ? "0" : formatInputAmount(formattedSlippage, maxFractionDigits, returnInitial);
|
|
31
|
-
const maxLength = Number(formattedValue) < 10 ? 7 : 8;
|
|
32
|
-
const slicedValue = formattedValue.slice(0, maxLength);
|
|
33
|
-
setInputValue(slicedValue);
|
|
34
|
-
setValue("slippage", slicedValue.length ? slicedValue : void 0);
|
|
35
|
-
};
|
|
36
|
-
const handleInputUpdate = (event) => {
|
|
37
|
-
formatAndSetSlippage(event.target.value, true);
|
|
38
|
-
};
|
|
39
|
-
const handleInputFocus = (event) => {
|
|
40
|
-
setFocused("input");
|
|
41
|
-
formatAndSetSlippage(event.target.value);
|
|
42
|
-
};
|
|
43
|
-
const handleInputBlur = (event) => {
|
|
44
|
-
setFocused(void 0);
|
|
45
|
-
formatAndSetSlippage(event.target.value);
|
|
46
|
-
};
|
|
47
16
|
const badgeColor = isSlippageNotRecommended ? "warning" : isSlippageChanged ? "info" : void 0;
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
17
|
+
const handleClick = () => {
|
|
18
|
+
navigate({ to: navigationRoutes.slippage });
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ jsx(CardButton, {
|
|
21
|
+
onClick: handleClick,
|
|
22
|
+
icon: /* @__PURE__ */ jsx(Percent, {}),
|
|
23
|
+
title: t("settings.slippage"),
|
|
24
|
+
children: /* @__PURE__ */ jsx(BadgedValue, {
|
|
51
25
|
badgeColor,
|
|
52
26
|
showBadge: !!badgeColor,
|
|
53
27
|
children: slippage ? `${slippage}%` : t("button.auto")
|
|
54
|
-
}),
|
|
55
|
-
icon: /* @__PURE__ */ jsx(Percent, {}),
|
|
56
|
-
title: t("settings.slippage"),
|
|
57
|
-
children: /* @__PURE__ */ jsxs(Box, {
|
|
58
|
-
sx: { mt: 1.5 },
|
|
59
|
-
children: [/* @__PURE__ */ jsxs(SettingsFieldSet, { children: [/* @__PURE__ */ jsx(SettingsDefaultButton, {
|
|
60
|
-
selected: void 0 === slippage && focused !== "input",
|
|
61
|
-
onFocus: () => {
|
|
62
|
-
setFocused("button");
|
|
63
|
-
},
|
|
64
|
-
onBlur: () => {
|
|
65
|
-
setFocused(void 0);
|
|
66
|
-
},
|
|
67
|
-
onClick: handleDefaultClick,
|
|
68
|
-
disableRipple: true,
|
|
69
|
-
children: t("button.auto")
|
|
70
|
-
}), /* @__PURE__ */ jsx(SettingsCustomInput, {
|
|
71
|
-
selected: void 0 !== slippage && focused !== "button",
|
|
72
|
-
placeholder: focused === "input" ? "" : t("settings.custom"),
|
|
73
|
-
inputProps: { inputMode: "decimal" },
|
|
74
|
-
onChange: handleInputUpdate,
|
|
75
|
-
onFocus: handleInputFocus,
|
|
76
|
-
value: inputValue,
|
|
77
|
-
autoComplete: "off",
|
|
78
|
-
onBlur: handleInputBlur
|
|
79
|
-
})] }), isSlippageNotRecommended && /* @__PURE__ */ jsxs(SlippageLimitsWarningContainer, { children: [/* @__PURE__ */ jsx(WarningRounded, { color: "warning" }), /* @__PURE__ */ jsx(Typography, {
|
|
80
|
-
sx: {
|
|
81
|
-
fontSize: 13,
|
|
82
|
-
fontWeight: 400
|
|
83
|
-
},
|
|
84
|
-
children: slippageWarningText
|
|
85
|
-
})] })]
|
|
86
28
|
})
|
|
87
29
|
});
|
|
88
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlippageSettings.js","names":[],"sources":["../../../../../src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx"],"sourcesContent":["import Percent from '@mui/icons-material/Percent'\nimport
|
|
1
|
+
{"version":3,"file":"SlippageSettings.js","names":[],"sources":["../../../../../src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx"],"sourcesContent":["import Percent from '@mui/icons-material/Percent'\nimport { useNavigate } from '@tanstack/react-router'\nimport { useTranslation } from 'react-i18next'\nimport { CardButton } from '../../../components/Card/CardButton.js'\nimport { useSettingMonitor } from '../../../hooks/useSettingMonitor.js'\nimport { useSettings } from '../../../stores/settings/useSettings.js'\nimport { navigationRoutes } from '../../../utils/navigationRoutes.js'\nimport { BadgedValue } from '../SettingsCard/BadgedValue.js'\n\nexport const SlippageSettings: React.FC = () => {\n const { t } = useTranslation()\n const navigate = useNavigate()\n const { isSlippageNotRecommended, isSlippageChanged } = useSettingMonitor()\n const { slippage } = useSettings(['slippage'])\n\n const badgeColor = isSlippageNotRecommended\n ? 'warning'\n : isSlippageChanged\n ? 'info'\n : undefined\n\n const handleClick = () => {\n navigate({ to: navigationRoutes.slippage })\n }\n\n return (\n <CardButton\n onClick={handleClick}\n icon={<Percent />}\n title={t('settings.slippage')}\n >\n <BadgedValue badgeColor={badgeColor} showBadge={!!badgeColor}>\n {slippage ? `${slippage}%` : t('button.auto')}\n </BadgedValue>\n </CardButton>\n )\n}\n"],"mappings":";;;;;;;;;;AASA,MAAa,yBAAmC;CAC9C,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,WAAW,YAAY;CAC7B,MAAM,EAAE,0BAA0B,sBAAsB,kBAAkB;CAC1E,MAAM,EAAE,aAAa,YAAY,CAAC,UAAU,CAAC;CAE7C,MAAM,aAAa,2BACf,YACA,oBACE,SACA,KAAA;CAEN,MAAM,oBAAoB;EACxB,SAAS,EAAE,IAAI,iBAAiB,SAAS,CAAC;CAC5C;CAEA,OACE,oBAAC,YAAD;EACE,SAAS;EACT,MAAM,oBAAC,SAAD,CAAU,CAAA;EAChB,OAAO,EAAE,mBAAmB;YAE5B,oBAAC,aAAD;GAAyB;GAAY,WAAW,CAAC,CAAC;aAC/C,WAAW,GAAG,SAAS,KAAK,EAAE,aAAa;EACjC,CAAA;CACH,CAAA;AAEhB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Box,
|
|
1
|
+
import { Box, IconButton, InputBase, inputBaseClasses, styled } from "@mui/material";
|
|
2
2
|
//#region src/pages/SettingsPage/SlippageSettings/SlippageSettings.style.tsx
|
|
3
3
|
const SettingsFieldSet = styled(Box)(({ theme }) => ({
|
|
4
4
|
display: "flex",
|
|
@@ -18,18 +18,6 @@ const settingsControlSelected = (theme) => ({
|
|
|
18
18
|
}),
|
|
19
19
|
borderRadius: `calc(${theme.vars.shape.borderRadius} - 4px)`
|
|
20
20
|
});
|
|
21
|
-
const SettingsDefaultButton = styled(ButtonBase)(({ theme, selected }) => {
|
|
22
|
-
const settingsControlSelectedStyles = settingsControlSelected(theme);
|
|
23
|
-
const selectedStyle = selected ? { "&:not(:focus)": { ...settingsControlSelectedStyles } } : {};
|
|
24
|
-
return {
|
|
25
|
-
height: "100%",
|
|
26
|
-
width: "100%",
|
|
27
|
-
fontSize: "1rem",
|
|
28
|
-
fontWeight: 700,
|
|
29
|
-
"&:focus": { ...settingsControlSelectedStyles },
|
|
30
|
-
...selectedStyle
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
21
|
const SettingsCustomInput = styled(InputBase)(({ theme, selected }) => {
|
|
34
22
|
const settingsControlSelectedStyles = settingsControlSelected(theme);
|
|
35
23
|
const selectedStyle = selected ? { "&:not(:focus)": { ...settingsControlSelectedStyles } } : {};
|
|
@@ -56,7 +44,31 @@ const SlippageLimitsWarningContainer = styled(Box)(({ theme }) => ({
|
|
|
56
44
|
gap: theme.spacing(1.25),
|
|
57
45
|
marginTop: theme.spacing(1.5)
|
|
58
46
|
}));
|
|
47
|
+
const SlippageInput = styled(InputBase)(({ theme }) => ({
|
|
48
|
+
minHeight: 44,
|
|
49
|
+
width: "100%",
|
|
50
|
+
backgroundColor: theme.vars.palette.background.default,
|
|
51
|
+
border: "1px solid",
|
|
52
|
+
borderColor: theme.vars.palette.divider,
|
|
53
|
+
borderRadius: theme.vars.shape.borderRadius,
|
|
54
|
+
paddingRight: theme.spacing(1),
|
|
55
|
+
[`.${inputBaseClasses.input}`]: {
|
|
56
|
+
padding: theme.spacing(1.5),
|
|
57
|
+
fontSize: 16,
|
|
58
|
+
fontWeight: 500,
|
|
59
|
+
lineHeight: "20px",
|
|
60
|
+
"&::placeholder": {
|
|
61
|
+
opacity: 1,
|
|
62
|
+
color: theme.vars.palette.text.secondary
|
|
63
|
+
},
|
|
64
|
+
"&::-webkit-outer-spin-button, &::-webkit-inner-spin-button": { display: "none" }
|
|
65
|
+
}
|
|
66
|
+
}));
|
|
67
|
+
const SlippageClearButton = styled(IconButton)(({ theme }) => ({
|
|
68
|
+
padding: theme.spacing(.5),
|
|
69
|
+
flexShrink: 0
|
|
70
|
+
}));
|
|
59
71
|
//#endregion
|
|
60
|
-
export { SettingsCustomInput,
|
|
72
|
+
export { SettingsCustomInput, SettingsFieldSet, SlippageClearButton, SlippageInput, SlippageLimitsWarningContainer };
|
|
61
73
|
|
|
62
74
|
//# sourceMappingURL=SlippageSettings.style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlippageSettings.style.js","names":[],"sources":["../../../../../src/pages/SettingsPage/SlippageSettings/SlippageSettings.style.tsx"],"sourcesContent":["import type { Theme } from '@mui/material'\nimport {\n Box,\n
|
|
1
|
+
{"version":3,"file":"SlippageSettings.style.js","names":[],"sources":["../../../../../src/pages/SettingsPage/SlippageSettings/SlippageSettings.style.tsx"],"sourcesContent":["import type { Theme } from '@mui/material'\nimport {\n Box,\n IconButton,\n InputBase,\n inputBaseClasses,\n styled,\n} from '@mui/material'\nimport type React from 'react'\n\nexport const SettingsFieldSet: React.FC<\n React.ComponentProps<typeof Box> & SettingsControlProps\n> = styled(Box)(({ theme }) => ({\n display: 'flex',\n borderRadius: theme.vars.shape.borderRadius,\n padding: theme.spacing(0.5),\n gap: theme.spacing(0.5),\n height: '3.5rem',\n backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,\n ...theme.applyStyles('dark', {\n backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 8%, transparent)`,\n }),\n}))\n\nconst settingsControlSelected = (theme: Theme) => ({\n backgroundColor: theme.vars.palette.background.paper,\n boxShadow: `0px 2px 4px color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,\n ...theme.applyStyles('dark', {\n backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.background} 56%, transparent)`,\n boxShadow: `0px 2px 4px color-mix(in srgb, ${theme.vars.palette.common.background} 4%, transparent)`,\n }),\n borderRadius: `calc(${theme.vars.shape.borderRadius} - 4px)`,\n})\n\ninterface SettingsControlProps {\n selected?: boolean\n}\n\nexport const SettingsCustomInput: React.FC<\n React.ComponentProps<typeof InputBase> & SettingsControlProps\n> = styled(InputBase)<SettingsControlProps>(({ theme, selected }) => {\n const settingsControlSelectedStyles = settingsControlSelected(theme)\n const selectedStyle = selected\n ? {\n '&:not(:focus)': {\n ...settingsControlSelectedStyles,\n },\n }\n : {}\n\n return {\n height: '100%',\n width: '100%',\n [`.${inputBaseClasses.input}`]: {\n height: '100%',\n width: '100%',\n padding: 0,\n textAlign: 'center',\n '&::placeholder': {\n fontSize: '1rem',\n fontWeight: 700,\n opacity: 1,\n },\n '&:focus': {\n ...settingsControlSelectedStyles,\n },\n ...selectedStyle,\n },\n }\n})\n\nexport const SlippageLimitsWarningContainer: React.FC<\n React.ComponentProps<typeof Box>\n> = styled(Box)(({ theme }) => ({\n display: 'flex',\n gap: theme.spacing(1.25),\n marginTop: theme.spacing(1.5),\n}))\n\nexport const SlippageInput: React.FC<React.ComponentProps<typeof InputBase>> =\n styled(InputBase)(({ theme }) => ({\n minHeight: 44,\n width: '100%',\n backgroundColor: theme.vars.palette.background.default,\n border: '1px solid',\n borderColor: theme.vars.palette.divider,\n borderRadius: theme.vars.shape.borderRadius,\n paddingRight: theme.spacing(1),\n [`.${inputBaseClasses.input}`]: {\n padding: theme.spacing(1.5),\n fontSize: 16,\n fontWeight: 500,\n lineHeight: '20px',\n '&::placeholder': {\n opacity: 1,\n color: theme.vars.palette.text.secondary,\n },\n '&::-webkit-outer-spin-button, &::-webkit-inner-spin-button': {\n display: 'none',\n },\n },\n }))\n\nexport const SlippageClearButton: React.FC<\n React.ComponentProps<typeof IconButton>\n> = styled(IconButton)(({ theme }) => ({\n padding: theme.spacing(0.5),\n flexShrink: 0,\n}))\n"],"mappings":";;AAUA,MAAa,mBAET,OAAO,GAAG,CAAC,EAAE,EAAE,aAAa;CAC9B,SAAS;CACT,cAAc,MAAM,KAAK,MAAM;CAC/B,SAAS,MAAM,QAAQ,EAAG;CAC1B,KAAK,MAAM,QAAQ,EAAG;CACtB,QAAQ;CACR,iBAAiB,sBAAsB,MAAM,KAAK,QAAQ,OAAO,aAAa;CAC9E,GAAG,MAAM,YAAY,QAAQ,EAC3B,iBAAiB,sBAAsB,MAAM,KAAK,QAAQ,OAAO,aAAa,mBAChF,CAAC;AACH,EAAE;AAEF,MAAM,2BAA2B,WAAkB;CACjD,iBAAiB,MAAM,KAAK,QAAQ,WAAW;CAC/C,WAAW,kCAAkC,MAAM,KAAK,QAAQ,OAAO,aAAa;CACpF,GAAG,MAAM,YAAY,QAAQ;EAC3B,iBAAiB,sBAAsB,MAAM,KAAK,QAAQ,OAAO,WAAW;EAC5E,WAAW,kCAAkC,MAAM,KAAK,QAAQ,OAAO,WAAW;CACpF,CAAC;CACD,cAAc,QAAQ,MAAM,KAAK,MAAM,aAAa;AACtD;AAMA,MAAa,sBAET,OAAO,SAAS,CAAC,EAAwB,EAAE,OAAO,eAAe;CACnE,MAAM,gCAAgC,wBAAwB,KAAK;CACnE,MAAM,gBAAgB,WAClB,EACE,iBAAiB,EACf,GAAG,8BACL,EACF,IACA,CAAC;CAEL,OAAO;EACL,QAAQ;EACR,OAAO;GACN,IAAI,iBAAiB,UAAU;GAC9B,QAAQ;GACR,OAAO;GACP,SAAS;GACT,WAAW;GACX,kBAAkB;IAChB,UAAU;IACV,YAAY;IACZ,SAAS;GACX;GACA,WAAW,EACT,GAAG,8BACL;GACA,GAAG;EACL;CACF;AACF,CAAC;AAED,MAAa,iCAET,OAAO,GAAG,CAAC,EAAE,EAAE,aAAa;CAC9B,SAAS;CACT,KAAK,MAAM,QAAQ,IAAI;CACvB,WAAW,MAAM,QAAQ,GAAG;AAC9B,EAAE;AAEF,MAAa,gBACX,OAAO,SAAS,CAAC,EAAE,EAAE,aAAa;CAChC,WAAW;CACX,OAAO;CACP,iBAAiB,MAAM,KAAK,QAAQ,WAAW;CAC/C,QAAQ;CACR,aAAa,MAAM,KAAK,QAAQ;CAChC,cAAc,MAAM,KAAK,MAAM;CAC/B,cAAc,MAAM,QAAQ,CAAC;EAC5B,IAAI,iBAAiB,UAAU;EAC9B,SAAS,MAAM,QAAQ,GAAG;EAC1B,UAAU;EACV,YAAY;EACZ,YAAY;EACZ,kBAAkB;GAChB,SAAS;GACT,OAAO,MAAM,KAAK,QAAQ,KAAK;EACjC;EACA,8DAA8D,EAC5D,SAAS,OACX;CACF;AACF,EAAE;AAEJ,MAAa,sBAET,OAAO,UAAU,CAAC,EAAE,EAAE,aAAa;CACrC,SAAS,MAAM,QAAQ,EAAG;CAC1B,YAAY;AACd,EAAE"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { useWidgetEvents } from "../../hooks/useWidgetEvents.js";
|
|
2
|
+
import "../../types/events.js";
|
|
1
3
|
import { useWidgetConfig } from "../../providers/WidgetProvider/WidgetProvider.js";
|
|
2
4
|
import { CardTabs, Tab as Tab$1 } from "../../components/Tabs/Tabs.style.js";
|
|
3
5
|
import { CardValue } from "../../components/Card/CardButton.style.js";
|
|
@@ -26,12 +28,14 @@ const ThemeTab = ({ title, value, Icon, ...props }) => /* @__PURE__ */ jsx(Toolt
|
|
|
26
28
|
const ThemeSettings = () => {
|
|
27
29
|
const { t } = useTranslation();
|
|
28
30
|
const { mode, setMode } = useColorScheme();
|
|
31
|
+
const widgetEvents = useWidgetEvents();
|
|
29
32
|
const { hiddenUI } = useWidgetConfig();
|
|
30
33
|
if (hiddenUI?.appearance) return null;
|
|
31
34
|
const appearance = mode ?? "system";
|
|
32
35
|
const ThemeIcon = themeIcons[appearance];
|
|
33
36
|
const handleThemeChange = (_, appearance) => {
|
|
34
37
|
setMode(appearance);
|
|
38
|
+
widgetEvents.emit("appearanceChanged", appearance);
|
|
35
39
|
};
|
|
36
40
|
return /* @__PURE__ */ jsx(SettingCardExpandable, {
|
|
37
41
|
value: /* @__PURE__ */ jsxs(CardValue, { children: [t(`button.${appearance}`), " "] }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeSettings.js","names":["Tab"],"sources":["../../../../src/pages/SettingsPage/ThemeSettings.tsx"],"sourcesContent":["import BrightnessAuto from '@mui/icons-material/BrightnessAuto'\nimport LightMode from '@mui/icons-material/LightMode'\nimport Nightlight from '@mui/icons-material/Nightlight'\nimport { Tooltip, useColorScheme } from '@mui/material'\nimport { useTranslation } from 'react-i18next'\nimport { CardValue } from '../../components/Card/CardButton.style.js'\nimport { CardTabs, Tab } from '../../components/Tabs/Tabs.style.js'\nimport { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'\nimport type { Appearance } from '../../types/widget.js'\nimport { SettingCardExpandable } from './SettingsCard/SettingCardExpandable.js'\n\nconst themeIcons = {\n light: LightMode,\n dark: Nightlight,\n system: BrightnessAuto,\n}\n\ninterface ThemeTabProps {\n title: string\n value: Appearance\n Icon: React.ReactElement\n}\n\n// If the Tab is not the direct child of the Tabs component you can loose the switching\n// The component passes the props to the Tab component so switching isn't lost\nconst ThemeTab: React.FC<ThemeTabProps> = ({\n title,\n value,\n Icon,\n ...props\n}) => (\n <Tooltip title={title}>\n <Tab icon={Icon} value={value} {...props} disableRipple />\n </Tooltip>\n)\n\nexport const ThemeSettings: React.FC = () => {\n const { t } = useTranslation()\n const { mode, setMode } = useColorScheme()\n const { hiddenUI } = useWidgetConfig()\n\n if (hiddenUI?.appearance) {\n return null\n }\n\n const appearance = mode ?? 'system'\n\n const ThemeIcon = themeIcons[appearance]\n\n const handleThemeChange = (\n _: React.SyntheticEvent,\n appearance: Appearance\n ) => {\n setMode(appearance)\n }\n\n return (\n <SettingCardExpandable\n value={<CardValue>{t(`button.${appearance}`)} </CardValue>}\n icon={<ThemeIcon />}\n title={t('settings.appearance')}\n >\n <CardTabs\n value={appearance}\n aria-label=\"tabs\"\n indicatorColor=\"primary\"\n onChange={handleThemeChange}\n sx={{ mt: 1.5 }}\n >\n {Object.entries(themeIcons).map(([theme, Icon]) => {\n const supportedThemeOption = theme as Appearance\n\n return (\n <ThemeTab\n key={supportedThemeOption}\n title={t(`button.${supportedThemeOption}`)}\n value={supportedThemeOption}\n Icon={<Icon />}\n />\n )\n })}\n </CardTabs>\n </SettingCardExpandable>\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ThemeSettings.js","names":["Tab"],"sources":["../../../../src/pages/SettingsPage/ThemeSettings.tsx"],"sourcesContent":["import BrightnessAuto from '@mui/icons-material/BrightnessAuto'\nimport LightMode from '@mui/icons-material/LightMode'\nimport Nightlight from '@mui/icons-material/Nightlight'\nimport { Tooltip, useColorScheme } from '@mui/material'\nimport { useTranslation } from 'react-i18next'\nimport { CardValue } from '../../components/Card/CardButton.style.js'\nimport { CardTabs, Tab } from '../../components/Tabs/Tabs.style.js'\nimport { useWidgetEvents } from '../../hooks/useWidgetEvents.js'\nimport { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'\nimport { WidgetEvent } from '../../types/events.js'\nimport type { Appearance } from '../../types/widget.js'\nimport { SettingCardExpandable } from './SettingsCard/SettingCardExpandable.js'\n\nconst themeIcons = {\n light: LightMode,\n dark: Nightlight,\n system: BrightnessAuto,\n}\n\ninterface ThemeTabProps {\n title: string\n value: Appearance\n Icon: React.ReactElement\n}\n\n// If the Tab is not the direct child of the Tabs component you can loose the switching\n// The component passes the props to the Tab component so switching isn't lost\nconst ThemeTab: React.FC<ThemeTabProps> = ({\n title,\n value,\n Icon,\n ...props\n}) => (\n <Tooltip title={title}>\n <Tab icon={Icon} value={value} {...props} disableRipple />\n </Tooltip>\n)\n\nexport const ThemeSettings: React.FC = () => {\n const { t } = useTranslation()\n const { mode, setMode } = useColorScheme()\n const widgetEvents = useWidgetEvents()\n const { hiddenUI } = useWidgetConfig()\n\n if (hiddenUI?.appearance) {\n return null\n }\n\n const appearance = mode ?? 'system'\n\n const ThemeIcon = themeIcons[appearance]\n\n const handleThemeChange = (\n _: React.SyntheticEvent,\n appearance: Appearance\n ) => {\n setMode(appearance)\n widgetEvents.emit(WidgetEvent.AppearanceChanged, appearance)\n }\n\n return (\n <SettingCardExpandable\n value={<CardValue>{t(`button.${appearance}`)} </CardValue>}\n icon={<ThemeIcon />}\n title={t('settings.appearance')}\n >\n <CardTabs\n value={appearance}\n aria-label=\"tabs\"\n indicatorColor=\"primary\"\n onChange={handleThemeChange}\n sx={{ mt: 1.5 }}\n >\n {Object.entries(themeIcons).map(([theme, Icon]) => {\n const supportedThemeOption = theme as Appearance\n\n return (\n <ThemeTab\n key={supportedThemeOption}\n title={t(`button.${supportedThemeOption}`)}\n value={supportedThemeOption}\n Icon={<Icon />}\n />\n )\n })}\n </CardTabs>\n </SettingCardExpandable>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,aAAa;CACjB,OAAO;CACP,MAAM;CACN,QAAQ;AACV;AAUA,MAAM,YAAqC,EACzC,OACA,OACA,MACA,GAAG,YAEH,oBAAC,SAAD;CAAgB;WACd,oBAACA,OAAD;EAAK,MAAM;EAAa;EAAO,GAAI;EAAO,eAAA;CAAe,CAAA;AAClD,CAAA;AAGX,MAAa,sBAAgC;CAC3C,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,EAAE,MAAM,YAAY,eAAe;CACzC,MAAM,eAAe,gBAAgB;CACrC,MAAM,EAAE,aAAa,gBAAgB;CAErC,IAAI,UAAU,YACZ,OAAO;CAGT,MAAM,aAAa,QAAQ;CAE3B,MAAM,YAAY,WAAW;CAE7B,MAAM,qBACJ,GACA,eACG;EACH,QAAQ,UAAU;EAClB,aAAa,KAAA,qBAAoC,UAAU;CAC7D;CAEA,OACE,oBAAC,uBAAD;EACE,OAAO,qBAAC,WAAD,EAAA,UAAA,CAAY,EAAE,UAAU,YAAY,GAAE,GAAY,EAAA,CAAA;EACzD,MAAM,oBAAC,WAAD,CAAY,CAAA;EAClB,OAAO,EAAE,qBAAqB;YAE9B,oBAAC,UAAD;GACE,OAAO;GACP,cAAW;GACX,gBAAe;GACf,UAAU;GACV,IAAI,EAAE,IAAI,IAAI;aAEb,OAAO,QAAQ,UAAU,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU;IACjD,MAAM,uBAAuB;IAE7B,OACE,oBAAC,UAAD;KAEE,OAAO,EAAE,UAAU,sBAAsB;KACzC,OAAO;KACP,MAAM,oBAAC,MAAD,CAAO,CAAA;IACd,GAJM,oBAIN;GAEL,CAAC;EACO,CAAA;CACW,CAAA;AAE3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactSupportButton.style.js","names":[],"sources":["../../../../src/pages/TransactionDetailsPage/ContactSupportButton.style.tsx"],"sourcesContent":["import { styled } from '@mui/material'\nimport type React from 'react'\nimport { ButtonTertiary } from '../../components/ButtonTertiary.js'\n\nexport const ButtonChip: React.FC<React.ComponentProps<typeof ButtonTertiary>> =\n styled(ButtonTertiary)(({ theme }) => ({\n padding: theme.spacing(0.5, 1.5),\n fontSize: 12,\n fontWeight: 700,\n lineHeight: 1.3334,\n height: 'auto',\n }))\n"],"mappings":";;;AAIA,MAAa,aACX,OAAO,cAAc,
|
|
1
|
+
{"version":3,"file":"ContactSupportButton.style.js","names":[],"sources":["../../../../src/pages/TransactionDetailsPage/ContactSupportButton.style.tsx"],"sourcesContent":["import { styled } from '@mui/material'\nimport type React from 'react'\nimport { ButtonTertiary } from '../../components/ButtonTertiary.js'\n\nexport const ButtonChip: React.FC<React.ComponentProps<typeof ButtonTertiary>> =\n styled(ButtonTertiary)(({ theme }) => ({\n padding: theme.spacing(0.5, 1.5),\n fontSize: 12,\n fontWeight: 700,\n lineHeight: 1.3334,\n height: 'auto',\n }))\n"],"mappings":";;;AAIA,MAAa,aACX,OAAO,cAAc,CAAC,EAAE,EAAE,aAAa;CACrC,SAAS,MAAM,QAAQ,IAAK,GAAG;CAC/B,UAAU;CACV,YAAY;CACZ,YAAY;CACZ,QAAQ;AACV,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionDetailsPage.js","names":[],"sources":["../../../../src/pages/TransactionDetailsPage/TransactionDetailsPage.tsx"],"sourcesContent":["import type { FullStatusData } from '@lifi/sdk'\nimport { useLocation, useNavigate } from '@tanstack/react-router'\nimport { useEffect, useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { ContractComponent } from '../../components/ContractComponent/ContractComponent.js'\nimport { PageContainer } from '../../components/PageContainer.js'\nimport { TransactionCard } from '../../components/TransactionCard/TransactionCard.js'\nimport { internalExplorerUrl } from '../../config/constants.js'\nimport { useExplorer } from '../../hooks/useExplorer.js'\nimport { useHeader } from '../../hooks/useHeader.js'\nimport { useTools } from '../../hooks/useTools.js'\nimport { useTransactionDetails } from '../../hooks/useTransactionDetails.js'\nimport { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'\nimport { useRouteExecutionStore } from '../../stores/routes/RouteExecutionStore.js'\nimport { getSourceTxHash } from '../../stores/routes/utils.js'\nimport { buildRouteFromTxHistory } from '../../utils/converters.js'\nimport { navigationRoutes } from '../../utils/navigationRoutes.js'\nimport { ReceiptsCard } from './ReceiptsCard.js'\nimport { TransactionDetailsSkeleton } from './TransactionDetailsSkeleton.js'\nimport { TransferIdCard } from './TransferIdCard.js'\n\nexport const TransactionDetailsPage: React.FC = () => {\n const { t } = useTranslation()\n const navigate = useNavigate()\n const { mode, modeOptions, contractSecondaryComponent, explorerUrls } =\n useWidgetConfig()\n const { search }: any = useLocation()\n const { tools } = useTools()\n const { getTransactionLink } = useExplorer()\n const storedRouteExecution = useRouteExecutionStore((store) =>\n search?.routeId ? store.routes[search.routeId] : undefined\n )\n const { transaction, isLoading } = useTransactionDetails(\n !storedRouteExecution && search?.transactionHash\n )\n\n const title =\n mode === 'custom'\n ? t(`header.${modeOptions?.custom?.type ?? 'checkout'}Details`)\n : t('header.transactionDetails')\n useHeader(title)\n\n const routeExecution = useMemo(() => {\n if (storedRouteExecution) {\n return storedRouteExecution\n }\n if (isLoading) {\n return\n }\n if (transaction) {\n return buildRouteFromTxHistory(transaction as FullStatusData, tools)\n }\n }, [isLoading, storedRouteExecution, tools, transaction])\n\n useEffect(() => {\n if (!isLoading && !routeExecution) {\n navigate({ to: navigationRoutes.home })\n }\n }, [isLoading, navigate, routeExecution])\n\n const explorerUrl = explorerUrls?.internal?.[0]\n const url = typeof explorerUrl === 'string' ? explorerUrl : explorerUrl?.url\n\n const sourceTxHash = getSourceTxHash(routeExecution?.route)\n let supportId = sourceTxHash ?? routeExecution?.route.id ?? ''\n\n const internalTxLink =\n routeExecution?.route?.steps?.at(-1)?.execution?.internalTxLink\n const externalTxLink =\n routeExecution?.route?.steps?.at(-1)?.execution?.externalTxLink\n\n const txLink =\n (url\n ? internalTxLink?.replace(internalExplorerUrl, url)\n : internalTxLink) ||\n externalTxLink ||\n getTransactionLink({ txHash: supportId })\n\n if (process.env.NODE_ENV === 'development') {\n supportId += `_${routeExecution?.route.id}`\n }\n\n const startedAt = new Date(\n routeExecution?.route.steps[0].execution?.startedAt ?? 0\n )\n\n if (isLoading && !storedRouteExecution) {\n return <TransactionDetailsSkeleton />\n }\n\n if (!routeExecution?.route) {\n return null\n }\n\n return (\n <PageContainer\n topGutters\n bottomGutters\n sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}\n >\n <TransactionCard route={routeExecution.route} date={startedAt} />\n {mode === 'custom' && contractSecondaryComponent ? (\n <ContractComponent>{contractSecondaryComponent}</ContractComponent>\n ) : null}\n <ReceiptsCard route={routeExecution.route} />\n {supportId ? (\n <TransferIdCard transferId={supportId} txLink={txLink} />\n ) : null}\n </PageContainer>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,+BAAyC;CACpD,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,WAAW,YAAY;CAC7B,MAAM,EAAE,MAAM,aAAa,4BAA4B,iBACrD,gBAAgB;CAClB,MAAM,EAAE,WAAgB,YAAY;CACpC,MAAM,EAAE,UAAU,SAAS;CAC3B,MAAM,EAAE,uBAAuB,YAAY;CAC3C,MAAM,uBAAuB,wBAAwB,UACnD,QAAQ,UAAU,MAAM,OAAO,OAAO,WAAW,KAAA,CACnD;CACA,MAAM,EAAE,aAAa,cAAc,sBACjC,CAAC,wBAAwB,QAAQ,eACnC;CAMA,UAHE,SAAS,WACL,EAAE,UAAU,aAAa,QAAQ,QAAQ,WAAW,QAAQ,IAC5D,EAAE,2BAA2B,CACpB;CAEf,MAAM,iBAAiB,cAAc;EACnC,IAAI,sBACF,OAAO;EAET,IAAI,WACF;EAEF,IAAI,aACF,OAAO,wBAAwB,aAA+B,KAAK;CAEvE,GAAG;EAAC;EAAW;EAAsB;EAAO;CAAW,CAAC;CAExD,gBAAgB;EACd,IAAI,CAAC,aAAa,CAAC,gBACjB,SAAS,EAAE,IAAI,iBAAiB,KAAK,CAAC;CAE1C,GAAG;EAAC;EAAW;EAAU;CAAc,CAAC;CAExC,MAAM,cAAc,cAAc,WAAW;CAC7C,MAAM,MAAM,OAAO,gBAAgB,WAAW,cAAc,aAAa;CAGzE,IAAI,YADiB,gBAAgB,gBAAgB,KAC1B,KAAK,gBAAgB,MAAM,MAAM;CAE5D,MAAM,iBACJ,gBAAgB,OAAO,OAAO,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"TransactionDetailsPage.js","names":[],"sources":["../../../../src/pages/TransactionDetailsPage/TransactionDetailsPage.tsx"],"sourcesContent":["import type { FullStatusData } from '@lifi/sdk'\nimport { useLocation, useNavigate } from '@tanstack/react-router'\nimport { useEffect, useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { ContractComponent } from '../../components/ContractComponent/ContractComponent.js'\nimport { PageContainer } from '../../components/PageContainer.js'\nimport { TransactionCard } from '../../components/TransactionCard/TransactionCard.js'\nimport { internalExplorerUrl } from '../../config/constants.js'\nimport { useExplorer } from '../../hooks/useExplorer.js'\nimport { useHeader } from '../../hooks/useHeader.js'\nimport { useTools } from '../../hooks/useTools.js'\nimport { useTransactionDetails } from '../../hooks/useTransactionDetails.js'\nimport { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'\nimport { useRouteExecutionStore } from '../../stores/routes/RouteExecutionStore.js'\nimport { getSourceTxHash } from '../../stores/routes/utils.js'\nimport { buildRouteFromTxHistory } from '../../utils/converters.js'\nimport { navigationRoutes } from '../../utils/navigationRoutes.js'\nimport { ReceiptsCard } from './ReceiptsCard.js'\nimport { TransactionDetailsSkeleton } from './TransactionDetailsSkeleton.js'\nimport { TransferIdCard } from './TransferIdCard.js'\n\nexport const TransactionDetailsPage: React.FC = () => {\n const { t } = useTranslation()\n const navigate = useNavigate()\n const { mode, modeOptions, contractSecondaryComponent, explorerUrls } =\n useWidgetConfig()\n const { search }: any = useLocation()\n const { tools } = useTools()\n const { getTransactionLink } = useExplorer()\n const storedRouteExecution = useRouteExecutionStore((store) =>\n search?.routeId ? store.routes[search.routeId] : undefined\n )\n const { transaction, isLoading } = useTransactionDetails(\n !storedRouteExecution && search?.transactionHash\n )\n\n const title =\n mode === 'custom'\n ? t(`header.${modeOptions?.custom?.type ?? 'checkout'}Details`)\n : t('header.transactionDetails')\n useHeader(title)\n\n const routeExecution = useMemo(() => {\n if (storedRouteExecution) {\n return storedRouteExecution\n }\n if (isLoading) {\n return\n }\n if (transaction) {\n return buildRouteFromTxHistory(transaction as FullStatusData, tools)\n }\n }, [isLoading, storedRouteExecution, tools, transaction])\n\n useEffect(() => {\n if (!isLoading && !routeExecution) {\n navigate({ to: navigationRoutes.home })\n }\n }, [isLoading, navigate, routeExecution])\n\n const explorerUrl = explorerUrls?.internal?.[0]\n const url = typeof explorerUrl === 'string' ? explorerUrl : explorerUrl?.url\n\n const sourceTxHash = getSourceTxHash(routeExecution?.route)\n let supportId = sourceTxHash ?? routeExecution?.route.id ?? ''\n\n const internalTxLink =\n routeExecution?.route?.steps?.at(-1)?.execution?.internalTxLink\n const externalTxLink =\n routeExecution?.route?.steps?.at(-1)?.execution?.externalTxLink\n\n const txLink =\n (url\n ? internalTxLink?.replace(internalExplorerUrl, url)\n : internalTxLink) ||\n externalTxLink ||\n getTransactionLink({ txHash: supportId })\n\n if (process.env.NODE_ENV === 'development') {\n supportId += `_${routeExecution?.route.id}`\n }\n\n const startedAt = new Date(\n routeExecution?.route.steps[0].execution?.startedAt ?? 0\n )\n\n if (isLoading && !storedRouteExecution) {\n return <TransactionDetailsSkeleton />\n }\n\n if (!routeExecution?.route) {\n return null\n }\n\n return (\n <PageContainer\n topGutters\n bottomGutters\n sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}\n >\n <TransactionCard route={routeExecution.route} date={startedAt} />\n {mode === 'custom' && contractSecondaryComponent ? (\n <ContractComponent>{contractSecondaryComponent}</ContractComponent>\n ) : null}\n <ReceiptsCard route={routeExecution.route} />\n {supportId ? (\n <TransferIdCard transferId={supportId} txLink={txLink} />\n ) : null}\n </PageContainer>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,+BAAyC;CACpD,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,WAAW,YAAY;CAC7B,MAAM,EAAE,MAAM,aAAa,4BAA4B,iBACrD,gBAAgB;CAClB,MAAM,EAAE,WAAgB,YAAY;CACpC,MAAM,EAAE,UAAU,SAAS;CAC3B,MAAM,EAAE,uBAAuB,YAAY;CAC3C,MAAM,uBAAuB,wBAAwB,UACnD,QAAQ,UAAU,MAAM,OAAO,OAAO,WAAW,KAAA,CACnD;CACA,MAAM,EAAE,aAAa,cAAc,sBACjC,CAAC,wBAAwB,QAAQ,eACnC;CAMA,UAHE,SAAS,WACL,EAAE,UAAU,aAAa,QAAQ,QAAQ,WAAW,QAAQ,IAC5D,EAAE,2BAA2B,CACpB;CAEf,MAAM,iBAAiB,cAAc;EACnC,IAAI,sBACF,OAAO;EAET,IAAI,WACF;EAEF,IAAI,aACF,OAAO,wBAAwB,aAA+B,KAAK;CAEvE,GAAG;EAAC;EAAW;EAAsB;EAAO;CAAW,CAAC;CAExD,gBAAgB;EACd,IAAI,CAAC,aAAa,CAAC,gBACjB,SAAS,EAAE,IAAI,iBAAiB,KAAK,CAAC;CAE1C,GAAG;EAAC;EAAW;EAAU;CAAc,CAAC;CAExC,MAAM,cAAc,cAAc,WAAW;CAC7C,MAAM,MAAM,OAAO,gBAAgB,WAAW,cAAc,aAAa;CAGzE,IAAI,YADiB,gBAAgB,gBAAgB,KAC1B,KAAK,gBAAgB,MAAM,MAAM;CAE5D,MAAM,iBACJ,gBAAgB,OAAO,OAAO,GAAG,EAAE,CAAC,EAAE,WAAW;CACnD,MAAM,iBACJ,gBAAgB,OAAO,OAAO,GAAG,EAAE,CAAC,EAAE,WAAW;CAEnD,MAAM,UACH,MACG,gBAAgB,QAAA,sBAA6B,GAAG,IAChD,mBACJ,kBACA,mBAAmB,EAAE,QAAQ,UAAU,CAAC;CAE1C,IAAI,QAAQ,IAAI,aAAa,eAC3B,aAAa,IAAI,gBAAgB,MAAM;CAGzC,MAAM,YAAY,IAAI,KACpB,gBAAgB,MAAM,MAAM,EAAE,CAAC,WAAW,aAAa,CACzD;CAEA,IAAI,aAAa,CAAC,sBAChB,OAAO,oBAAC,4BAAD,CAA6B,CAAA;CAGtC,IAAI,CAAC,gBAAgB,OACnB,OAAO;CAGT,OACE,qBAAC,eAAD;EACE,YAAA;EACA,eAAA;EACA,IAAI;GAAE,SAAS;GAAQ,eAAe;GAAU,KAAK;EAAE;YAHzD;GAKE,oBAAC,iBAAD;IAAiB,OAAO,eAAe;IAAO,MAAM;GAAY,CAAA;GAC/D,SAAS,YAAY,6BACpB,oBAAC,mBAAD,EAAA,UAAoB,2BAA8C,CAAA,IAChE;GACJ,oBAAC,cAAD,EAAc,OAAO,eAAe,MAAQ,CAAA;GAC3C,YACC,oBAAC,gBAAD;IAAgB,YAAY;IAAmB;GAAS,CAAA,IACtD;EACS;;AAEnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionDetailsSkeleton.js","names":["Card"],"sources":["../../../../src/pages/TransactionDetailsPage/TransactionDetailsSkeleton.tsx"],"sourcesContent":["import { Box, Skeleton } from '@mui/material'\nimport type { JSX } from 'react'\nimport { Card } from '../../components/Card/Card.js'\nimport { PageContainer } from '../../components/PageContainer.js'\nimport { TokenSkeleton } from '../../components/Token/Token.js'\n\nexport const TransactionDetailsSkeleton = (): JSX.Element => {\n return (\n <PageContainer topGutters>\n <Box\n sx={{\n pb: 1,\n pt: 0.75,\n display: 'flex',\n flex: 1,\n justifyContent: 'space-between',\n }}\n >\n <Skeleton width={96} height={20} variant=\"text\" />\n <Skeleton width={40} height={20} variant=\"text\" />\n </Box>\n <Card sx={{ paddingX: 2, marginBottom: 3 }}>\n <Box\n sx={{\n pt: 2.5,\n }}\n >\n <Skeleton width={64} height={12} variant=\"rounded\" />\n </Box>\n <Box\n sx={{\n py: 1,\n }}\n >\n {/* Token skeleton */}\n <Box\n sx={{\n py: 1,\n }}\n >\n <TokenSkeleton />\n </Box>\n {/* Bridge skeleton */}\n <Box\n sx={{\n py: 1,\n }}\n >\n <TokenSkeleton disableDescription />\n </Box>\n {/* Steps skeleton */}\n {Array.from({ length: 3 }).map((_, key) => (\n <Box\n key={key}\n sx={{\n py: 1,\n display: 'flex',\n alignItems: 'center',\n }}\n >\n <Skeleton\n variant=\"rounded\"\n width={40}\n height={40}\n sx={{\n borderRadius: '100%',\n }}\n />\n <Skeleton\n sx={{\n ml: 2,\n }}\n width={96}\n height={24}\n variant=\"text\"\n />\n </Box>\n ))}\n {/* Receiving Token skeleton */}\n <Box\n sx={{\n py: 1,\n }}\n >\n <TokenSkeleton />\n </Box>\n </Box>\n </Card>\n </PageContainer>\n )\n}\n"],"mappings":";;;;;;AAMA,MAAa,mCAAgD;CAC3D,OACE,qBAAC,eAAD;EAAe,YAAA;YAAf,CACE,qBAAC,KAAD;GACE,IAAI;IACF,IAAI;IACJ,IAAI;IACJ,SAAS;IACT,MAAM;IACN,gBAAgB;GAClB;aAPF,CASE,oBAAC,UAAD;IAAU,OAAO;IAAI,QAAQ;IAAI,SAAQ;GAAQ,CAAA,GACjD,oBAAC,UAAD;IAAU,OAAO;IAAI,QAAQ;IAAI,SAAQ;GAAQ,CAAA,CAC9C;MACL,qBAACA,QAAD;GAAM,IAAI;IAAE,UAAU;IAAG,cAAc;GAAE;aAAzC,CACE,oBAAC,KAAD;IACE,IAAI,EACF,IAAI,IACN;cAEA,oBAAC,UAAD;KAAU,OAAO;KAAI,QAAQ;KAAI,SAAQ;IAAW,CAAA;GACjD,CAAA,GACL,qBAAC,KAAD;IACE,IAAI,EACF,IAAI,EACN;cAHF;KAME,oBAAC,KAAD;MACE,IAAI,EACF,IAAI,EACN;gBAEA,oBAAC,eAAD,CAAgB,CAAA;KACb,CAAA;KAEL,oBAAC,KAAD;MACE,IAAI,EACF,IAAI,EACN;gBAEA,oBAAC,eAAD,EAAe,oBAAA,KAAoB,CAAA;KAChC,CAAA;KAEJ,MAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"TransactionDetailsSkeleton.js","names":["Card"],"sources":["../../../../src/pages/TransactionDetailsPage/TransactionDetailsSkeleton.tsx"],"sourcesContent":["import { Box, Skeleton } from '@mui/material'\nimport type { JSX } from 'react'\nimport { Card } from '../../components/Card/Card.js'\nimport { PageContainer } from '../../components/PageContainer.js'\nimport { TokenSkeleton } from '../../components/Token/Token.js'\n\nexport const TransactionDetailsSkeleton = (): JSX.Element => {\n return (\n <PageContainer topGutters>\n <Box\n sx={{\n pb: 1,\n pt: 0.75,\n display: 'flex',\n flex: 1,\n justifyContent: 'space-between',\n }}\n >\n <Skeleton width={96} height={20} variant=\"text\" />\n <Skeleton width={40} height={20} variant=\"text\" />\n </Box>\n <Card sx={{ paddingX: 2, marginBottom: 3 }}>\n <Box\n sx={{\n pt: 2.5,\n }}\n >\n <Skeleton width={64} height={12} variant=\"rounded\" />\n </Box>\n <Box\n sx={{\n py: 1,\n }}\n >\n {/* Token skeleton */}\n <Box\n sx={{\n py: 1,\n }}\n >\n <TokenSkeleton />\n </Box>\n {/* Bridge skeleton */}\n <Box\n sx={{\n py: 1,\n }}\n >\n <TokenSkeleton disableDescription />\n </Box>\n {/* Steps skeleton */}\n {Array.from({ length: 3 }).map((_, key) => (\n <Box\n key={key}\n sx={{\n py: 1,\n display: 'flex',\n alignItems: 'center',\n }}\n >\n <Skeleton\n variant=\"rounded\"\n width={40}\n height={40}\n sx={{\n borderRadius: '100%',\n }}\n />\n <Skeleton\n sx={{\n ml: 2,\n }}\n width={96}\n height={24}\n variant=\"text\"\n />\n </Box>\n ))}\n {/* Receiving Token skeleton */}\n <Box\n sx={{\n py: 1,\n }}\n >\n <TokenSkeleton />\n </Box>\n </Box>\n </Card>\n </PageContainer>\n )\n}\n"],"mappings":";;;;;;AAMA,MAAa,mCAAgD;CAC3D,OACE,qBAAC,eAAD;EAAe,YAAA;YAAf,CACE,qBAAC,KAAD;GACE,IAAI;IACF,IAAI;IACJ,IAAI;IACJ,SAAS;IACT,MAAM;IACN,gBAAgB;GAClB;aAPF,CASE,oBAAC,UAAD;IAAU,OAAO;IAAI,QAAQ;IAAI,SAAQ;GAAQ,CAAA,GACjD,oBAAC,UAAD;IAAU,OAAO;IAAI,QAAQ;IAAI,SAAQ;GAAQ,CAAA,CAC9C;MACL,qBAACA,QAAD;GAAM,IAAI;IAAE,UAAU;IAAG,cAAc;GAAE;aAAzC,CACE,oBAAC,KAAD;IACE,IAAI,EACF,IAAI,IACN;cAEA,oBAAC,UAAD;KAAU,OAAO;KAAI,QAAQ;KAAI,SAAQ;IAAW,CAAA;GACjD,CAAA,GACL,qBAAC,KAAD;IACE,IAAI,EACF,IAAI,EACN;cAHF;KAME,oBAAC,KAAD;MACE,IAAI,EACF,IAAI,EACN;gBAEA,oBAAC,eAAD,CAAgB,CAAA;KACb,CAAA;KAEL,oBAAC,KAAD;MACE,IAAI,EACF,IAAI,EACN;gBAEA,oBAAC,eAAD,EAAe,oBAAA,KAAoB,CAAA;KAChC,CAAA;KAEJ,MAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,QACjC,qBAAC,KAAD;MAEE,IAAI;OACF,IAAI;OACJ,SAAS;OACT,YAAY;MACd;gBANF,CAQE,oBAAC,UAAD;OACE,SAAQ;OACR,OAAO;OACP,QAAQ;OACR,IAAI,EACF,cAAc,OAChB;MACD,CAAA,GACD,oBAAC,UAAD;OACE,IAAI,EACF,IAAI,EACN;OACA,OAAO;OACP,QAAQ;OACR,SAAQ;MACT,CAAA,CACE;QAvBE,GAuBF,CACN;KAED,oBAAC,KAAD;MACE,IAAI,EACF,IAAI,EACN;gBAEA,oBAAC,eAAD,CAAgB,CAAA;KACb,CAAA;IACF;KACD;IACO;;AAEnB"}
|
|
@@ -5,14 +5,14 @@ import { AlertMessage } from "../../components/Messages/AlertMessage.js";
|
|
|
5
5
|
import { BottomSheet } from "../../components/BottomSheet/BottomSheet.js";
|
|
6
6
|
import { IconContainer, SendToWalletButtonRow, SendToWalletSheetContainer, SheetAddressContainer } from "../SendToWallet/SendToWalletPage.style.js";
|
|
7
7
|
import { useSetContentHeight } from "../../hooks/useSetContentHeight.js";
|
|
8
|
-
import {
|
|
8
|
+
import { useRef } from "react";
|
|
9
9
|
import { Button, Typography } from "@mui/material";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { useTranslation } from "react-i18next";
|
|
12
12
|
import Wallet from "@mui/icons-material/Wallet";
|
|
13
13
|
import WarningRounded from "@mui/icons-material/WarningRounded";
|
|
14
14
|
//#region src/pages/TransactionPage/ConfirmToAddressSheet.tsx
|
|
15
|
-
const ConfirmToAddressSheet =
|
|
15
|
+
const ConfirmToAddressSheet = ({ ref, ...props }) => {
|
|
16
16
|
const handleClose = () => {
|
|
17
17
|
ref.current?.close();
|
|
18
18
|
};
|
|
@@ -23,7 +23,7 @@ const ConfirmToAddressSheet = forwardRef((props, ref) => {
|
|
|
23
23
|
onClose: handleClose
|
|
24
24
|
})
|
|
25
25
|
});
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
27
|
const ConfirmToAddressSheetContent = ({ onContinue, onClose, toAddress, toChainId }) => {
|
|
28
28
|
const { t } = useTranslation();
|
|
29
29
|
const { chain } = useChain(toChainId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmToAddressSheet.js","names":[],"sources":["../../../../src/pages/TransactionPage/ConfirmToAddressSheet.tsx"],"sourcesContent":["import Wallet from '@mui/icons-material/Wallet'\nimport WarningRounded from '@mui/icons-material/WarningRounded'\nimport { Button, Typography } from '@mui/material'\nimport type {
|
|
1
|
+
{"version":3,"file":"ConfirmToAddressSheet.js","names":[],"sources":["../../../../src/pages/TransactionPage/ConfirmToAddressSheet.tsx"],"sourcesContent":["import Wallet from '@mui/icons-material/Wallet'\nimport WarningRounded from '@mui/icons-material/WarningRounded'\nimport { Button, Typography } from '@mui/material'\nimport type { JSX, Ref, RefObject } from 'react'\nimport { useRef } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { BottomSheet } from '../../components/BottomSheet/BottomSheet.js'\nimport type { BottomSheetBase } from '../../components/BottomSheet/types.js'\nimport { AlertMessage } from '../../components/Messages/AlertMessage.js'\nimport { useChain } from '../../hooks/useChain.js'\nimport { useSetContentHeight } from '../../hooks/useSetContentHeight.js'\nimport { useWidgetEvents } from '../../hooks/useWidgetEvents.js'\nimport { WidgetEvent } from '../../types/events.js'\nimport {\n IconContainer,\n SendToWalletButtonRow,\n SendToWalletSheetContainer,\n SheetAddressContainer,\n} from '../SendToWallet/SendToWalletPage.style.js'\n\ninterface ConfirmToAddressSheetProps {\n onContinue: () => void\n toAddress: string\n toChainId: number\n}\n\ninterface ConfirmToAddressSheetContentProps extends ConfirmToAddressSheetProps {\n onClose: () => void\n}\n\nexport const ConfirmToAddressSheet = ({\n ref,\n ...props\n}: ConfirmToAddressSheetProps & {\n ref?: Ref<BottomSheetBase>\n}): JSX.Element => {\n const handleClose = () => {\n ;(ref as RefObject<BottomSheetBase>).current?.close()\n }\n\n return (\n <BottomSheet ref={ref}>\n <ConfirmToAddressSheetContent {...props} onClose={handleClose} />\n </BottomSheet>\n )\n}\n\nconst ConfirmToAddressSheetContent: React.FC<\n ConfirmToAddressSheetContentProps\n> = ({ onContinue, onClose, toAddress, toChainId }) => {\n const { t } = useTranslation()\n const { chain } = useChain(toChainId)\n const emitter = useWidgetEvents()\n const ref = useRef<HTMLElement>(null)\n useSetContentHeight(ref)\n\n const handleContinue = () => {\n emitter.emit(WidgetEvent.LowAddressActivityConfirmed, {\n address: toAddress,\n chainId: toChainId,\n })\n onClose()\n onContinue()\n }\n\n return (\n <SendToWalletSheetContainer ref={ref}>\n <IconContainer>\n <Wallet sx={{ fontSize: 40 }} />\n </IconContainer>\n <Typography variant=\"h6\" sx={{ textAlign: 'center', mb: 2 }}>\n {t('warning.title.lowAddressActivity')}\n </Typography>\n <SheetAddressContainer>\n <Typography>{toAddress}</Typography>\n </SheetAddressContainer>\n <AlertMessage\n severity=\"warning\"\n title={\n <Typography variant=\"body2\" sx={{ color: 'text.primary' }}>\n {t('warning.message.lowAddressActivity', {\n chainName: chain?.name,\n })}\n </Typography>\n }\n icon={<WarningRounded />}\n multiline\n />\n <SendToWalletButtonRow>\n <Button variant=\"text\" onClick={onClose} fullWidth>\n {t('button.cancel')}\n </Button>\n <Button variant=\"contained\" onClick={handleContinue} fullWidth>\n {t('button.continue')}\n </Button>\n </SendToWalletButtonRow>\n </SendToWalletSheetContainer>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AA8BA,MAAa,yBAAyB,EACpC,KACA,GAAG,YAGc;CACjB,MAAM,oBAAoB;EACvB,IAAoC,SAAS,MAAM;CACtD;CAEA,OACE,oBAAC,aAAD;EAAkB;YAChB,oBAAC,8BAAD;GAA8B,GAAI;GAAO,SAAS;EAAc,CAAA;CACrD,CAAA;AAEjB;AAEA,MAAM,gCAED,EAAE,YAAY,SAAS,WAAW,gBAAgB;CACrD,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,EAAE,UAAU,SAAS,SAAS;CACpC,MAAM,UAAU,gBAAgB;CAChC,MAAM,MAAM,OAAoB,IAAI;CACpC,oBAAoB,GAAG;CAEvB,MAAM,uBAAuB;EAC3B,QAAQ,KAAA,+BAA8C;GACpD,SAAS;GACT,SAAS;EACX,CAAC;EACD,QAAQ;EACR,WAAW;CACb;CAEA,OACE,qBAAC,4BAAD;EAAiC;YAAjC;GACE,oBAAC,eAAD,EAAA,UACE,oBAAC,QAAD,EAAQ,IAAI,EAAE,UAAU,GAAG,EAAI,CAAA,EAClB,CAAA;GACf,oBAAC,YAAD;IAAY,SAAQ;IAAK,IAAI;KAAE,WAAW;KAAU,IAAI;IAAE;cACvD,EAAE,kCAAkC;GAC3B,CAAA;GACZ,oBAAC,uBAAD,EAAA,UACE,oBAAC,YAAD,EAAA,UAAa,UAAsB,CAAA,EACd,CAAA;GACvB,oBAAC,cAAD;IACE,UAAS;IACT,OACE,oBAAC,YAAD;KAAY,SAAQ;KAAQ,IAAI,EAAE,OAAO,eAAe;eACrD,EAAE,sCAAsC,EACvC,WAAW,OAAO,KACpB,CAAC;IACS,CAAA;IAEd,MAAM,oBAAC,gBAAD,CAAiB,CAAA;IACvB,WAAA;GACD,CAAA;GACD,qBAAC,uBAAD,EAAA,UAAA,CACE,oBAAC,QAAD;IAAQ,SAAQ;IAAO,SAAS;IAAS,WAAA;cACtC,EAAE,eAAe;GACZ,CAAA,GACR,oBAAC,QAAD;IAAQ,SAAQ;IAAY,SAAS;IAAgB,WAAA;cAClD,EAAE,iBAAiB;GACd,CAAA,CACa,EAAA,CAAA;EACG;;AAEhC"}
|
|
@@ -3,27 +3,31 @@ import { IconCircle } from "../../components/IconCircle/IconCircle.js";
|
|
|
3
3
|
import { BottomSheet } from "../../components/BottomSheet/BottomSheet.js";
|
|
4
4
|
import { useSetContentHeight } from "../../hooks/useSetContentHeight.js";
|
|
5
5
|
import { CenterContainer } from "./ExchangeRateBottomSheet.style.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useCallback, useImperativeHandle, useRef, useState } from "react";
|
|
7
7
|
import { Box, Button, Typography } from "@mui/material";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
10
|
//#region src/pages/TransactionPage/ExchangeRateBottomSheet.tsx
|
|
11
|
-
const ExchangeRateBottomSheet =
|
|
11
|
+
const ExchangeRateBottomSheet = ({ onContinue, onCancel, ref }) => {
|
|
12
12
|
const [data, setData] = useState();
|
|
13
13
|
const bottomSheetRef = useRef(null);
|
|
14
14
|
const resolverRef = useRef(null);
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const close = useCallback((value = false, bottomSheetClose = true) => {
|
|
16
|
+
resolverRef.current?.(value);
|
|
17
|
+
if (bottomSheetClose) bottomSheetRef.current?.close();
|
|
18
|
+
}, []);
|
|
19
|
+
const handleContinue = useCallback(() => {
|
|
20
|
+
close(true);
|
|
17
21
|
onContinue?.();
|
|
18
|
-
};
|
|
22
|
+
}, [close, onContinue]);
|
|
19
23
|
const handleCancel = useCallback(() => {
|
|
20
|
-
|
|
24
|
+
close(false);
|
|
21
25
|
onCancel?.();
|
|
22
|
-
}, [
|
|
26
|
+
}, [close, onCancel]);
|
|
23
27
|
const handleClose = useCallback(() => {
|
|
24
|
-
|
|
28
|
+
close(false, false);
|
|
25
29
|
onCancel?.();
|
|
26
|
-
}, [
|
|
30
|
+
}, [close, onCancel]);
|
|
27
31
|
useImperativeHandle(ref, () => ({
|
|
28
32
|
isOpen: () => bottomSheetRef.current?.isOpen(),
|
|
29
33
|
open: (resolver, data) => {
|
|
@@ -31,11 +35,8 @@ const ExchangeRateBottomSheet = forwardRef(({ onContinue, onCancel }, ref) => {
|
|
|
31
35
|
resolverRef.current = resolver;
|
|
32
36
|
bottomSheetRef.current?.open();
|
|
33
37
|
},
|
|
34
|
-
close
|
|
35
|
-
|
|
36
|
-
if (bottomSheetClose) bottomSheetRef.current?.close();
|
|
37
|
-
}
|
|
38
|
-
}), []);
|
|
38
|
+
close
|
|
39
|
+
}), [close]);
|
|
39
40
|
return /* @__PURE__ */ jsx(BottomSheet, {
|
|
40
41
|
ref: bottomSheetRef,
|
|
41
42
|
onClose: handleClose,
|
|
@@ -45,7 +46,7 @@ const ExchangeRateBottomSheet = forwardRef(({ onContinue, onCancel }, ref) => {
|
|
|
45
46
|
onCancel: handleCancel
|
|
46
47
|
})
|
|
47
48
|
});
|
|
48
|
-
}
|
|
49
|
+
};
|
|
49
50
|
const ExchangeRateBottomSheetContent = ({ data, onCancel, onContinue }) => {
|
|
50
51
|
const { t } = useTranslation();
|
|
51
52
|
const ref = useRef(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExchangeRateBottomSheet.js","names":[],"sources":["../../../../src/pages/TransactionPage/ExchangeRateBottomSheet.tsx"],"sourcesContent":["import type { ExchangeRateUpdateParams } from '@lifi/sdk'\nimport { Box, Button, Typography } from '@mui/material'\nimport type {
|
|
1
|
+
{"version":3,"file":"ExchangeRateBottomSheet.js","names":[],"sources":["../../../../src/pages/TransactionPage/ExchangeRateBottomSheet.tsx"],"sourcesContent":["import type { ExchangeRateUpdateParams } from '@lifi/sdk'\nimport { Box, Button, Typography } from '@mui/material'\nimport type { JSX, Ref } from 'react'\nimport { useCallback, useImperativeHandle, useRef, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { BottomSheet } from '../../components/BottomSheet/BottomSheet.js'\nimport type { BottomSheetBase } from '../../components/BottomSheet/types.js'\nimport { IconCircle } from '../../components/IconCircle/IconCircle.js'\nimport { useSetContentHeight } from '../../hooks/useSetContentHeight.js'\nimport { formatTokenAmount } from '../../utils/format.js'\nimport { CenterContainer } from './ExchangeRateBottomSheet.style.js'\n\nexport interface ExchangeRateBottomSheetBase {\n isOpen(): void\n open(resolver: (value: boolean) => void, data: ExchangeRateUpdateParams): void\n close(value?: boolean, bottomSheetClose?: boolean): void\n}\n\ninterface ExchangeRateBottomSheetProps {\n data?: ExchangeRateUpdateParams\n onContinue?(): void\n onCancel?(): void\n}\n\nexport const ExchangeRateBottomSheet = ({\n onContinue,\n onCancel,\n ref,\n}: ExchangeRateBottomSheetProps & {\n ref?: Ref<ExchangeRateBottomSheetBase>\n}): JSX.Element => {\n const [data, setData] = useState<ExchangeRateUpdateParams>()\n const bottomSheetRef = useRef<BottomSheetBase>(null)\n const resolverRef = useRef<(value: boolean) => void>(null)\n\n const close = useCallback((value = false, bottomSheetClose = true) => {\n resolverRef.current?.(value)\n if (bottomSheetClose) {\n bottomSheetRef.current?.close()\n }\n }, [])\n\n const handleContinue = useCallback(() => {\n close(true)\n onContinue?.()\n }, [close, onContinue])\n\n const handleCancel = useCallback(() => {\n close(false)\n onCancel?.()\n }, [close, onCancel])\n\n const handleClose = useCallback(() => {\n close(false, false)\n onCancel?.()\n }, [close, onCancel])\n\n useImperativeHandle(\n ref,\n () => ({\n isOpen: () => bottomSheetRef.current?.isOpen(),\n open: (resolver, data) => {\n setData(data)\n resolverRef.current = resolver\n bottomSheetRef.current?.open()\n },\n close,\n }),\n [close]\n )\n\n return (\n <BottomSheet ref={bottomSheetRef} onClose={handleClose}>\n <ExchangeRateBottomSheetContent\n data={data}\n onContinue={handleContinue}\n onCancel={handleCancel}\n />\n </BottomSheet>\n )\n}\n\nconst ExchangeRateBottomSheetContent: React.FC<\n ExchangeRateBottomSheetProps\n> = ({ data, onCancel, onContinue }) => {\n const { t } = useTranslation()\n const ref = useRef<HTMLElement>(null)\n useSetContentHeight(ref)\n\n if (!data) {\n return\n }\n\n const oldAmount = BigInt(data.oldToAmount || 1)\n const rateChange = (\n (Number((BigInt(data.newToAmount || 0) * 1_000_000n) / oldAmount) /\n 1_000_000) *\n 100 -\n 100\n ).toFixed(2)\n\n return (\n <Box\n ref={ref}\n sx={{\n p: 3,\n }}\n >\n <CenterContainer>\n <IconCircle status=\"warning\" sx={{ mb: 1 }} />\n <Typography\n sx={{\n py: 1,\n fontSize: 18,\n fontWeight: 700,\n }}\n >\n {t('warning.title.rateChanged')}\n </Typography>\n </CenterContainer>\n <Typography\n sx={{\n py: 1,\n }}\n >\n {t('warning.message.rateChanged')}\n </Typography>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'space-between',\n mt: 1,\n }}\n >\n <Typography>{t('main.quotedAmount')}</Typography>\n <Typography\n sx={{\n fontWeight: 600,\n }}\n >\n {t('format.tokenAmount', {\n value: formatTokenAmount(\n BigInt(data.oldToAmount),\n data.toToken.decimals\n ),\n })}{' '}\n {data?.toToken.symbol}\n </Typography>\n </Box>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'space-between',\n mt: 0.25,\n }}\n >\n <Typography>{t('main.currentAmount')}</Typography>\n <Typography\n sx={{\n fontWeight: 600,\n }}\n >\n {t('format.tokenAmount', {\n value: formatTokenAmount(\n BigInt(data?.newToAmount),\n data?.toToken.decimals\n ),\n })}{' '}\n {data?.toToken.symbol}\n </Typography>\n </Box>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'space-between',\n mt: 0.25,\n }}\n >\n <Typography>{t('main.rateChange')}</Typography>\n <Typography\n sx={{\n fontWeight: 600,\n }}\n >\n {rateChange}%\n </Typography>\n </Box>\n <Box\n sx={{\n display: 'flex',\n mt: 3,\n }}\n >\n <Button variant=\"text\" onClick={onCancel} fullWidth>\n {t('button.cancel')}\n </Button>\n <Box\n sx={{\n display: 'flex',\n p: 1,\n }}\n />\n <Button variant=\"contained\" onClick={onContinue} fullWidth>\n {t('button.continue')}\n </Button>\n </Box>\n </Box>\n )\n}\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExchangeRateBottomSheet.style.js","names":[],"sources":["../../../../src/pages/TransactionPage/ExchangeRateBottomSheet.style.tsx"],"sourcesContent":["import { Box, styled } from '@mui/material'\nimport type React from 'react'\n\nexport const CenterContainer: React.FC<React.ComponentProps<typeof Box>> =\n styled(Box)(() => ({\n display: 'grid',\n placeItems: 'center',\n position: 'relative',\n }))\n"],"mappings":";;AAGA,MAAa,kBACX,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"ExchangeRateBottomSheet.style.js","names":[],"sources":["../../../../src/pages/TransactionPage/ExchangeRateBottomSheet.style.tsx"],"sourcesContent":["import { Box, styled } from '@mui/material'\nimport type React from 'react'\n\nexport const CenterContainer: React.FC<React.ComponentProps<typeof Box>> =\n styled(Box)(() => ({\n display: 'grid',\n placeItems: 'center',\n position: 'relative',\n }))\n"],"mappings":";;AAGA,MAAa,kBACX,OAAO,GAAG,CAAC,QAAQ;CACjB,SAAS;CACT,YAAY;CACZ,UAAU;AACZ,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouteTracker.js","names":[],"sources":["../../../../src/pages/TransactionPage/RouteTracker.tsx"],"sourcesContent":["import type { Dispatch, JSX, SetStateAction } from 'react'\nimport { useEffect, useRef, useState } from 'react'\nimport { ProgressToNextUpdate } from '../../components/ProgressToNextUpdate.js'\nimport { useRoutes } from '../../hooks/useRoutes.js'\nimport { useRouteExecutionStoreContext } from '../../stores/routes/RouteExecutionStore.js'\nimport { useSetExecutableRoute } from '../../stores/routes/useSetExecutableRoute.js'\n\ninterface RouteTrackerProps {\n observableRouteId: string\n onChange: Dispatch<SetStateAction<string>>\n onFetching: Dispatch<SetStateAction<boolean>>\n}\n\nexport const RouteTracker = ({\n observableRouteId,\n onChange,\n onFetching,\n}: RouteTrackerProps): JSX.Element => {\n const routeExecutionStore = useRouteExecutionStoreContext()\n const setExecutableRoute = useSetExecutableRoute()\n const [observableRoute] = useState(\n () => routeExecutionStore.getState().routes[observableRouteId]?.route\n )\n const observableRouteIdRef = useRef(observableRoute?.id)\n const { routes, isFetching, dataUpdatedAt, refetchTime, refetch } = useRoutes(\n { observableRoute }\n )\n const currentRoute = routes?.[0]\n\n /**\n * The reviewable route is the route that the user currently sees on the review page.\n * The observable route is the route for which we track bridges and exchanges.\n * This allows us to query the route using the same tool each time we refresh.\n * The observable and reviewable routes can be the same when we first enter the review page.\n */\n // biome-ignore lint/correctness/useExhaustiveDependencies: run only when currentRoute changes\n useEffect(() => {\n if (\n observableRouteIdRef.current &&\n currentRoute &&\n observableRouteIdRef.current !== currentRoute.id\n ) {\n const reviewableRouteId = observableRouteIdRef.current\n observableRouteIdRef.current = currentRoute.id\n setExecutableRoute(currentRoute, [observableRouteId, reviewableRouteId])\n onChange(currentRoute.id)\n }\n }, [currentRoute?.id, observableRouteId])\n\n useEffect(() => {\n onFetching(isFetching)\n }, [isFetching, onFetching])\n\n const handleRefetch = () => {\n refetch()\n }\n\n return (\n <ProgressToNextUpdate\n updatedAt={dataUpdatedAt || Date.now()}\n timeToUpdate={refetchTime}\n isLoading={isFetching}\n onClick={handleRefetch}\n sx={{ marginRight: -1 }}\n size=\"medium\"\n />\n )\n}\n"],"mappings":";;;;;;;AAaA,MAAa,gBAAgB,EAC3B,mBACA,UACA,iBACoC;CACpC,MAAM,sBAAsB,8BAA8B;CAC1D,MAAM,qBAAqB,sBAAsB;CACjD,MAAM,CAAC,mBAAmB,eAClB,oBAAoB,SAAS,
|
|
1
|
+
{"version":3,"file":"RouteTracker.js","names":[],"sources":["../../../../src/pages/TransactionPage/RouteTracker.tsx"],"sourcesContent":["import type { Dispatch, JSX, SetStateAction } from 'react'\nimport { useEffect, useRef, useState } from 'react'\nimport { ProgressToNextUpdate } from '../../components/ProgressToNextUpdate.js'\nimport { useRoutes } from '../../hooks/useRoutes.js'\nimport { useRouteExecutionStoreContext } from '../../stores/routes/RouteExecutionStore.js'\nimport { useSetExecutableRoute } from '../../stores/routes/useSetExecutableRoute.js'\n\ninterface RouteTrackerProps {\n observableRouteId: string\n onChange: Dispatch<SetStateAction<string>>\n onFetching: Dispatch<SetStateAction<boolean>>\n}\n\nexport const RouteTracker = ({\n observableRouteId,\n onChange,\n onFetching,\n}: RouteTrackerProps): JSX.Element => {\n const routeExecutionStore = useRouteExecutionStoreContext()\n const setExecutableRoute = useSetExecutableRoute()\n const [observableRoute] = useState(\n () => routeExecutionStore.getState().routes[observableRouteId]?.route\n )\n const observableRouteIdRef = useRef(observableRoute?.id)\n const { routes, isFetching, dataUpdatedAt, refetchTime, refetch } = useRoutes(\n { observableRoute }\n )\n const currentRoute = routes?.[0]\n\n /**\n * The reviewable route is the route that the user currently sees on the review page.\n * The observable route is the route for which we track bridges and exchanges.\n * This allows us to query the route using the same tool each time we refresh.\n * The observable and reviewable routes can be the same when we first enter the review page.\n */\n // biome-ignore lint/correctness/useExhaustiveDependencies: run only when currentRoute changes\n useEffect(() => {\n if (\n observableRouteIdRef.current &&\n currentRoute &&\n observableRouteIdRef.current !== currentRoute.id\n ) {\n const reviewableRouteId = observableRouteIdRef.current\n observableRouteIdRef.current = currentRoute.id\n setExecutableRoute(currentRoute, [observableRouteId, reviewableRouteId])\n onChange(currentRoute.id)\n }\n }, [currentRoute?.id, observableRouteId])\n\n useEffect(() => {\n onFetching(isFetching)\n }, [isFetching, onFetching])\n\n const handleRefetch = () => {\n refetch()\n }\n\n return (\n <ProgressToNextUpdate\n updatedAt={dataUpdatedAt || Date.now()}\n timeToUpdate={refetchTime}\n isLoading={isFetching}\n onClick={handleRefetch}\n sx={{ marginRight: -1 }}\n size=\"medium\"\n />\n )\n}\n"],"mappings":";;;;;;;AAaA,MAAa,gBAAgB,EAC3B,mBACA,UACA,iBACoC;CACpC,MAAM,sBAAsB,8BAA8B;CAC1D,MAAM,qBAAqB,sBAAsB;CACjD,MAAM,CAAC,mBAAmB,eAClB,oBAAoB,SAAS,CAAC,CAAC,OAAO,kBAAkB,EAAE,KAClE;CACA,MAAM,uBAAuB,OAAO,iBAAiB,EAAE;CACvD,MAAM,EAAE,QAAQ,YAAY,eAAe,aAAa,YAAY,UAClE,EAAE,gBAAgB,CACpB;CACA,MAAM,eAAe,SAAS;;;;;;;CAS9B,gBAAgB;EACd,IACE,qBAAqB,WACrB,gBACA,qBAAqB,YAAY,aAAa,IAC9C;GACA,MAAM,oBAAoB,qBAAqB;GAC/C,qBAAqB,UAAU,aAAa;GAC5C,mBAAmB,cAAc,CAAC,mBAAmB,iBAAiB,CAAC;GACvE,SAAS,aAAa,EAAE;EAC1B;CACF,GAAG,CAAC,cAAc,IAAI,iBAAiB,CAAC;CAExC,gBAAgB;EACd,WAAW,UAAU;CACvB,GAAG,CAAC,YAAY,UAAU,CAAC;CAE3B,MAAM,sBAAsB;EAC1B,QAAQ;CACV;CAEA,OACE,oBAAC,sBAAD;EACE,WAAW,iBAAiB,KAAK,IAAI;EACrC,cAAc;EACd,WAAW;EACX,SAAS;EACT,IAAI,EAAE,aAAa,GAAG;EACtB,MAAK;CACN,CAAA;AAEL"}
|
|
@@ -5,12 +5,12 @@ import { BottomSheet } from "../../components/BottomSheet/BottomSheet.js";
|
|
|
5
5
|
import { useSetContentHeight } from "../../hooks/useSetContentHeight.js";
|
|
6
6
|
import { ButtonRow, CenterContainer, ContentContainer, DetailLabel, DetailRow, DetailValue, WarningMessage, WarningTitle } from "./TokenValueBottomSheet.style.js";
|
|
7
7
|
import { calculateValueLossPercentage } from "./utils.js";
|
|
8
|
-
import {
|
|
8
|
+
import { useRef, useState } from "react";
|
|
9
9
|
import { Button, Checkbox, FormControlLabel } from "@mui/material";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { useTranslation } from "react-i18next";
|
|
12
12
|
//#region src/pages/TransactionPage/TokenValueBottomSheet.tsx
|
|
13
|
-
const TokenValueBottomSheet =
|
|
13
|
+
const TokenValueBottomSheet = ({ route, onContinue, onCancel, ref }) => {
|
|
14
14
|
const handleCancel = () => {
|
|
15
15
|
ref.current?.close();
|
|
16
16
|
onCancel?.();
|
|
@@ -24,7 +24,7 @@ const TokenValueBottomSheet = forwardRef(({ route, onContinue, onCancel }, ref)
|
|
|
24
24
|
onCancel: handleCancel
|
|
25
25
|
})
|
|
26
26
|
});
|
|
27
|
-
}
|
|
27
|
+
};
|
|
28
28
|
const TokenValueBottomSheetContent = ({ route, onCancel, onContinue }) => {
|
|
29
29
|
const [accepted, setAccepted] = useState(false);
|
|
30
30
|
const { t } = useTranslation();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenValueBottomSheet.js","names":[],"sources":["../../../../src/pages/TransactionPage/TokenValueBottomSheet.tsx"],"sourcesContent":["import type { Route } from '@lifi/sdk'\nimport { Button, Checkbox, FormControlLabel } from '@mui/material'\nimport type {
|
|
1
|
+
{"version":3,"file":"TokenValueBottomSheet.js","names":[],"sources":["../../../../src/pages/TransactionPage/TokenValueBottomSheet.tsx"],"sourcesContent":["import type { Route } from '@lifi/sdk'\nimport { Button, Checkbox, FormControlLabel } from '@mui/material'\nimport type { JSX, Ref, RefObject } from 'react'\nimport { useRef, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { BottomSheet } from '../../components/BottomSheet/BottomSheet.js'\nimport type { BottomSheetBase } from '../../components/BottomSheet/types.js'\nimport { FeeBreakdownTooltip } from '../../components/FeeBreakdownTooltip.js'\nimport { IconCircle } from '../../components/IconCircle/IconCircle.js'\nimport { useSetContentHeight } from '../../hooks/useSetContentHeight.js'\nimport { getAccumulatedFeeCostsBreakdown } from '../../utils/fees.js'\nimport {\n ButtonRow,\n CenterContainer,\n ContentContainer,\n DetailLabel,\n DetailRow,\n DetailValue,\n WarningMessage,\n WarningTitle,\n} from './TokenValueBottomSheet.style.js'\nimport { calculateValueLossPercentage } from './utils.js'\n\ninterface TokenValueBottomSheetProps {\n route: Route\n onContinue(): void\n onCancel?(): void\n}\n\nexport const TokenValueBottomSheet = ({\n route,\n onContinue,\n onCancel,\n ref,\n}: TokenValueBottomSheetProps & {\n ref?: Ref<BottomSheetBase>\n}): JSX.Element => {\n const handleCancel = () => {\n ;(ref as RefObject<BottomSheetBase>).current?.close()\n onCancel?.()\n }\n\n return (\n <BottomSheet ref={ref} onClose={onCancel}>\n <TokenValueBottomSheetContent\n route={route}\n onContinue={onContinue}\n onCancel={handleCancel}\n />\n </BottomSheet>\n )\n}\n\nconst TokenValueBottomSheetContent: React.FC<TokenValueBottomSheetProps> = ({\n route,\n onCancel,\n onContinue,\n}) => {\n const [accepted, setAccepted] = useState(false)\n const { t } = useTranslation()\n const ref = useRef<HTMLElement>(null)\n useSetContentHeight(ref)\n const { gasCosts, feeCosts, gasCostUSD, feeCostUSD } =\n getAccumulatedFeeCostsBreakdown(route)\n const fromAmountUSD = Number.parseFloat(route.fromAmountUSD)\n const toAmountUSD = Number.parseFloat(route.toAmountUSD)\n\n return (\n <ContentContainer ref={ref}>\n <CenterContainer>\n <IconCircle status=\"warning\" sx={{ mb: 2.5 }} />\n <WarningTitle>{t('warning.title.highValueLoss')}</WarningTitle>\n </CenterContainer>\n <WarningMessage>{t('warning.message.highValueLoss')}</WarningMessage>\n <DetailRow>\n <DetailLabel>{t('main.sending')}</DetailLabel>\n <DetailValue>\n {t('format.currency', { value: route.fromAmountUSD })}\n </DetailValue>\n </DetailRow>\n <DetailRow>\n <DetailLabel>{t('main.fees.network')}</DetailLabel>\n <FeeBreakdownTooltip gasCosts={gasCosts} gasless={!gasCostUSD}>\n <DetailValue>\n {!gasCostUSD\n ? t('main.fees.free')\n : t('format.currency', { value: gasCostUSD })}\n </DetailValue>\n </FeeBreakdownTooltip>\n </DetailRow>\n {feeCostUSD ? (\n <DetailRow>\n <DetailLabel>{t('main.fees.provider')}</DetailLabel>\n <FeeBreakdownTooltip feeCosts={feeCosts}>\n <DetailValue>\n {t('format.currency', { value: feeCostUSD })}\n </DetailValue>\n </FeeBreakdownTooltip>\n </DetailRow>\n ) : null}\n <DetailRow>\n <DetailLabel>{t('main.receiving')}</DetailLabel>\n <DetailValue>\n {t('format.currency', { value: route.toAmountUSD })}\n </DetailValue>\n </DetailRow>\n <DetailRow>\n <DetailLabel>{t('main.valueLoss')}</DetailLabel>\n <DetailValue>\n {calculateValueLossPercentage(\n fromAmountUSD,\n toAmountUSD,\n gasCostUSD,\n feeCostUSD\n )}\n %\n </DetailValue>\n </DetailRow>\n <FormControlLabel\n control={\n <Checkbox\n checked={accepted}\n onChange={(_, checked) => setAccepted(checked)}\n />\n }\n label={t('warning.checkbox.highValueLoss')}\n sx={{ mt: 1 }}\n />\n <ButtonRow>\n <Button variant=\"text\" onClick={onCancel} fullWidth>\n {t('button.cancel')}\n </Button>\n <Button\n variant=\"contained\"\n onClick={onContinue}\n disabled={!accepted}\n fullWidth\n >\n {t('button.continue')}\n </Button>\n </ButtonRow>\n </ContentContainer>\n )\n}\n"],"mappings":"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"}
|