@lifi/widget 1.15.1 → 1.17.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/App.js +21 -0
- package/AppProvider.d.ts +0 -4
- package/AppProvider.js +2 -10
- package/README.md +1 -1
- package/cjs/App.js +21 -0
- package/cjs/AppProvider.d.ts +0 -4
- package/cjs/AppProvider.js +3 -12
- package/cjs/components/ActiveSwaps/ActiveSwapItem.d.ts +5 -0
- package/cjs/components/ActiveSwaps/ActiveSwapItem.js +45 -0
- package/cjs/components/{SwapsInProgress/SwapsInProgress.d.ts → ActiveSwaps/ActiveSwaps.d.ts} +1 -1
- package/cjs/components/ActiveSwaps/ActiveSwaps.js +30 -0
- package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +78 -0
- package/cjs/components/ActiveSwaps/ActiveSwaps.style.js +40 -0
- package/cjs/components/ActiveSwaps/index.d.ts +2 -0
- package/cjs/components/ActiveSwaps/index.js +18 -0
- package/cjs/components/AppContainer.js +2 -2
- package/cjs/components/Card/Card.d.ts +7 -4
- package/cjs/components/Card/Card.js +38 -28
- package/cjs/{pages/SelectTokenPage → components/ChainSelect}/ChainSelect.d.ts +0 -0
- package/cjs/components/ChainSelect/ChainSelect.js +35 -0
- package/cjs/components/{SwapsInProgress/SwapsInProgress.style.d.ts → ChainSelect/ChainSelect.style.d.ts} +10 -19
- package/cjs/components/ChainSelect/ChainSelect.style.js +19 -0
- package/cjs/components/ChainSelect/index.d.ts +2 -0
- package/cjs/components/ChainSelect/index.js +18 -0
- package/cjs/components/ChainSelect/useChainSelect.d.ts +8 -0
- package/cjs/components/ChainSelect/useChainSelect.js +33 -0
- package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.js +3 -3
- package/cjs/components/Header/Header.js +1 -9
- package/cjs/components/Header/NavigationHeader.js +6 -11
- package/cjs/components/Header/useHeaderActionStore.d.ts +0 -2
- package/cjs/components/Header/useHeaderActionStore.js +1 -5
- package/cjs/components/PoweredBy/PoweredBy.style.d.ts +1 -1
- package/cjs/components/PoweredBy/PoweredBy.style.js +1 -0
- package/cjs/components/SelectChainAndToken.js +5 -5
- package/cjs/components/SendToWallet/SendToWallet.js +6 -6
- package/cjs/components/Step/CircularProgress.js +1 -1
- package/cjs/components/Step/CircularProgress.style.js +1 -1
- package/cjs/components/Step/StepProcess.js +1 -5
- package/cjs/components/Step/StepProcess.style.d.ts +1 -1
- package/cjs/components/Step/StepTimer.d.ts +1 -0
- package/cjs/components/Step/StepTimer.js +6 -6
- package/cjs/components/SwapButton/SwapButton.js +5 -32
- package/cjs/components/SwapButton/types.d.ts +2 -2
- package/cjs/components/SwapRouteCard/SwapRouteCard.js +1 -1
- package/cjs/components/TokenAvatar/TokenAvatar.style.js +0 -3
- package/cjs/components/TokenList/TokenList.js +7 -3
- package/cjs/components/TokenList/TokenList.style.js +4 -3
- package/cjs/components/TokenList/TokenListItem.js +1 -1
- package/cjs/components/TokenList/TokenNotFound.d.ts +2 -1
- package/cjs/components/TokenList/TokenNotFound.js +12 -2
- package/cjs/components/TokenList/types.d.ts +2 -2
- package/cjs/config/theme.js +24 -23
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/index.d.ts +2 -0
- package/cjs/hooks/index.js +2 -0
- package/cjs/hooks/useChains.d.ts +1 -97
- package/cjs/hooks/useChains.js +26 -20
- package/cjs/hooks/useFeaturedTokens.d.ts +1 -1
- package/cjs/hooks/useFeaturedTokens.js +6 -3
- package/cjs/hooks/useGasSufficiency.d.ts +1 -1
- package/cjs/hooks/useGasSufficiency.js +36 -28
- package/cjs/hooks/useInitializer.js +6 -0
- package/cjs/{components/Step/utils.d.ts → hooks/useProcessMessage.d.ts} +4 -0
- package/cjs/{components/Step/utils.js → hooks/useProcessMessage.js} +16 -10
- package/cjs/hooks/useRouteExecution.d.ts +1 -1
- package/cjs/hooks/useRouteExecution.js +26 -35
- package/cjs/hooks/useSwapRoutes.js +10 -11
- package/cjs/hooks/useToken.d.ts +0 -1
- package/cjs/hooks/useToken.js +1 -2
- package/cjs/hooks/useTokenBalances.d.ts +1 -2
- package/cjs/hooks/useTokenBalances.js +5 -6
- package/cjs/hooks/useTokenSearch.js +3 -2
- package/cjs/hooks/useTokens.d.ts +1 -2
- package/cjs/hooks/useTokens.js +32 -9
- package/cjs/hooks/useTools.js +11 -5
- package/cjs/hooks/useWidgetEvents.d.ts +3 -0
- package/cjs/hooks/useWidgetEvents.js +13 -0
- package/cjs/i18n/en/translation.json +14 -10
- package/cjs/i18n/index.d.ts +11 -7
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +3 -1
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.d.ts +2 -0
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +18 -0
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +2 -0
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.js +21 -0
- package/cjs/pages/ActiveSwapsPage/index.d.ts +1 -0
- package/cjs/{components/SwapsInProgress → pages/ActiveSwapsPage}/index.js +1 -1
- package/cjs/pages/MainPage/MainPage.js +2 -3
- package/cjs/pages/MainPage/MainSwapButton.js +3 -1
- package/cjs/pages/MainPage/SwapRoutes.js +4 -1
- package/cjs/pages/SelectChainPage/SelectChainPage.d.ts +3 -0
- package/cjs/pages/SelectChainPage/SelectChainPage.js +33 -0
- package/cjs/pages/SelectChainPage/SelectChainPage.style.d.ts +21 -0
- package/cjs/pages/SelectChainPage/SelectChainPage.style.js +20 -0
- package/cjs/pages/SelectChainPage/index.d.ts +1 -0
- package/cjs/pages/SelectChainPage/index.js +17 -0
- package/cjs/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -4
- package/cjs/pages/SelectTokenPage/SelectTokenPage.js +2 -2
- package/cjs/pages/SelectWalletPage/SelectWalletPage.js +4 -4
- package/cjs/pages/SelectWalletPage/SelectWalletPage.style.d.ts +2 -27
- package/cjs/pages/SelectWalletPage/SelectWalletPage.style.js +4 -14
- package/cjs/pages/SettingsPage/AdvancedPreferences.js +1 -1
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
- package/cjs/pages/SettingsPage/EnabledBridgesSelect.js +3 -6
- package/cjs/pages/SettingsPage/EnabledExchangesSelect.js +3 -5
- package/cjs/pages/SettingsPage/GasPriceSelect.js +1 -1
- package/cjs/pages/SettingsPage/RoutePrioritySelect.js +6 -2
- package/cjs/pages/SettingsPage/ShowDestinationWallet.js +1 -1
- package/cjs/pages/SettingsPage/SlippageInput.js +1 -1
- package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +3 -4
- package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +2 -3
- package/cjs/pages/SwapPage/StatusBottomSheet.js +25 -36
- package/cjs/pages/SwapPage/SwapPage.js +16 -3
- package/cjs/pages/SwapRoutesPage/SwapRoutesPage.js +4 -3
- package/cjs/providers/SDKProvider/SDKProvider.d.ts +4 -0
- package/cjs/providers/SDKProvider/SDKProvider.js +27 -0
- package/cjs/providers/SDKProvider/index.d.ts +1 -0
- package/cjs/providers/SDKProvider/index.js +17 -0
- package/cjs/providers/SwapFormProvider/SwapFormProvider.js +4 -30
- package/cjs/providers/SwapFormProvider/types.d.ts +5 -5
- package/cjs/providers/TelemetryProvider/TelemetryProvider.d.ts +4 -0
- package/cjs/providers/TelemetryProvider/TelemetryProvider.js +11 -0
- package/cjs/providers/TelemetryProvider/index.d.ts +1 -0
- package/cjs/providers/TelemetryProvider/index.js +17 -0
- package/cjs/providers/WalletProvider/WalletProvider.d.ts +1 -4
- package/cjs/providers/WalletProvider/WalletProvider.js +59 -1
- package/cjs/providers/WidgetProvider/WidgetProvider.js +1 -16
- package/cjs/providers/WidgetProvider/index.d.ts +1 -0
- package/cjs/providers/WidgetProvider/index.js +1 -0
- package/cjs/providers/WidgetProvider/utils.d.ts +4 -0
- package/cjs/providers/WidgetProvider/utils.js +13 -0
- package/cjs/providers/index.d.ts +2 -0
- package/cjs/providers/index.js +2 -0
- package/cjs/stores/chains/index.d.ts +3 -0
- package/cjs/stores/chains/index.js +19 -0
- package/cjs/stores/chains/types.d.ts +8 -0
- package/cjs/stores/chains/types.js +2 -0
- package/cjs/stores/chains/useChainOrder.d.ts +1 -0
- package/cjs/stores/chains/useChainOrder.js +12 -0
- package/cjs/stores/chains/useChainOrderStore.d.ts +19 -0
- package/cjs/stores/chains/useChainOrderStore.js +45 -0
- package/cjs/stores/route/index.d.ts +2 -1
- package/cjs/stores/route/index.js +2 -1
- package/cjs/stores/route/useExecutingRoutesIds.d.ts +1 -0
- package/cjs/stores/route/useExecutingRoutesIds.js +20 -0
- package/cjs/stores/route/useRouteStore.js +5 -4
- package/cjs/stores/route/utils.d.ts +4 -0
- package/cjs/stores/route/utils.js +21 -0
- package/cjs/stores/settings/index.d.ts +0 -1
- package/cjs/stores/settings/index.js +0 -1
- package/cjs/stores/settings/useAppearance.js +3 -1
- package/cjs/stores/settings/useSettingsStore.js +5 -2
- package/cjs/types/events.d.ts +5 -0
- package/cjs/types/events.js +9 -0
- package/cjs/types/index.d.ts +1 -0
- package/cjs/types/index.js +1 -0
- package/cjs/types/widget.d.ts +31 -23
- package/cjs/utils/colors.d.ts +1 -1
- package/cjs/utils/navigationRoutes.d.ts +5 -0
- package/cjs/utils/navigationRoutes.js +31 -4
- package/components/ActiveSwaps/ActiveSwapItem.d.ts +5 -0
- package/components/ActiveSwaps/ActiveSwapItem.js +41 -0
- package/components/{SwapsInProgress/SwapsInProgress.d.ts → ActiveSwaps/ActiveSwaps.d.ts} +1 -1
- package/components/ActiveSwaps/ActiveSwaps.js +26 -0
- package/components/ActiveSwaps/ActiveSwaps.style.d.ts +78 -0
- package/components/ActiveSwaps/ActiveSwaps.style.js +37 -0
- package/components/ActiveSwaps/index.d.ts +2 -0
- package/components/ActiveSwaps/index.js +2 -0
- package/components/AppContainer.js +1 -1
- package/components/Card/Card.d.ts +7 -4
- package/components/Card/Card.js +39 -29
- package/{pages/SelectTokenPage → components/ChainSelect}/ChainSelect.d.ts +0 -0
- package/components/ChainSelect/ChainSelect.js +31 -0
- package/components/{SwapsInProgress/SwapsInProgress.style.d.ts → ChainSelect/ChainSelect.style.d.ts} +10 -19
- package/components/ChainSelect/ChainSelect.style.js +16 -0
- package/components/ChainSelect/index.d.ts +2 -0
- package/components/ChainSelect/index.js +2 -0
- package/components/ChainSelect/useChainSelect.d.ts +8 -0
- package/components/ChainSelect/useChainSelect.js +29 -0
- package/components/GasSufficiencyMessage/GasSufficiencyMessage.js +3 -3
- package/components/Header/Header.js +1 -9
- package/components/Header/NavigationHeader.js +6 -11
- package/components/Header/useHeaderActionStore.d.ts +0 -2
- package/components/Header/useHeaderActionStore.js +0 -3
- package/components/PoweredBy/PoweredBy.style.d.ts +1 -1
- package/components/PoweredBy/PoweredBy.style.js +1 -0
- package/components/SelectChainAndToken.js +1 -1
- package/components/SendToWallet/SendToWallet.js +6 -6
- package/components/Step/CircularProgress.js +3 -3
- package/components/Step/CircularProgress.style.js +1 -1
- package/components/Step/StepProcess.js +2 -6
- package/components/Step/StepProcess.style.d.ts +1 -1
- package/components/Step/StepTimer.d.ts +1 -0
- package/components/Step/StepTimer.js +6 -6
- package/components/SwapButton/SwapButton.js +7 -34
- package/components/SwapButton/types.d.ts +2 -2
- package/components/SwapRouteCard/SwapRouteCard.js +1 -1
- package/components/TokenAvatar/TokenAvatar.style.js +0 -3
- package/components/TokenList/TokenList.js +7 -3
- package/components/TokenList/TokenList.style.js +4 -3
- package/components/TokenList/TokenListItem.js +1 -1
- package/components/TokenList/TokenNotFound.d.ts +2 -1
- package/components/TokenList/TokenNotFound.js +12 -2
- package/components/TokenList/types.d.ts +2 -2
- package/config/theme.js +24 -23
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/index.d.ts +2 -0
- package/hooks/index.js +2 -0
- package/hooks/useChains.d.ts +1 -97
- package/hooks/useChains.js +26 -20
- package/hooks/useFeaturedTokens.d.ts +1 -1
- package/hooks/useFeaturedTokens.js +6 -3
- package/hooks/useGasSufficiency.d.ts +1 -1
- package/hooks/useGasSufficiency.js +32 -24
- package/hooks/useInitializer.js +6 -0
- package/{components/Step/utils.d.ts → hooks/useProcessMessage.d.ts} +4 -0
- package/{pages/SwapPage/utils.js → hooks/useProcessMessage.js} +15 -10
- package/hooks/useRouteExecution.d.ts +1 -1
- package/hooks/useRouteExecution.js +26 -35
- package/hooks/useSwapRoutes.js +3 -4
- package/hooks/useToken.d.ts +0 -1
- package/hooks/useToken.js +1 -2
- package/hooks/useTokenBalances.d.ts +1 -2
- package/hooks/useTokenBalances.js +4 -5
- package/hooks/useTokenSearch.js +3 -2
- package/hooks/useTokens.d.ts +1 -2
- package/hooks/useTokens.js +32 -9
- package/hooks/useTools.js +11 -5
- package/hooks/useWidgetEvents.d.ts +3 -0
- package/hooks/useWidgetEvents.js +6 -0
- package/i18n/en/translation.json +14 -10
- package/i18n/index.d.ts +11 -7
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +15 -14
- package/pages/ActiveSwapsPage/ActiveSwapsEmpty.d.ts +2 -0
- package/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +14 -0
- package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +2 -0
- package/pages/ActiveSwapsPage/ActiveSwapsPage.js +17 -0
- package/pages/ActiveSwapsPage/index.d.ts +1 -0
- package/pages/ActiveSwapsPage/index.js +1 -0
- package/pages/MainPage/MainPage.js +2 -3
- package/pages/MainPage/MainSwapButton.js +3 -1
- package/pages/MainPage/SwapRoutes.js +4 -1
- package/pages/SelectChainPage/SelectChainPage.d.ts +3 -0
- package/pages/SelectChainPage/SelectChainPage.js +29 -0
- package/pages/SelectChainPage/SelectChainPage.style.d.ts +21 -0
- package/pages/SelectChainPage/SelectChainPage.style.js +17 -0
- package/pages/SelectChainPage/index.d.ts +1 -0
- package/pages/SelectChainPage/index.js +1 -0
- package/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -4
- package/pages/SelectTokenPage/SelectTokenPage.js +2 -2
- package/pages/SelectWalletPage/SelectWalletPage.js +5 -5
- package/pages/SelectWalletPage/SelectWalletPage.style.d.ts +2 -27
- package/pages/SelectWalletPage/SelectWalletPage.style.js +4 -14
- package/pages/SettingsPage/AdvancedPreferences.js +2 -2
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
- package/pages/SettingsPage/EnabledBridgesSelect.js +4 -7
- package/pages/SettingsPage/EnabledExchangesSelect.js +4 -6
- package/pages/SettingsPage/GasPriceSelect.js +2 -2
- package/pages/SettingsPage/RoutePrioritySelect.js +7 -3
- package/pages/SettingsPage/ShowDestinationWallet.js +2 -2
- package/pages/SettingsPage/SlippageInput.js +2 -2
- package/pages/SwapDetailsPage/SwapDetailsPage.js +4 -5
- package/pages/SwapHistoryPage/SwapHistoryPage.js +3 -4
- package/pages/SwapPage/StatusBottomSheet.js +27 -38
- package/pages/SwapPage/SwapPage.js +16 -3
- package/pages/SwapRoutesPage/SwapRoutesPage.js +5 -4
- package/providers/SDKProvider/SDKProvider.d.ts +4 -0
- package/providers/SDKProvider/SDKProvider.js +19 -0
- package/providers/SDKProvider/index.d.ts +1 -0
- package/providers/SDKProvider/index.js +1 -0
- package/providers/SwapFormProvider/SwapFormProvider.js +4 -30
- package/providers/SwapFormProvider/types.d.ts +5 -5
- package/providers/TelemetryProvider/TelemetryProvider.d.ts +4 -0
- package/providers/TelemetryProvider/TelemetryProvider.js +7 -0
- package/providers/TelemetryProvider/index.d.ts +1 -0
- package/providers/TelemetryProvider/index.js +1 -0
- package/providers/WalletProvider/WalletProvider.d.ts +1 -4
- package/providers/WalletProvider/WalletProvider.js +59 -1
- package/providers/WidgetProvider/WidgetProvider.js +3 -18
- package/providers/WidgetProvider/index.d.ts +1 -0
- package/providers/WidgetProvider/index.js +1 -0
- package/providers/WidgetProvider/utils.d.ts +4 -0
- package/providers/WidgetProvider/utils.js +9 -0
- package/providers/index.d.ts +2 -0
- package/providers/index.js +2 -0
- package/stores/chains/index.d.ts +3 -0
- package/stores/chains/index.js +3 -0
- package/stores/chains/types.d.ts +8 -0
- package/stores/chains/types.js +1 -0
- package/stores/chains/useChainOrder.d.ts +1 -0
- package/stores/chains/useChainOrder.js +5 -0
- package/stores/chains/useChainOrderStore.d.ts +19 -0
- package/stores/chains/useChainOrderStore.js +39 -0
- package/stores/route/index.d.ts +2 -1
- package/stores/route/index.js +2 -1
- package/stores/route/useExecutingRoutesIds.d.ts +1 -0
- package/stores/route/useExecutingRoutesIds.js +13 -0
- package/stores/route/useRouteStore.js +5 -4
- package/stores/route/utils.d.ts +4 -0
- package/stores/route/utils.js +15 -0
- package/stores/settings/index.d.ts +0 -1
- package/stores/settings/index.js +0 -1
- package/stores/settings/useAppearance.js +3 -1
- package/stores/settings/useSettingsStore.js +5 -2
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/events.d.ts +5 -0
- package/types/events.js +6 -0
- package/types/index.d.ts +1 -0
- package/types/index.js +1 -0
- package/types/widget.d.ts +31 -23
- package/utils/colors.d.ts +1 -1
- package/utils/navigationRoutes.d.ts +5 -0
- package/utils/navigationRoutes.js +30 -3
- package/cjs/components/SwapButton/SwapButton.style.d.ts +0 -65
- package/cjs/components/SwapButton/SwapButton.style.js +0 -15
- package/cjs/components/SwapsInProgress/SwapsInProgress.js +0 -29
- package/cjs/components/SwapsInProgress/SwapsInProgress.style.js +0 -17
- package/cjs/components/SwapsInProgress/index.d.ts +0 -1
- package/cjs/config/lifi.d.ts +0 -4
- package/cjs/config/lifi.js +0 -14
- package/cjs/pages/SelectTokenPage/ChainSelect.js +0 -31
- package/cjs/pages/SwapPage/utils.d.ts +0 -6
- package/cjs/pages/SwapPage/utils.js +0 -93
- package/cjs/stores/route/useExecutingRoutes.d.ts +0 -2
- package/cjs/stores/route/useExecutingRoutes.js +0 -13
- package/cjs/stores/settings/useSetSettings.d.ts +0 -5
- package/cjs/stores/settings/useSetSettings.js +0 -12
- package/components/Step/utils.js +0 -89
- package/components/SwapButton/SwapButton.style.d.ts +0 -65
- package/components/SwapButton/SwapButton.style.js +0 -12
- package/components/SwapsInProgress/SwapsInProgress.js +0 -25
- package/components/SwapsInProgress/SwapsInProgress.style.js +0 -14
- package/components/SwapsInProgress/index.d.ts +0 -1
- package/components/SwapsInProgress/index.js +0 -1
- package/config/lifi.d.ts +0 -4
- package/config/lifi.js +0 -7
- package/pages/SelectTokenPage/ChainSelect.js +0 -27
- package/pages/SwapPage/utils.d.ts +0 -6
- package/stores/route/useExecutingRoutes.d.ts +0 -2
- package/stores/route/useExecutingRoutes.js +0 -6
- package/stores/settings/useSetSettings.d.ts +0 -5
- package/stores/settings/useSetSettings.js +0 -5
|
@@ -1,31 +1,22 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const ChainCard: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
component?: import("react").ElementType<any> | undefined;
|
|
5
5
|
ref?: import("react").Ref<unknown> | undefined;
|
|
6
|
-
sx?: import("@mui/material
|
|
6
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
7
7
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
8
8
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
9
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material
|
|
10
|
-
variant?: "default" | "error" | undefined;
|
|
9
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
10
|
+
variant?: ("default" | "error" | "selected") | undefined;
|
|
11
11
|
dense?: boolean | undefined;
|
|
12
12
|
indented?: boolean | undefined;
|
|
13
13
|
onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
14
14
|
}, {}, {}>;
|
|
15
|
-
export declare const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
subheader?: import("react").ReactNode;
|
|
21
|
-
subheaderTypographyProps?: import("@mui/material").TypographyProps<"span", {
|
|
22
|
-
component?: "span" | undefined;
|
|
23
|
-
}> | undefined;
|
|
24
|
-
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
25
|
-
title?: import("react").ReactNode;
|
|
26
|
-
titleTypographyProps?: import("@mui/material").TypographyProps<"span", {
|
|
27
|
-
component?: "span" | undefined;
|
|
28
|
-
}> | undefined;
|
|
15
|
+
export declare const ChainContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
16
|
+
children?: import("react").ReactNode;
|
|
17
|
+
component?: import("react").ElementType<any> | undefined;
|
|
18
|
+
ref?: import("react").Ref<unknown> | undefined;
|
|
19
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
29
20
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
30
21
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
31
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "
|
|
22
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChainContainer = exports.ChainCard = void 0;
|
|
4
|
+
const material_1 = require("@mui/material");
|
|
5
|
+
const styles_1 = require("@mui/material/styles");
|
|
6
|
+
const Card_1 = require("../../components/Card");
|
|
7
|
+
exports.ChainCard = (0, styles_1.styled)(Card_1.Card)({
|
|
8
|
+
display: 'grid',
|
|
9
|
+
placeItems: 'center',
|
|
10
|
+
minWidth: 56,
|
|
11
|
+
height: 56,
|
|
12
|
+
});
|
|
13
|
+
exports.ChainContainer = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
|
|
14
|
+
display: 'grid',
|
|
15
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(56px, 1fr))',
|
|
16
|
+
gridAutoRows: '56px',
|
|
17
|
+
justifyContent: 'space-between',
|
|
18
|
+
gap: theme.spacing(1.5),
|
|
19
|
+
}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ChainSelect"), exports);
|
|
18
|
+
__exportStar(require("./useChainSelect"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EVMChain } from '@lifi/sdk';
|
|
2
|
+
import type { SwapFormType } from '../../providers';
|
|
3
|
+
export declare const useChainSelect: (formType: SwapFormType) => {
|
|
4
|
+
chains: EVMChain[] | undefined;
|
|
5
|
+
getChains: () => EVMChain[];
|
|
6
|
+
setCurrentChain: (chainId: number) => void;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useChainSelect = void 0;
|
|
4
|
+
const react_hook_form_1 = require("react-hook-form");
|
|
5
|
+
const hooks_1 = require("../../hooks");
|
|
6
|
+
const providers_1 = require("../../providers");
|
|
7
|
+
const chains_1 = require("../../stores/chains");
|
|
8
|
+
const useChainSelect = (formType) => {
|
|
9
|
+
const { setValue } = (0, react_hook_form_1.useFormContext)();
|
|
10
|
+
const { chains, isLoading } = (0, hooks_1.useChains)();
|
|
11
|
+
const [chainOrder, setChainOrder] = (0, chains_1.useChainOrder)();
|
|
12
|
+
const chainKey = providers_1.SwapFormKeyHelper.getChainKey(formType);
|
|
13
|
+
const getChains = () => {
|
|
14
|
+
if (!chains) {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
const selectedChains = chainOrder
|
|
18
|
+
.map((chainId) => chains.find((chain) => chain.id === chainId))
|
|
19
|
+
.filter((chain) => chain);
|
|
20
|
+
return selectedChains;
|
|
21
|
+
};
|
|
22
|
+
const setCurrentChain = (chainId) => {
|
|
23
|
+
setValue(chainKey, chainId, { shouldDirty: true });
|
|
24
|
+
setValue(providers_1.SwapFormKeyHelper.getTokenKey(formType), '', {
|
|
25
|
+
shouldDirty: false,
|
|
26
|
+
});
|
|
27
|
+
setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), '');
|
|
28
|
+
setValue(providers_1.SwapFormKey.TokenSearchFilter, '');
|
|
29
|
+
setChainOrder(chainId);
|
|
30
|
+
};
|
|
31
|
+
return { chains, getChains, setCurrentChain, isLoading };
|
|
32
|
+
};
|
|
33
|
+
exports.useChainSelect = useChainSelect;
|
|
@@ -23,15 +23,15 @@ const GasSufficiencyMessage = (_a) => {
|
|
|
23
23
|
var { route } = _a, props = __rest(_a, ["route"]);
|
|
24
24
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
25
25
|
const { insufficientFunds, insufficientGas } = (0, hooks_1.useGasSufficiency)(route);
|
|
26
|
-
if (!insufficientFunds && !insufficientGas.length) {
|
|
26
|
+
if (!insufficientFunds && !(insufficientGas === null || insufficientGas === void 0 ? void 0 : insufficientGas.length)) {
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
29
29
|
return ((0, jsx_runtime_1.jsxs)(GasSufficiencyMessage_style_1.MessageCard, Object.assign({}, props, { children: [(0, jsx_runtime_1.jsx)(icons_material_1.WarningAmber, { sx: {
|
|
30
30
|
marginTop: 2,
|
|
31
31
|
marginLeft: 2,
|
|
32
|
-
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [insufficientGas.length ? ((0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t(`swap.warning.title.insufficientGas`) })) : null, insufficientFunds ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", px: 2, pb: insufficientGas.length ? 0 : 2, pt: insufficientGas.length ? 1 : 2 }, { children: insufficientFunds
|
|
32
|
+
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(insufficientGas === null || insufficientGas === void 0 ? void 0 : insufficientGas.length) ? ((0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t(`swap.warning.title.insufficientGas`) })) : null, insufficientFunds ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", px: 2, pb: (insufficientGas === null || insufficientGas === void 0 ? void 0 : insufficientGas.length) ? 0 : 2, pt: (insufficientGas === null || insufficientGas === void 0 ? void 0 : insufficientGas.length) ? 1 : 2 }, { children: insufficientFunds
|
|
33
33
|
? t(`swap.warning.message.insufficientFunds`)
|
|
34
|
-
: null }))) : null, insufficientGas.length ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", px: 2, pt: 1 }, { children: t(`swap.warning.message.insufficientGas`) }))) : null, insufficientGas.length
|
|
34
|
+
: null }))) : null, (insufficientGas === null || insufficientGas === void 0 ? void 0 : insufficientGas.length) ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", px: 2, pt: 1 }, { children: t(`swap.warning.message.insufficientGas`) }))) : null, (insufficientGas === null || insufficientGas === void 0 ? void 0 : insufficientGas.length)
|
|
35
35
|
? insufficientGas.map((item, index) => {
|
|
36
36
|
var _a, _b;
|
|
37
37
|
return ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", px: 2, pb: insufficientGas.length - 1 === index ? 2 : 0, pt: 0.5 }, { children: t(`swap.tokenOnChainAmount`, {
|
|
@@ -8,17 +8,9 @@ const utils_1 = require("../../utils");
|
|
|
8
8
|
const Header_style_1 = require("./Header.style");
|
|
9
9
|
const NavigationHeader_1 = require("./NavigationHeader");
|
|
10
10
|
const WalletHeader_1 = require("./WalletHeader");
|
|
11
|
-
const stickyHeaderRoutes = [
|
|
12
|
-
utils_1.navigationRoutes.selectWallet,
|
|
13
|
-
utils_1.navigationRoutes.settings,
|
|
14
|
-
utils_1.navigationRoutes.swapRoutes,
|
|
15
|
-
utils_1.navigationRoutes.swapExecution,
|
|
16
|
-
utils_1.navigationRoutes.swapHistory,
|
|
17
|
-
utils_1.navigationRoutes.swapDetails,
|
|
18
|
-
];
|
|
19
11
|
const HeaderContainer = ({ children }) => {
|
|
20
12
|
const { pathname } = (0, react_router_dom_1.useLocation)();
|
|
21
|
-
return ((0, jsx_runtime_1.jsx)(Header_style_1.Container, Object.assign({ id: utils_1.ElementId.Header, sticky: stickyHeaderRoutes.some((route) => pathname.includes(route)) }, { children: children })));
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(Header_style_1.Container, Object.assign({ id: utils_1.ElementId.Header, sticky: utils_1.stickyHeaderRoutes.some((route) => pathname.includes(route)) }, { children: children })));
|
|
22
14
|
};
|
|
23
15
|
const Header = () => {
|
|
24
16
|
const { walletManagement } = (0, providers_1.useWidgetConfig)();
|
|
@@ -11,16 +11,6 @@ const providers_1 = require("../../providers");
|
|
|
11
11
|
const utils_1 = require("../../utils");
|
|
12
12
|
const Header_style_1 = require("./Header.style");
|
|
13
13
|
const useHeaderActionStore_1 = require("./useHeaderActionStore");
|
|
14
|
-
const backButtonRoutes = [
|
|
15
|
-
utils_1.navigationRoutes.selectWallet,
|
|
16
|
-
utils_1.navigationRoutes.settings,
|
|
17
|
-
utils_1.navigationRoutes.swapHistory,
|
|
18
|
-
utils_1.navigationRoutes.fromToken,
|
|
19
|
-
utils_1.navigationRoutes.toToken,
|
|
20
|
-
utils_1.navigationRoutes.swapRoutes,
|
|
21
|
-
utils_1.navigationRoutes.swapExecution,
|
|
22
|
-
utils_1.navigationRoutes.swapDetails,
|
|
23
|
-
];
|
|
24
14
|
const NavigationHeader = () => {
|
|
25
15
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
26
16
|
const { navigate, navigateBack } = (0, hooks_1.useNavigateBack)();
|
|
@@ -41,8 +31,13 @@ const NavigationHeader = () => {
|
|
|
41
31
|
return t(`header.from`);
|
|
42
32
|
case utils_1.navigationRoutes.toToken:
|
|
43
33
|
return t(`header.to`);
|
|
34
|
+
case utils_1.navigationRoutes.fromChain:
|
|
35
|
+
case utils_1.navigationRoutes.toChain:
|
|
36
|
+
return t(`header.selectChain`);
|
|
44
37
|
case utils_1.navigationRoutes.swapRoutes:
|
|
45
38
|
return t(`header.routes`);
|
|
39
|
+
case utils_1.navigationRoutes.activeSwaps:
|
|
40
|
+
return t(`header.activeSwaps`);
|
|
46
41
|
case utils_1.navigationRoutes.swapExecution:
|
|
47
42
|
return t(`header.swap`);
|
|
48
43
|
case utils_1.navigationRoutes.swapDetails:
|
|
@@ -51,6 +46,6 @@ const NavigationHeader = () => {
|
|
|
51
46
|
return t(`header.swap`);
|
|
52
47
|
}
|
|
53
48
|
};
|
|
54
|
-
return ((0, jsx_runtime_1.jsxs)(Header_style_1.HeaderAppBar, Object.assign({ elevation: 0 }, { children: [backButtonRoutes.includes(path) ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ size: "medium", "aria-label": "settings", edge: "start", onClick: navigateBack }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.ArrowBack, {}) }))) : null, (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: hasPath ? 18 : 24, align: hasPath ? 'center' : 'left', fontWeight: "700", flex: 1, noWrap: true }, { children: handleHeaderTitle() })), (0, jsx_runtime_1.jsxs)(react_router_dom_1.Routes, { children: [(0, jsx_runtime_1.jsx)(react_router_dom_1.Route, { path: utils_1.navigationRoutes.home, element: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [account.isActive ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ size: "medium", "aria-label": "swap-history", edge: "start", onClick: () => navigate(utils_1.navigationRoutes.swapHistory) }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.History, {}) }))) : null, (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ size: "medium", "aria-label": "settings", edge: "end", onClick: () => navigate(utils_1.navigationRoutes.settings) }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.SettingsOutlined, {}) }))] }) }), (0, jsx_runtime_1.jsx)(react_router_dom_1.Route, { path: "*", element: element || (0, jsx_runtime_1.jsx)(material_1.Box, { width: 28, height: 40 }) })] })] })));
|
|
49
|
+
return ((0, jsx_runtime_1.jsxs)(Header_style_1.HeaderAppBar, Object.assign({ elevation: 0 }, { children: [utils_1.backButtonRoutes.includes(path) ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ size: "medium", "aria-label": "settings", edge: "start", onClick: navigateBack }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.ArrowBack, {}) }))) : null, (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: hasPath ? 18 : 24, align: hasPath ? 'center' : 'left', fontWeight: "700", flex: 1, noWrap: true }, { children: handleHeaderTitle() })), (0, jsx_runtime_1.jsxs)(react_router_dom_1.Routes, { children: [(0, jsx_runtime_1.jsx)(react_router_dom_1.Route, { path: utils_1.navigationRoutes.home, element: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [account.isActive ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ size: "medium", "aria-label": "swap-history", edge: "start", onClick: () => navigate(utils_1.navigationRoutes.swapHistory) }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.History, {}) }))) : null, (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ size: "medium", "aria-label": "settings", edge: "end", onClick: () => navigate(utils_1.navigationRoutes.settings) }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.SettingsOutlined, {}) }))] }) }), (0, jsx_runtime_1.jsx)(react_router_dom_1.Route, { path: "*", element: element || (0, jsx_runtime_1.jsx)(material_1.Box, { width: 28, height: 40 }) })] })] })));
|
|
55
50
|
};
|
|
56
51
|
exports.NavigationHeader = NavigationHeader;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { HeaderActionStore } from './types';
|
|
3
2
|
export declare const useHeaderActionStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<HeaderActionStore>, "setState"> & {
|
|
4
3
|
setState(nextStateOrUpdater: HeaderActionStore | Partial<HeaderActionStore> | ((state: import("immer/dist/internal").WritableDraft<HeaderActionStore>) => void), shouldReplace?: boolean | undefined): void;
|
|
5
4
|
}>;
|
|
6
|
-
export declare const useSetHeaderAction: () => (element?: import("react").ReactNode) => () => void;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.useHeaderActionStore = void 0;
|
|
7
7
|
/* eslint-disable no-underscore-dangle */
|
|
8
8
|
const zustand_1 = __importDefault(require("zustand"));
|
|
9
9
|
const immer_1 = require("zustand/middleware/immer");
|
|
@@ -20,7 +20,3 @@ exports.useHeaderActionStore = (0, zustand_1.default)()((0, immer_1.immer)((set,
|
|
|
20
20
|
});
|
|
21
21
|
},
|
|
22
22
|
})));
|
|
23
|
-
const useSetHeaderAction = () => {
|
|
24
|
-
return (0, exports.useHeaderActionStore)((state) => state.setAction);
|
|
25
|
-
};
|
|
26
|
-
exports.useSetHeaderAction = useSetHeaderAction;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const Link: import("@emotion/styled").StyledComponent<Omit<import("@mui/material").LinkBaseProps, "classes"> & {
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").LinkClasses> | undefined;
|
|
5
|
-
color?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<
|
|
5
|
+
color?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string[] | import("csstype").Property.Color | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string[] | import("csstype").Property.Color | undefined>);
|
|
6
6
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
7
7
|
TypographyClasses?: (Partial<import("@mui/material").TypographyClasses> & Partial<import("@mui/material").ClassNameMap<never>>) | undefined;
|
|
8
8
|
underline?: "none" | "always" | "hover" | undefined;
|
|
@@ -6,15 +6,15 @@ const material_1 = require("@mui/material");
|
|
|
6
6
|
const react_hook_form_1 = require("react-hook-form");
|
|
7
7
|
const ReverseTokensButton_1 = require("../components/ReverseTokensButton");
|
|
8
8
|
const SelectTokenButton_1 = require("../components/SelectTokenButton");
|
|
9
|
-
const
|
|
9
|
+
const providers_1 = require("../providers");
|
|
10
10
|
const SelectChainAndToken = (props) => {
|
|
11
11
|
const prefersNarrowView = (0, material_1.useMediaQuery)((theme) => theme.breakpoints.down('sm'));
|
|
12
12
|
const [fromChain, toChain, fromToken, toToken] = (0, react_hook_form_1.useWatch)({
|
|
13
13
|
name: [
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
providers_1.SwapFormKey.FromChain,
|
|
15
|
+
providers_1.SwapFormKey.ToChain,
|
|
16
|
+
providers_1.SwapFormKey.FromToken,
|
|
17
|
+
providers_1.SwapFormKey.ToToken,
|
|
18
18
|
],
|
|
19
19
|
});
|
|
20
20
|
const isCompact = fromChain && toChain && fromToken && toToken && !prefersNarrowView;
|
|
@@ -26,6 +26,12 @@ const SendToWallet = (props) => {
|
|
|
26
26
|
const { showDestinationWallet } = (0, stores_1.useSettings)(['showDestinationWallet']);
|
|
27
27
|
const { account, provider } = (0, providers_1.useWallet)();
|
|
28
28
|
const { register, trigger, formState: { errors }, } = (0, react_hook_form_1.useFormContext)();
|
|
29
|
+
(0, react_1.useEffect)(() => {
|
|
30
|
+
trigger(providers_1.SwapFormKey.ToAddress);
|
|
31
|
+
}, [account.chainId, trigger]);
|
|
32
|
+
if (!showDestinationWallet) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
29
35
|
const { onChange, onBlur, name, ref } = register(providers_1.SwapFormKey.ToAddress, {
|
|
30
36
|
validate: (value) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
37
|
try {
|
|
@@ -42,12 +48,6 @@ const SendToWallet = (props) => {
|
|
|
42
48
|
}),
|
|
43
49
|
onBlur: () => trigger(providers_1.SwapFormKey.ToAddress),
|
|
44
50
|
});
|
|
45
|
-
(0, react_1.useEffect)(() => {
|
|
46
|
-
trigger(providers_1.SwapFormKey.ToAddress);
|
|
47
|
-
}, [account.chainId, trigger]);
|
|
48
|
-
if (!showDestinationWallet) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
51
|
return ((0, jsx_runtime_1.jsxs)(Card_1.Card, Object.assign({}, props, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t('swap.sendToWallet') }), (0, jsx_runtime_1.jsxs)(SendToWallet_style_1.FormControl, Object.assign({ fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(SendToWallet_style_1.Input, { ref: ref, size: "small", autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: "false", onChange: onChange, onBlur: onBlur, name: name, placeholder: t('swap.walletAddressOrEns') }), (0, jsx_runtime_1.jsx)(material_1.FormHelperText, Object.assign({ error: !!errors.toAddress }, { children: (_a = errors.toAddress) === null || _a === void 0 ? void 0 : _a.message }))] }))] })));
|
|
52
52
|
};
|
|
53
53
|
exports.SendToWallet = SendToWallet;
|
|
@@ -10,7 +10,7 @@ function CircularProgress({ status }) {
|
|
|
10
10
|
display: 'grid',
|
|
11
11
|
position: 'relative',
|
|
12
12
|
placeItems: 'center',
|
|
13
|
-
} }, { children: [(0, jsx_runtime_1.jsx)(CircularProgress_style_1.CircularProgress, { variant: "determinate", status: status, size: 32, thickness: 3, value: 100 }), status === 'STARTED' || status === 'PENDING' ? ((0, jsx_runtime_1.jsx)(CircularProgress_style_1.CircularProgressPending, { size: 32, thickness: 3 })) : null, status === 'ACTION_REQUIRED' ? ((0, jsx_runtime_1.jsx)(icons_material_1.Info, { color: "
|
|
13
|
+
} }, { children: [(0, jsx_runtime_1.jsx)(CircularProgress_style_1.CircularProgress, { variant: "determinate", status: status, size: 32, thickness: 3, value: 100 }), status === 'STARTED' || status === 'PENDING' ? ((0, jsx_runtime_1.jsx)(CircularProgress_style_1.CircularProgressPending, { size: 32, thickness: 3 })) : null, status === 'ACTION_REQUIRED' ? ((0, jsx_runtime_1.jsx)(icons_material_1.Info, { color: "info", sx: {
|
|
14
14
|
position: 'absolute',
|
|
15
15
|
fontSize: '1rem',
|
|
16
16
|
} })) : null, status === 'DONE' ? ((0, jsx_runtime_1.jsx)(icons_material_1.Done, { color: "success", sx: {
|
|
@@ -21,7 +21,7 @@ const circleAnimation = (0, styles_1.keyframes)({
|
|
|
21
21
|
const getStatusColor = (status, theme) => {
|
|
22
22
|
switch (status) {
|
|
23
23
|
case 'ACTION_REQUIRED':
|
|
24
|
-
return theme.palette.
|
|
24
|
+
return theme.palette.info.main;
|
|
25
25
|
case 'DONE':
|
|
26
26
|
return theme.palette.success.main;
|
|
27
27
|
case 'FAILED':
|
|
@@ -4,15 +4,11 @@ exports.StepProcess = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const icons_material_1 = require("@mui/icons-material");
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
|
-
const react_i18next_1 = require("react-i18next");
|
|
8
7
|
const hooks_1 = require("../../hooks");
|
|
9
8
|
const CircularProgress_1 = require("./CircularProgress");
|
|
10
9
|
const StepProcess_style_1 = require("./StepProcess.style");
|
|
11
|
-
const utils_1 = require("./utils");
|
|
12
10
|
const StepProcess = ({ step, process }) => {
|
|
13
|
-
const {
|
|
14
|
-
const { getChainById } = (0, hooks_1.useChains)();
|
|
15
|
-
const { title, message } = (0, utils_1.getProcessMessage)(t, getChainById, step, process);
|
|
11
|
+
const { title, message } = (0, hooks_1.useProcessMessage)(step, process);
|
|
16
12
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ px: 2, py: 1 }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: {
|
|
17
13
|
display: 'flex',
|
|
18
14
|
alignItems: 'center',
|
|
@@ -29,7 +29,7 @@ export declare const LinkButton: import("@emotion/styled").StyledComponent<{
|
|
|
29
29
|
}, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "size" | "edge"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & Omit<import("@mui/material").LinkBaseProps, "classes"> & {
|
|
30
30
|
children?: import("react").ReactNode;
|
|
31
31
|
classes?: Partial<import("@mui/material").LinkClasses> | undefined;
|
|
32
|
-
color?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<
|
|
32
|
+
color?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string[] | import("csstype").Property.Color | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string[] | import("csstype").Property.Color | undefined>);
|
|
33
33
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
34
34
|
TypographyClasses?: (Partial<import("@mui/material").TypographyClasses> & Partial<import("@mui/material").ClassNameMap<never>>) | undefined;
|
|
35
35
|
underline?: "none" | "always" | "hover" | undefined;
|
|
@@ -10,7 +10,7 @@ const getExpiryTimestamp = (step) => {
|
|
|
10
10
|
return new Date(((_c = (_b = (_a = step.execution) === null || _a === void 0 ? void 0 : _a.process[0]) === null || _b === void 0 ? void 0 : _b.startedAt) !== null && _c !== void 0 ? _c : Date.now()) +
|
|
11
11
|
step.estimate.executionDuration * 1000);
|
|
12
12
|
};
|
|
13
|
-
const StepTimer = ({ step }) => {
|
|
13
|
+
const StepTimer = ({ step, hideInProgress, }) => {
|
|
14
14
|
var _a, _b;
|
|
15
15
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
16
16
|
const [isExpired, setExpired] = (0, react_1.useState)(false);
|
|
@@ -29,9 +29,7 @@ const StepTimer = ({ step }) => {
|
|
|
29
29
|
setExecutionStarted(true);
|
|
30
30
|
restart(getExpiryTimestamp(step));
|
|
31
31
|
}
|
|
32
|
-
const shouldBePaused = step.execution.process.some((process) => process.status === 'ACTION_REQUIRED' ||
|
|
33
|
-
process.status === 'CHAIN_SWITCH_REQUIRED' ||
|
|
34
|
-
process.status === 'FAILED');
|
|
32
|
+
const shouldBePaused = step.execution.process.some((process) => process.status === 'ACTION_REQUIRED' || process.status === 'FAILED');
|
|
35
33
|
if (isRunning && shouldBePaused) {
|
|
36
34
|
pause();
|
|
37
35
|
}
|
|
@@ -53,11 +51,13 @@ const StepTimer = ({ step }) => {
|
|
|
53
51
|
value: (step.estimate.executionDuration / 60).toFixed(0),
|
|
54
52
|
}) }));
|
|
55
53
|
}
|
|
54
|
+
const isTimerExpired = isExpired || (!minutes && !seconds);
|
|
56
55
|
if (((_a = step.execution) === null || _a === void 0 ? void 0 : _a.status) === 'DONE' ||
|
|
57
|
-
((_b = step.execution) === null || _b === void 0 ? void 0 : _b.status) === 'FAILED'
|
|
56
|
+
((_b = step.execution) === null || _b === void 0 ? void 0 : _b.status) === 'FAILED' ||
|
|
57
|
+
(isTimerExpired && hideInProgress)) {
|
|
58
58
|
return null;
|
|
59
59
|
}
|
|
60
|
-
return
|
|
60
|
+
return isTimerExpired ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: t('swap.inProgress') })) : (
|
|
61
61
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
62
62
|
(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: `${minutes}:${seconds < 10 ? `0${seconds}` : seconds}` }));
|
|
63
63
|
};
|
|
@@ -11,52 +11,33 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.SwapButton = void 0;
|
|
13
13
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
14
|
-
const
|
|
15
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
14
|
+
const material_1 = require("@mui/material");
|
|
16
15
|
const react_i18next_1 = require("react-i18next");
|
|
17
16
|
const react_router_dom_1 = require("react-router-dom");
|
|
18
17
|
const hooks_1 = require("../../hooks");
|
|
19
18
|
const providers_1 = require("../../providers");
|
|
20
19
|
const utils_1 = require("../../utils");
|
|
21
|
-
const
|
|
22
|
-
const SwapButton = ({ onClick, currentRoute, text, loading, }) => {
|
|
23
|
-
var _a;
|
|
20
|
+
const SwapButton = ({ onClick, currentRoute, text, disable, }) => {
|
|
24
21
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
25
22
|
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
26
|
-
const { isValid, isValidating } = (0, react_hook_form_1.useFormState)();
|
|
27
|
-
const { getChainById } = (0, hooks_1.useChains)();
|
|
28
23
|
const config = (0, providers_1.useWidgetConfig)();
|
|
29
|
-
const { account,
|
|
24
|
+
const { account, connect } = (0, providers_1.useWallet)();
|
|
30
25
|
const { insufficientFunds, insufficientGas } = (0, hooks_1.useGasSufficiency)(currentRoute);
|
|
31
|
-
const [chainId] = (0, react_hook_form_1.useWatch)({
|
|
32
|
-
name: [providers_1.SwapFormKeyHelper.getChainKey('from')],
|
|
33
|
-
});
|
|
34
|
-
// Allow switching chain only if execution is not started
|
|
35
|
-
const switchChainAllowed = ((_a = getChainById(chainId || sdk_1.ChainId.ETH)) === null || _a === void 0 ? void 0 : _a.id) !== account.chainId &&
|
|
36
|
-
currentRoute &&
|
|
37
|
-
!currentRoute.steps.some((step) => step.execution);
|
|
38
26
|
const handleSwapButtonClick = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
27
|
if (!account.isActive) {
|
|
40
28
|
if (config.walletManagement) {
|
|
41
|
-
yield
|
|
29
|
+
yield connect();
|
|
42
30
|
}
|
|
43
31
|
else {
|
|
44
32
|
navigate(utils_1.navigationRoutes.selectWallet);
|
|
45
33
|
}
|
|
46
34
|
}
|
|
47
|
-
else if (switchChainAllowed) {
|
|
48
|
-
yield switchChain(chainId);
|
|
49
|
-
// check that the current route exists in the up to date route list
|
|
50
|
-
}
|
|
51
35
|
else {
|
|
52
36
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
53
37
|
}
|
|
54
38
|
});
|
|
55
39
|
const getButtonText = () => {
|
|
56
40
|
if (account.isActive) {
|
|
57
|
-
if (switchChainAllowed) {
|
|
58
|
-
return t(`button.switchChain`);
|
|
59
|
-
}
|
|
60
41
|
if (!currentRoute) {
|
|
61
42
|
return t(`button.swap`);
|
|
62
43
|
}
|
|
@@ -64,14 +45,6 @@ const SwapButton = ({ onClick, currentRoute, text, loading, }) => {
|
|
|
64
45
|
}
|
|
65
46
|
return t(`button.connectWallet`);
|
|
66
47
|
};
|
|
67
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
68
|
-
// loading={isLoading || isFetching}
|
|
69
|
-
disabled: (insufficientFunds ||
|
|
70
|
-
!!insufficientGas.length ||
|
|
71
|
-
loading ||
|
|
72
|
-
isValidating ||
|
|
73
|
-
!isValid) &&
|
|
74
|
-
currentRoute &&
|
|
75
|
-
!switchChainAllowed, fullWidth: true }, { children: getButtonText() })));
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", color: account.isActive ? 'primary' : 'success', onClick: handleSwapButtonClick, disabled: insufficientFunds || !!(insufficientGas === null || insufficientGas === void 0 ? void 0 : insufficientGas.length) || disable, fullWidth: true }, { children: getButtonText() })));
|
|
76
49
|
};
|
|
77
50
|
exports.SwapButton = SwapButton;
|
|
@@ -38,6 +38,6 @@ const SwapRouteCard = (_a) => {
|
|
|
38
38
|
justifyContent: 'space-between',
|
|
39
39
|
} }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 18, fontWeight: "500", lineHeight: 1, pt: 0.25 }, { children: t(`swap.currency`, { value: (_c = route.gasCostUSD) !== null && _c !== void 0 ? _c : 0 }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12, color: "text.secondary", lineHeight: 1, mt: 0.5 }, { children: t(`swap.gas`) }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ fontSize: 18, fontWeight: "500", display: "flex", justifyContent: "flex-end", lineHeight: 1, pt: 0.25 }, { children: ["~", (route.steps
|
|
40
40
|
.map((step) => step.estimate.executionDuration)
|
|
41
|
-
.reduce((
|
|
41
|
+
.reduce((duration, x) => duration + x) / 60).toFixed(0)] })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12, color: "text.secondary", textAlign: "end", lineHeight: 1, mt: 0.5 }, { children: t(`swap.minutes`) }))] })] }))] })));
|
|
42
42
|
};
|
|
43
43
|
exports.SwapRouteCard = SwapRouteCard;
|
|
@@ -6,9 +6,6 @@ const Avatar_1 = require("@mui/material/Avatar");
|
|
|
6
6
|
const Badge_1 = require("@mui/material/Badge");
|
|
7
7
|
const styles_1 = require("@mui/material/styles");
|
|
8
8
|
exports.TokenAvatarGroup = (0, styles_1.styled)(material_1.AvatarGroup)(({ theme }) => ({
|
|
9
|
-
[`& .${Avatar_1.avatarClasses.root}`]: {
|
|
10
|
-
background: theme.palette.background.paper,
|
|
11
|
-
},
|
|
12
9
|
[`& .${Badge_1.badgeClasses.badge}:last-child .${Avatar_1.avatarClasses.root}`]: {
|
|
13
10
|
marginLeft: theme.spacing(-1),
|
|
14
11
|
boxSizing: 'border-box',
|
|
@@ -35,7 +35,9 @@ const TokenList = ({ formType, height, onClick, }) => {
|
|
|
35
35
|
? [searchedToken]
|
|
36
36
|
: filteredTokens;
|
|
37
37
|
const handleTokenClick = (0, react_1.useCallback)((tokenAddress) => {
|
|
38
|
-
setValue(providers_1.SwapFormKeyHelper.getTokenKey(formType), tokenAddress
|
|
38
|
+
setValue(providers_1.SwapFormKeyHelper.getTokenKey(formType), tokenAddress, {
|
|
39
|
+
shouldDirty: true,
|
|
40
|
+
});
|
|
39
41
|
setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), '');
|
|
40
42
|
const oppositeFormType = formType === 'from' ? 'to' : 'from';
|
|
41
43
|
const [selectedOppositeToken, selectedOppositeChain, selectedChain] = getValues([
|
|
@@ -45,10 +47,12 @@ const TokenList = ({ formType, height, onClick, }) => {
|
|
|
45
47
|
]);
|
|
46
48
|
if (selectedOppositeToken === tokenAddress &&
|
|
47
49
|
selectedOppositeChain === selectedChain) {
|
|
48
|
-
setValue(providers_1.SwapFormKeyHelper.getTokenKey(oppositeFormType), ''
|
|
50
|
+
setValue(providers_1.SwapFormKeyHelper.getTokenKey(oppositeFormType), '', {
|
|
51
|
+
shouldDirty: false,
|
|
52
|
+
});
|
|
49
53
|
}
|
|
50
54
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
51
55
|
}, [formType, getValues, onClick, setValue]);
|
|
52
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ ref: parentRef, style: { height, overflow: 'auto' } }, { children: [!tokens.length && !isLoading ? (0, jsx_runtime_1.jsx)(TokenNotFound_1.TokenNotFound, {}) : null, (0, jsx_runtime_1.jsx)(VirtualizedTokenList_1.VirtualizedTokenList, { tokens: tokens, featuredTokensLength: featuredTokens === null || featuredTokens === void 0 ? void 0 : featuredTokens.length, scrollElementRef: parentRef, chainId: selectedChainId, isLoading: isLoading, isBalanceLoading: isBalanceLoading, showBalance: account.isActive, showFeatured: !tokenSearchFilter, onClick: handleTokenClick })] })));
|
|
56
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ ref: parentRef, style: { height, overflow: 'auto' } }, { children: [!tokens.length && !isLoading ? ((0, jsx_runtime_1.jsx)(TokenNotFound_1.TokenNotFound, { formType: formType })) : null, (0, jsx_runtime_1.jsx)(VirtualizedTokenList_1.VirtualizedTokenList, { tokens: tokens, featuredTokensLength: featuredTokens === null || featuredTokens === void 0 ? void 0 : featuredTokens.length, scrollElementRef: parentRef, chainId: selectedChainId, isLoading: isLoading, isBalanceLoading: isBalanceLoading, showBalance: account.isActive, showFeatured: !tokenSearchFilter, onClick: handleTokenClick })] })));
|
|
53
57
|
};
|
|
54
58
|
exports.TokenList = TokenList;
|
|
@@ -7,7 +7,8 @@ const styles_1 = require("@mui/material/styles");
|
|
|
7
7
|
const utils_1 = require("../../utils");
|
|
8
8
|
exports.ListItemButton = (0, styles_1.styled)(material_1.ListItemButton)(({ theme }) => ({
|
|
9
9
|
borderRadius: theme.shape.borderRadiusSecondary,
|
|
10
|
-
paddingLeft: theme.spacing(
|
|
10
|
+
paddingLeft: theme.spacing(1.5),
|
|
11
|
+
paddingRight: theme.spacing(1.5),
|
|
11
12
|
height: 64,
|
|
12
13
|
width: '100%',
|
|
13
14
|
'&:hover': {
|
|
@@ -21,8 +22,8 @@ exports.ListItem = (0, styles_1.styled)(material_1.ListItem)(({ theme }) => ({
|
|
|
21
22
|
height: 64,
|
|
22
23
|
flexDirection: 'column',
|
|
23
24
|
alignItems: 'flex-start',
|
|
24
|
-
padding: theme.spacing(0,
|
|
25
|
+
padding: theme.spacing(0, 1.5),
|
|
25
26
|
[`.${ListItemSecondaryAction_1.listItemSecondaryActionClasses.root}`]: {
|
|
26
|
-
right: theme.spacing(
|
|
27
|
+
right: theme.spacing(3),
|
|
27
28
|
},
|
|
28
29
|
}));
|
|
@@ -19,7 +19,7 @@ exports.TokenListItem = (0, react_1.memo)(({ onClick, size, start, token, showBa
|
|
|
19
19
|
}) }))) : null] })))) : null] })), endAdornment] })));
|
|
20
20
|
});
|
|
21
21
|
const TokenListItemSkeleton = () => {
|
|
22
|
-
return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItem, Object.assign({ secondaryAction: (0, jsx_runtime_1.jsx)(exports.TokenAmountSkeleton, {}), disablePadding: true, sx: { position: 'relative', flexDirection: 'row', alignItems: 'center' } }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "circular", width: 32, height: 32, sx: { marginLeft:
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItem, Object.assign({ secondaryAction: (0, jsx_runtime_1.jsx)(exports.TokenAmountSkeleton, {}), disablePadding: true, sx: { position: 'relative', flexDirection: 'row', alignItems: 'center' } }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "circular", width: 32, height: 32, sx: { marginLeft: 1.5, marginRight: 2 } }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 20 }), secondary: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 96, height: 20 }) })] })));
|
|
23
23
|
};
|
|
24
24
|
exports.TokenListItemSkeleton = TokenListItemSkeleton;
|
|
25
25
|
const TokenAmountSkeleton = () => {
|