@lifi/widget 1.14.1 → 1.16.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/cjs/App.js +21 -0
- package/cjs/components/ActiveSwaps/ActiveSwapItem.d.ts +5 -0
- package/cjs/components/ActiveSwaps/ActiveSwapItem.js +45 -0
- package/cjs/components/{SwapInProgress/SwapInProgress.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/Card/Card.d.ts +7 -4
- package/cjs/components/Card/Card.js +38 -28
- package/cjs/{pages/SelectTokenPage → components/ChainSelect}/ChainSelect.d.ts +1 -1
- package/cjs/components/ChainSelect/ChainSelect.js +35 -0
- package/cjs/components/{SwapInProgress/SwapInProgress.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/Header/Header.js +3 -11
- package/cjs/components/Header/NavigationHeader.js +10 -17
- package/cjs/components/Header/WalletHeader.js +4 -5
- package/cjs/components/PoweredBy/PoweredBy.style.d.ts +1 -1
- package/cjs/components/PoweredBy/PoweredBy.style.js +1 -0
- package/cjs/components/ReverseTokensButton/ReverseTokensButton.js +10 -10
- package/cjs/components/SelectTokenButton/SelectTokenButton.d.ts +1 -1
- package/cjs/components/SelectTokenButton/SelectTokenButton.js +3 -3
- package/{components/SwapInProgress/SwapInProgress.d.ts → cjs/components/SendToWallet/SendToWallet.d.ts} +1 -1
- package/cjs/components/SendToWallet/SendToWallet.js +53 -0
- package/cjs/components/SendToWallet/SendToWallet.style.d.ts +19 -0
- package/cjs/components/SendToWallet/SendToWallet.style.js +15 -0
- package/cjs/components/SendToWallet/index.d.ts +1 -0
- package/cjs/components/{SwapInProgress → SendToWallet}/index.js +1 -1
- 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 +10 -14
- package/cjs/components/SwapButton/types.d.ts +2 -2
- package/cjs/components/SwapInput/FormPriceHelperText.d.ts +1 -1
- package/cjs/components/SwapInput/FormPriceHelperText.js +4 -4
- package/cjs/components/SwapInput/SwapInput.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInput.js +4 -4
- package/cjs/components/SwapInput/SwapInputAdornment.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInputAdornment.js +4 -4
- package/cjs/components/SwapRouteCard/SwapRouteCard.js +5 -4
- package/cjs/components/SwapRouteCard/SwapRouteCard.style.js +3 -3
- package/cjs/components/TokenAvatar/TokenAvatar.style.js +0 -3
- package/cjs/components/TokenList/TokenList.js +14 -11
- package/cjs/components/TokenList/types.d.ts +1 -1
- 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 +3 -0
- package/cjs/hooks/index.js +3 -0
- package/cjs/hooks/useChains.d.ts +1 -97
- package/cjs/hooks/useChains.js +8 -15
- package/cjs/hooks/useNavigateBack.d.ts +4 -0
- package/cjs/hooks/useNavigateBack.js +18 -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 +20 -29
- package/cjs/hooks/useSwapRoutes.js +18 -7
- package/cjs/hooks/useWidgetEvents.d.ts +3 -0
- package/cjs/hooks/useWidgetEvents.js +13 -0
- package/cjs/i18n/en/translation.json +25 -15
- package/cjs/i18n/index.d.ts +20 -10
- 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/pages/ActiveSwapsPage/index.js +17 -0
- package/cjs/pages/MainPage/MainPage.js +2 -2
- 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/SearchTokenInput.js +3 -3
- package/cjs/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -4
- package/cjs/pages/SelectTokenPage/SelectTokenPage.js +4 -8
- package/cjs/pages/SelectWalletPage/SelectWalletPage.js +10 -10
- 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 +2 -2
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +2 -2
- 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/RoutePrioritySelect.js +5 -1
- package/cjs/pages/SettingsPage/SettingsPage.js +2 -1
- package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +2 -0
- package/cjs/pages/SettingsPage/ShowDestinationWallet.js +22 -0
- package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +4 -3
- package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +2 -2
- package/cjs/pages/SwapPage/StatusBottomSheet.js +29 -41
- package/cjs/pages/SwapPage/SwapPage.js +7 -3
- package/cjs/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
- package/cjs/providers/SwapFormProvider/SwapFormProvider.d.ts +1 -0
- package/cjs/providers/SwapFormProvider/SwapFormProvider.js +43 -9
- package/cjs/providers/SwapFormProvider/types.d.ts +3 -1
- package/cjs/providers/SwapFormProvider/types.js +1 -0
- package/cjs/providers/WalletProvider/WalletProvider.js +10 -4
- package/cjs/providers/WalletProvider/types.d.ts +4 -2
- package/cjs/providers/WidgetProvider/WidgetProvider.js +3 -7
- package/cjs/providers/index.d.ts +4 -0
- package/cjs/providers/index.js +20 -0
- package/cjs/stores/chains/index.d.ts +4 -0
- package/cjs/stores/chains/index.js +20 -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 +42 -0
- package/cjs/stores/chains/useInitializeChainOrder.d.ts +1 -0
- package/cjs/stores/chains/useInitializeChainOrder.js +12 -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/types.d.ts +2 -1
- package/cjs/stores/settings/useSettingsStore.d.ts +4 -2
- package/cjs/stores/settings/useSettingsStore.js +6 -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 +3 -1
- package/cjs/utils/format.js +7 -2
- 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/ActiveSwaps/ActiveSwaps.d.ts +3 -0
- 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/Card/Card.d.ts +7 -4
- package/components/Card/Card.js +39 -29
- package/{pages/SelectTokenPage → components/ChainSelect}/ChainSelect.d.ts +1 -1
- package/components/ChainSelect/ChainSelect.js +31 -0
- package/components/{SwapInProgress/SwapInProgress.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/Header/Header.js +2 -10
- package/components/Header/NavigationHeader.js +11 -18
- package/components/Header/WalletHeader.js +1 -2
- package/components/PoweredBy/PoweredBy.style.d.ts +1 -1
- package/components/PoweredBy/PoweredBy.style.js +1 -0
- package/components/ReverseTokensButton/ReverseTokensButton.js +1 -1
- package/components/SelectTokenButton/SelectTokenButton.d.ts +1 -1
- package/components/SelectTokenButton/SelectTokenButton.js +1 -1
- package/components/SendToWallet/SendToWallet.d.ts +3 -0
- package/components/SendToWallet/SendToWallet.js +49 -0
- package/components/SendToWallet/SendToWallet.style.d.ts +19 -0
- package/components/SendToWallet/SendToWallet.style.js +12 -0
- package/components/SendToWallet/index.d.ts +1 -0
- package/components/SendToWallet/index.js +1 -0
- 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 -11
- package/components/SwapButton/types.d.ts +2 -2
- package/components/SwapInput/FormPriceHelperText.d.ts +1 -1
- package/components/SwapInput/FormPriceHelperText.js +1 -1
- package/components/SwapInput/SwapInput.d.ts +1 -1
- package/components/SwapInput/SwapInput.js +1 -1
- package/components/SwapInput/SwapInputAdornment.d.ts +1 -1
- package/components/SwapInput/SwapInputAdornment.js +1 -1
- package/components/SwapRouteCard/SwapRouteCard.js +5 -4
- package/components/SwapRouteCard/SwapRouteCard.style.js +3 -3
- package/components/TokenAvatar/TokenAvatar.style.js +0 -3
- package/components/TokenList/TokenList.js +7 -4
- package/components/TokenList/types.d.ts +1 -1
- package/config/theme.js +24 -23
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/index.d.ts +3 -0
- package/hooks/index.js +3 -0
- package/hooks/useChains.d.ts +1 -97
- package/hooks/useChains.js +8 -15
- package/hooks/useNavigateBack.d.ts +4 -0
- package/hooks/useNavigateBack.js +14 -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 +21 -30
- package/hooks/useSwapRoutes.js +18 -7
- package/hooks/useWidgetEvents.d.ts +3 -0
- package/hooks/useWidgetEvents.js +6 -0
- package/i18n/en/translation.json +25 -15
- package/i18n/index.d.ts +20 -10
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +17 -19
- 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 -2
- 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/SearchTokenInput.js +1 -1
- package/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -4
- package/pages/SelectTokenPage/SelectTokenPage.js +5 -9
- package/pages/SelectWalletPage/SelectWalletPage.js +10 -10
- 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.js +1 -1
- 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/RoutePrioritySelect.js +5 -1
- package/pages/SettingsPage/SettingsPage.js +2 -1
- package/pages/SettingsPage/ShowDestinationWallet.d.ts +2 -0
- package/pages/SettingsPage/ShowDestinationWallet.js +18 -0
- package/pages/SwapDetailsPage/SwapDetailsPage.js +5 -4
- package/pages/SwapHistoryPage/SwapHistoryPage.js +1 -1
- package/pages/SwapPage/StatusBottomSheet.js +30 -42
- package/pages/SwapPage/SwapPage.js +9 -5
- package/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
- package/providers/SwapFormProvider/SwapFormProvider.d.ts +1 -0
- package/providers/SwapFormProvider/SwapFormProvider.js +43 -9
- package/providers/SwapFormProvider/types.d.ts +3 -1
- package/providers/SwapFormProvider/types.js +1 -0
- package/providers/WalletProvider/WalletProvider.js +10 -4
- package/providers/WalletProvider/types.d.ts +4 -2
- package/providers/WidgetProvider/WidgetProvider.js +3 -7
- package/providers/index.d.ts +4 -0
- package/providers/index.js +4 -0
- package/stores/chains/index.d.ts +4 -0
- package/stores/chains/index.js +4 -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 +36 -0
- package/stores/chains/useInitializeChainOrder.d.ts +1 -0
- package/stores/chains/useInitializeChainOrder.js +5 -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/types.d.ts +2 -1
- package/stores/settings/useSettingsStore.d.ts +4 -2
- package/stores/settings/useSettingsStore.js +6 -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 +3 -1
- package/utils/format.js +7 -2
- 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/SwapInProgress/SwapInProgress.js +0 -29
- package/cjs/components/SwapInProgress/SwapInProgress.style.js +0 -17
- package/cjs/components/SwapInProgress/index.d.ts +0 -1
- package/cjs/pages/SelectTokenPage/ChainSelect.js +0 -32
- 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/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/SwapInProgress/SwapInProgress.js +0 -25
- package/components/SwapInProgress/SwapInProgress.style.js +0 -14
- package/components/SwapInProgress/index.d.ts +0 -1
- package/components/SwapInProgress/index.js +0 -1
- package/pages/SelectTokenPage/ChainSelect.js +0 -28
- package/pages/SwapPage/utils.d.ts +0 -6
- package/stores/route/useExecutingRoutes.d.ts +0 -2
- package/stores/route/useExecutingRoutes.js +0 -6
package/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './fonts/inter.css';
|
|
3
|
+
export { useWidgetEvents } from './hooks';
|
|
3
4
|
export * from './types';
|
|
4
5
|
export declare const LiFiWidget: import("react").FC<import("./AppProvider").AppProps>;
|
|
5
6
|
export declare const LiFiWidgetDrawer: import("react").ForwardRefExoticComponent<Pick<import("./AppDrawer").AppDrawerProps, "className" | "style" | "classes" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "key" | "transitionDuration" | "variant" | "open" | "anchor" | "elementRef" | "components" | "componentsProps" | "BackdropComponent" | "BackdropProps" | "closeAfterTransition" | "container" | "disableAutoFocus" | "disableEnforceFocus" | "disableEscapeKeyDown" | "disablePortal" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "onBackdropClick" | "onClose" | "config" | "elevation" | "ModalProps" | "PaperProps" | "SlideProps"> & import("react").RefAttributes<import("./AppDrawer").AppDrawerBase>>;
|
package/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { App } from './App';
|
|
|
2
2
|
import { AppDrawer } from './AppDrawer';
|
|
3
3
|
import './fonts/inter.css';
|
|
4
4
|
import { configureReactI18next } from './i18n';
|
|
5
|
+
export { useWidgetEvents } from './hooks';
|
|
5
6
|
export * from './types';
|
|
6
7
|
configureReactI18next();
|
|
7
8
|
// ClassNameGenerator.configure((componentName) =>
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./index.js",
|
|
7
|
+
"types": "./index.d.ts",
|
|
7
8
|
"lint-staged": {
|
|
8
9
|
"src/**/*.{ts,tsx}": [
|
|
9
10
|
"yarn run lint:fix",
|
|
@@ -36,27 +37,29 @@
|
|
|
36
37
|
"lifi"
|
|
37
38
|
],
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@emotion/react": "^11.10.
|
|
40
|
-
"@emotion/styled": "^11.10.
|
|
40
|
+
"@emotion/react": "^11.10.4",
|
|
41
|
+
"@emotion/styled": "^11.10.4",
|
|
42
|
+
"@ethersproject/address": "^5.7.0",
|
|
41
43
|
"@ethersproject/experimental": "^5.7.0",
|
|
42
44
|
"@ethersproject/providers": "^5.7.0",
|
|
43
|
-
"@lifi/sdk": "^1.
|
|
44
|
-
"@lifi/wallet-management": "^1.1.
|
|
45
|
-
"@mui/icons-material": "^5.
|
|
46
|
-
"@mui/lab": "^5.0.0-alpha.
|
|
47
|
-
"@mui/material": "^5.10.
|
|
48
|
-
"@sentry/integrations": "^7.
|
|
49
|
-
"@sentry/react": "^7.
|
|
50
|
-
"@sentry/tracing": "^7.
|
|
51
|
-
"@tanstack/react-query": "^4.2.
|
|
45
|
+
"@lifi/sdk": "^1.5.0",
|
|
46
|
+
"@lifi/wallet-management": "^1.1.9",
|
|
47
|
+
"@mui/icons-material": "^5.10.3",
|
|
48
|
+
"@mui/lab": "^5.0.0-alpha.98",
|
|
49
|
+
"@mui/material": "^5.10.4",
|
|
50
|
+
"@sentry/integrations": "^7.12.1",
|
|
51
|
+
"@sentry/react": "^7.12.1",
|
|
52
|
+
"@sentry/tracing": "^7.12.1",
|
|
53
|
+
"@tanstack/react-query": "^4.2.3",
|
|
52
54
|
"@tanstack/react-virtual": "^3.0.0-beta.17",
|
|
53
55
|
"big.js": "^6.2.1",
|
|
56
|
+
"events": "^3.3.0",
|
|
54
57
|
"i18next": "^21.9.1",
|
|
55
58
|
"immer": "^9.0.15",
|
|
56
59
|
"react": "^18.2.0",
|
|
57
60
|
"react-dom": "^18.2.0",
|
|
58
61
|
"react-hook-form": "^7.34.2",
|
|
59
|
-
"react-i18next": "^11.18.
|
|
62
|
+
"react-i18next": "^11.18.5",
|
|
60
63
|
"react-router-dom": "^6.3.0",
|
|
61
64
|
"react-timer-hook": "^3.0.5",
|
|
62
65
|
"zustand": "^4.1.1"
|
|
@@ -75,10 +78,5 @@
|
|
|
75
78
|
"extends": "../../.eslintrc"
|
|
76
79
|
},
|
|
77
80
|
"sideEffects": false,
|
|
78
|
-
"private": false
|
|
79
|
-
"types": "./index.d.ts",
|
|
80
|
-
"exports": {
|
|
81
|
-
"require": "./cjs/index.js",
|
|
82
|
-
"import": "./index.js"
|
|
83
|
-
}
|
|
81
|
+
"private": false
|
|
84
82
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SwapHoriz as SwapHorizIcon } from '@mui/icons-material';
|
|
3
|
+
import { Container, Typography } from '@mui/material';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
export const ActiveSwapsEmpty = () => {
|
|
6
|
+
const { t } = useTranslation();
|
|
7
|
+
return (_jsxs(Container, Object.assign({ sx: {
|
|
8
|
+
display: 'flex',
|
|
9
|
+
flex: 1,
|
|
10
|
+
flexDirection: 'column',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
} }, { children: [_jsx(Typography, Object.assign({ fontSize: 48 }, { children: _jsx(SwapHorizIcon, { fontSize: "inherit" }) })), _jsx(Typography, Object.assign({ fontSize: 18, fontWeight: 700 }, { children: t('swap.info.title.emptyActiveSwaps') })), _jsx(Typography, Object.assign({ fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2 }, { children: t('swap.info.message.emptyActiveSwaps') }))] })));
|
|
14
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Container, List } from '@mui/material';
|
|
3
|
+
import { ActiveSwapItem } from '../../components/ActiveSwaps';
|
|
4
|
+
import { useWallet } from '../../providers';
|
|
5
|
+
import { useExecutingRoutesIds } from '../../stores';
|
|
6
|
+
import { ActiveSwapsEmpty } from './ActiveSwapsEmpty';
|
|
7
|
+
export const ActiveSwapsPage = () => {
|
|
8
|
+
const { account } = useWallet();
|
|
9
|
+
const executingRoutes = useExecutingRoutesIds(account.address);
|
|
10
|
+
if (!executingRoutes.length) {
|
|
11
|
+
return _jsx(ActiveSwapsEmpty, {});
|
|
12
|
+
}
|
|
13
|
+
return (_jsx(Container, Object.assign({ disableGutters: true }, { children: _jsx(List, Object.assign({ sx: {
|
|
14
|
+
paddingLeft: 1.5,
|
|
15
|
+
paddingRight: 1.5,
|
|
16
|
+
} }, { children: executingRoutes.map((routeId) => (_jsx(ActiveSwapItem, { routeId: routeId }, routeId))) })) })));
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ActiveSwapsPage';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ActiveSwapsPage';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '@mui/material';
|
|
3
|
+
import { ActiveSwaps } from '../../components/ActiveSwaps';
|
|
3
4
|
import { SelectChainAndToken } from '../../components/SelectChainAndToken';
|
|
4
|
-
import { SwapInProgress } from '../../components/SwapInProgress';
|
|
5
5
|
import { SwapInput } from '../../components/SwapInput';
|
|
6
6
|
import { FormContainer } from './MainPage.style';
|
|
7
7
|
import { MainSwapButton } from './MainSwapButton';
|
|
8
8
|
import { SwapRoutes } from './SwapRoutes';
|
|
9
9
|
export const MainPage = () => {
|
|
10
|
-
return (_jsxs(FormContainer, Object.assign({ disableGutters: true }, { children: [_jsx(
|
|
10
|
+
return (_jsxs(FormContainer, Object.assign({ disableGutters: true }, { children: [_jsx(ActiveSwaps, { mx: 3, mt: 1, mb: 2 }), _jsx(SelectChainAndToken, { mt: 1, mx: 3, mb: 3 }), _jsx(Box, Object.assign({ mx: 3, mb: 3 }, { children: _jsx(SwapInput, { formType: "from" }) })), _jsx(SwapRoutes, { mx: 3, mb: 3 }), _jsx(Box, Object.assign({ mx: 3, mb: 1 }, { children: _jsx(MainSwapButton, {}) }))] })));
|
|
11
11
|
};
|
|
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { useFormState } from 'react-hook-form';
|
|
11
12
|
import { useNavigate } from 'react-router-dom';
|
|
12
13
|
import { SwapButton } from '../../components/SwapButton';
|
|
13
14
|
import { useSwapRoutes } from '../../hooks';
|
|
@@ -15,6 +16,7 @@ import { useSetExecutableRoute } from '../../stores';
|
|
|
15
16
|
import { navigationRoutes } from '../../utils';
|
|
16
17
|
export const MainSwapButton = () => {
|
|
17
18
|
const navigate = useNavigate();
|
|
19
|
+
const { isValid, isValidating } = useFormState();
|
|
18
20
|
const setExecutableRoute = useSetExecutableRoute();
|
|
19
21
|
const { routes: swapRoutes, isLoading, isFetching } = useSwapRoutes();
|
|
20
22
|
const currentRoute = swapRoutes === null || swapRoutes === void 0 ? void 0 : swapRoutes[0];
|
|
@@ -26,5 +28,5 @@ export const MainSwapButton = () => {
|
|
|
26
28
|
});
|
|
27
29
|
}
|
|
28
30
|
});
|
|
29
|
-
return (_jsx(SwapButton, { onClick: handleClick, currentRoute: currentRoute,
|
|
31
|
+
return (_jsx(SwapButton, { onClick: handleClick, currentRoute: currentRoute, disable: isLoading || isFetching || !currentRoute || isValidating || !isValid }));
|
|
30
32
|
};
|
|
@@ -3,11 +3,13 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
import { KeyboardArrowRight as KeyboardArrowRightIcon } from '@mui/icons-material';
|
|
4
4
|
import { Box, IconButton } from '@mui/material';
|
|
5
5
|
import { useCallback } from 'react';
|
|
6
|
+
import { useFormState } from 'react-hook-form';
|
|
6
7
|
import { useTranslation } from 'react-i18next';
|
|
7
8
|
import { useNavigate } from 'react-router-dom';
|
|
8
9
|
import { Card, CardTitle } from '../../components/Card';
|
|
9
10
|
import { GasSufficiencyMessage } from '../../components/GasSufficiencyMessage';
|
|
10
11
|
import { ProgressToNextUpdate } from '../../components/ProgressToNextUpdate';
|
|
12
|
+
import { SendToWallet } from '../../components/SendToWallet';
|
|
11
13
|
import { SwapRouteCard, SwapRouteCardSkeleton, SwapRouteNotFoundCard, } from '../../components/SwapRouteCard';
|
|
12
14
|
import { useSwapRoutes } from '../../hooks';
|
|
13
15
|
import { navigationRoutes } from '../../utils';
|
|
@@ -15,6 +17,7 @@ import { Stack } from './SwapRoutes.style';
|
|
|
15
17
|
export const SwapRoutes = (props) => {
|
|
16
18
|
const { t } = useTranslation();
|
|
17
19
|
const navigate = useNavigate();
|
|
20
|
+
const { isValid, isValidating } = useFormState();
|
|
18
21
|
const { routes, isLoading, isFetching, isFetched, dataUpdatedAt, refetchTime, refetch, } = useSwapRoutes();
|
|
19
22
|
const handleCardClick = useCallback(() => {
|
|
20
23
|
navigate(navigationRoutes.swapRoutes);
|
|
@@ -32,5 +35,5 @@ export const SwapRoutes = (props) => {
|
|
|
32
35
|
borderWidth: !routeNotFound && (isFetching || (routes && routes.length > 1))
|
|
33
36
|
? 1
|
|
34
37
|
: 0,
|
|
35
|
-
} }, { children: isLoading || isFetching ? (_jsxs(_Fragment, { children: [_jsx(SwapRouteCardSkeleton, { minWidth: "80%", dense: true }), _jsx(SwapRouteCardSkeleton, { minWidth: "80%", dense: true })] })) : !currentRoute ? (_jsx(SwapRouteNotFoundCard, { minWidth: "100%", dense: true })) : (_jsxs(_Fragment, { children: [_jsx(SwapRouteCard, { minWidth: routes.length > 1 ? '80%' : '100%', route: currentRoute, active: true, dense: true }), routes.length > 1 ? (_jsx(SwapRouteCard, { minWidth: "80%", route: routes[1], dense: true })) : null] })) })), _jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: !routeNotFound ? (_jsx(Box, Object.assign({ py: 1, pr: 1 }, { children: _jsx(IconButton, Object.assign({ onClick: handleCardClick, size: "medium", "aria-label": "swap-routes" }, { children: _jsx(KeyboardArrowRightIcon, {}) })) }))) : null }))] }))] })), _jsx(GasSufficiencyMessage, Object.assign({ route: !isFetching ? currentRoute : undefined }, props))] }));
|
|
38
|
+
} }, { children: isLoading || isFetching ? (_jsxs(_Fragment, { children: [_jsx(SwapRouteCardSkeleton, { minWidth: "80%", dense: true }), _jsx(SwapRouteCardSkeleton, { minWidth: "80%", dense: true })] })) : !currentRoute ? (_jsx(SwapRouteNotFoundCard, { minWidth: "100%", dense: true })) : (_jsxs(_Fragment, { children: [_jsx(SwapRouteCard, { minWidth: routes.length > 1 ? '80%' : '100%', route: currentRoute, active: true, dense: true }), routes.length > 1 ? (_jsx(SwapRouteCard, { minWidth: "80%", route: routes[1], dense: true })) : null] })) })), _jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: !routeNotFound ? (_jsx(Box, Object.assign({ py: 1, pr: 1 }, { children: _jsx(IconButton, Object.assign({ onClick: handleCardClick, size: "medium", "aria-label": "swap-routes", disabled: isValidating || !isValid }, { children: _jsx(KeyboardArrowRightIcon, {}) })) }))) : null }))] }))] })), _jsx(GasSufficiencyMessage, Object.assign({ route: !isFetching ? currentRoute : undefined }, props)), _jsx(SendToWallet, { mx: 3, mb: 3 })] }));
|
|
36
39
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { Avatar, Container, List, ListItemAvatar } from '@mui/material';
|
|
12
|
+
import { useLocation } from 'react-router-dom';
|
|
13
|
+
import { useChainSelect } from '../../components/ChainSelect';
|
|
14
|
+
import { useNavigateBack } from '../../hooks';
|
|
15
|
+
import { ListItemButton, ListItemText } from './SelectChainPage.style';
|
|
16
|
+
export const SelectChainPage = ({ formType, }) => {
|
|
17
|
+
const { navigateBack } = useNavigateBack();
|
|
18
|
+
const { state } = useLocation();
|
|
19
|
+
const formTypeState = (state === null || state === void 0 ? void 0 : state.formType) || formType;
|
|
20
|
+
const { chains, setCurrentChain } = useChainSelect(formTypeState);
|
|
21
|
+
const handleClick = (chainId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
+
setCurrentChain(chainId);
|
|
23
|
+
navigateBack();
|
|
24
|
+
});
|
|
25
|
+
return (_jsx(Container, Object.assign({ disableGutters: true }, { children: _jsx(List, Object.assign({ sx: {
|
|
26
|
+
paddingLeft: 1.5,
|
|
27
|
+
paddingRight: 1.5,
|
|
28
|
+
} }, { children: chains === null || chains === void 0 ? void 0 : chains.map((chain) => (_jsxs(ListItemButton, Object.assign({ onClick: () => handleClick(chain.id), disableRipple: true }, { children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, Object.assign({ src: chain.logoURI, alt: chain.name }, { children: chain.name[0] })) }), _jsx(ListItemText, { primary: chain.name })] }), chain.id))) })) })));
|
|
29
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const ListItemButton: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemButtonBaseProps & Omit<{
|
|
3
|
+
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
4
|
+
centerRipple?: boolean | undefined;
|
|
5
|
+
children?: import("react").ReactNode;
|
|
6
|
+
classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
|
|
7
|
+
disabled?: boolean | undefined;
|
|
8
|
+
disableRipple?: boolean | undefined;
|
|
9
|
+
disableTouchRipple?: boolean | undefined;
|
|
10
|
+
focusRipple?: boolean | undefined;
|
|
11
|
+
focusVisibleClassName?: string | undefined;
|
|
12
|
+
LinkComponent?: import("react").ElementType<any> | undefined;
|
|
13
|
+
onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
|
|
14
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
15
|
+
tabIndex?: number | undefined;
|
|
16
|
+
TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
|
|
17
|
+
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
18
|
+
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
19
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
20
|
+
}, "className" | "style" | "classes" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "autoFocus" | "dense" | "divider" | "selected" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
21
|
+
export declare const ListItemText: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemTextProps<import("react").ElementType<any>, import("react").ElementType<any>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ListItemButton as MuiListItemButton, ListItemText as MuiListItemText, } from '@mui/material';
|
|
2
|
+
import { listItemTextClasses } from '@mui/material/ListItemText';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import { getContrastAlphaColor } from '../../utils';
|
|
5
|
+
export const ListItemButton = styled(MuiListItemButton)(({ theme }) => ({
|
|
6
|
+
borderRadius: theme.shape.borderRadiusSecondary,
|
|
7
|
+
paddingLeft: theme.spacing(1.5),
|
|
8
|
+
height: 56,
|
|
9
|
+
'&:hover': {
|
|
10
|
+
backgroundColor: getContrastAlphaColor(theme, '4%'),
|
|
11
|
+
},
|
|
12
|
+
}));
|
|
13
|
+
export const ListItemText = styled(MuiListItemText)(({ theme }) => ({
|
|
14
|
+
[`.${listItemTextClasses.primary}`]: {
|
|
15
|
+
fontWeight: 400,
|
|
16
|
+
},
|
|
17
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SelectChainPage';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SelectChainPage';
|
|
@@ -5,7 +5,7 @@ import { useEffect } from 'react';
|
|
|
5
5
|
import { useFormContext } from 'react-hook-form';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import { Card } from '../../components/Card';
|
|
8
|
-
import { SwapFormKey } from '../../providers
|
|
8
|
+
import { SwapFormKey } from '../../providers';
|
|
9
9
|
import { Input } from './SearchTokenInput.style';
|
|
10
10
|
export const SearchTokenInput = () => {
|
|
11
11
|
const { t } = useTranslation();
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const SelectTokenPage: FC<
|
|
4
|
-
formType: SwapFormDirection;
|
|
5
|
-
}>;
|
|
2
|
+
import type { SwapFormTypeProps } from '../../providers';
|
|
3
|
+
export declare const SelectTokenPage: FC<SwapFormTypeProps>;
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Container } from '@mui/material';
|
|
3
3
|
import { useLayoutEffect, useRef, useState } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { ChainSelect } from '../../components/ChainSelect';
|
|
5
5
|
import { TokenList } from '../../components/TokenList';
|
|
6
|
-
import { useContentHeight, useScrollableOverflowHidden } from '../../hooks';
|
|
7
|
-
import { ChainSelect } from './ChainSelect';
|
|
6
|
+
import { useContentHeight, useNavigateBack, useScrollableOverflowHidden, } from '../../hooks';
|
|
8
7
|
import { SearchTokenInput } from './SearchTokenInput';
|
|
9
|
-
export const SelectTokenPage = ({ formType
|
|
8
|
+
export const SelectTokenPage = ({ formType }) => {
|
|
10
9
|
useScrollableOverflowHidden();
|
|
11
|
-
const
|
|
10
|
+
const { navigateBack } = useNavigateBack();
|
|
12
11
|
const headerRef = useRef(null);
|
|
13
12
|
const contentHeight = useContentHeight();
|
|
14
13
|
const [headerHeight, setHeaderHeight] = useState(0);
|
|
15
|
-
const handleTokenClick = () => {
|
|
16
|
-
navigate(-1);
|
|
17
|
-
};
|
|
18
14
|
useLayoutEffect(() => {
|
|
19
15
|
var _a, _b;
|
|
20
16
|
setHeaderHeight(contentHeight - ((_b = (_a = headerRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) !== null && _b !== void 0 ? _b : 0));
|
|
21
17
|
}, [contentHeight]);
|
|
22
|
-
return (_jsxs(Container, Object.assign({ disableGutters: true }, { children: [_jsxs(Box, Object.assign({ pt: 1, pb: 2, px: 3, ref: headerRef }, { children: [_jsx(ChainSelect, { formType: formType }), _jsx(Box, Object.assign({ mt: 2 }, { children: _jsx(SearchTokenInput, {}) }))] })), _jsx(TokenList, { height: headerHeight, onClick:
|
|
18
|
+
return (_jsxs(Container, Object.assign({ disableGutters: true }, { children: [_jsxs(Box, Object.assign({ pt: 1, pb: 2, px: 3, ref: headerRef }, { children: [_jsx(ChainSelect, { formType: formType }), _jsx(Box, Object.assign({ mt: 2 }, { children: _jsx(SearchTokenInput, {}) }))] })), _jsx(TokenList, { height: headerHeight, onClick: navigateBack, formType: formType })] })));
|
|
23
19
|
};
|
|
@@ -12,20 +12,20 @@ import { supportedWallets } from '@lifi/wallet-management';
|
|
|
12
12
|
import { Avatar, Button, Container, DialogActions, DialogContent, DialogContentText, List, ListItemAvatar, } from '@mui/material';
|
|
13
13
|
import { useCallback, useState } from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
|
-
import { useNavigate } from 'react-router-dom';
|
|
16
15
|
import { Dialog } from '../../components/Dialog';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
16
|
+
import { useNavigateBack } from '../../hooks';
|
|
17
|
+
import { useWallet } from '../../providers';
|
|
18
|
+
import { ListItemButton, ListItemText } from './SelectWalletPage.style';
|
|
19
19
|
export const SelectWalletPage = () => {
|
|
20
20
|
var _a;
|
|
21
21
|
const { t } = useTranslation();
|
|
22
|
-
const
|
|
22
|
+
const { navigateBack } = useNavigateBack();
|
|
23
23
|
const { connect } = useWallet();
|
|
24
24
|
const [walletIdentity, setWalletIdentity] = useState({ show: false });
|
|
25
25
|
const closeDialog = () => {
|
|
26
26
|
setWalletIdentity((state) => (Object.assign(Object.assign({}, state), { show: false })));
|
|
27
27
|
};
|
|
28
|
-
const handleConnect = useCallback((
|
|
28
|
+
const handleConnect = useCallback((wallet) => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
29
|
const { ethereum } = window;
|
|
30
30
|
const identityCheckPassed = wallet.checkProviderIdentity({
|
|
31
31
|
provider: ethereum,
|
|
@@ -37,13 +37,13 @@ export const SelectWalletPage = () => {
|
|
|
37
37
|
});
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
navigateBack();
|
|
41
41
|
yield connect(wallet);
|
|
42
|
-
}), [connect,
|
|
42
|
+
}), [connect, navigateBack]);
|
|
43
43
|
return (_jsxs(Container, Object.assign({ disableGutters: true }, { children: [_jsx(List, Object.assign({ sx: {
|
|
44
|
-
paddingLeft:
|
|
45
|
-
paddingRight:
|
|
46
|
-
} }, { children: supportedWallets.map((wallet) => (_jsxs(
|
|
44
|
+
paddingLeft: 1.5,
|
|
45
|
+
paddingRight: 1.5,
|
|
46
|
+
} }, { children: supportedWallets.map((wallet) => (_jsxs(ListItemButton, Object.assign({ onClick: () => handleConnect(wallet), disableRipple: true }, { children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, Object.assign({ src: wallet.icon.src || wallet.icon, alt: wallet.name }, { children: wallet.name[0] })) }), _jsx(ListItemText, { primary: wallet.name })] }), wallet.name))) })), _jsxs(Dialog, Object.assign({ open: walletIdentity.show, onClose: closeDialog }, { children: [_jsx(DialogContent, { children: _jsx(DialogContentText, { children: t('wallet.extensionNotFound', {
|
|
47
47
|
name: (_a = walletIdentity.wallet) === null || _a === void 0 ? void 0 : _a.name,
|
|
48
48
|
}) }) }), _jsx(DialogActions, { children: _jsx(Button, Object.assign({ onClick: closeDialog, autoFocus: true }, { children: t('button.ok') })) })] }))] })));
|
|
49
49
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const ListItemButton: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemButtonBaseProps & Omit<{
|
|
3
3
|
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
4
4
|
centerRipple?: boolean | undefined;
|
|
5
5
|
children?: import("react").ReactNode;
|
|
@@ -18,29 +18,4 @@ export declare const WalletListItemButton: import("@emotion/styled").StyledCompo
|
|
|
18
18
|
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
19
19
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
20
20
|
}, "className" | "style" | "classes" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "autoFocus" | "dense" | "divider" | "selected" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
21
|
-
export declare const
|
|
22
|
-
button?: false | undefined;
|
|
23
|
-
} & import("@mui/material").ListItemBaseProps & {
|
|
24
|
-
components?: {
|
|
25
|
-
Root?: import("react").ElementType<any> | undefined;
|
|
26
|
-
} | undefined;
|
|
27
|
-
componentsProps?: {
|
|
28
|
-
root?: (import("react").HTMLAttributes<HTMLDivElement> & import("@mui/material").ListItemComponentsPropsOverrides) | undefined;
|
|
29
|
-
} | undefined;
|
|
30
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "key" | keyof import("react").LiHTMLAttributes<HTMLLIElement>> & {
|
|
31
|
-
ref?: ((instance: HTMLLIElement | null) => void) | import("react").RefObject<HTMLLIElement> | null | undefined;
|
|
32
|
-
}, "button" | "className" | "style" | "classes" | "children" | "disabled" | "sx" | "alignItems" | "autoFocus" | "dense" | "divider" | "components" | "componentsProps" | "selected" | "disableGutters" | "ContainerComponent" | "ContainerProps" | "disablePadding" | "secondaryAction"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
33
|
-
export declare const WalletListItemText: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemTextProps<import("react").ElementType<any>, import("react").ElementType<any>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
34
|
-
export declare const WalletIdentityPopoverContent: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
35
|
-
align?: "inherit" | "left" | "right" | "center" | "justify" | undefined;
|
|
36
|
-
children?: import("react").ReactNode;
|
|
37
|
-
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
38
|
-
gutterBottom?: boolean | undefined;
|
|
39
|
-
noWrap?: boolean | undefined;
|
|
40
|
-
paragraph?: boolean | undefined;
|
|
41
|
-
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
42
|
-
variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)" | undefined;
|
|
43
|
-
variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)", string>> | undefined;
|
|
44
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & {
|
|
45
|
-
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
46
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("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") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
21
|
+
export declare const ListItemText: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemTextProps<import("react").ElementType<any>, import("react").ElementType<any>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,27 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { listItemSecondaryActionClasses } from '@mui/material/ListItemSecondaryAction';
|
|
1
|
+
import { ListItemButton as MuiListItemButton, ListItemText as MuiListItemText, } from '@mui/material';
|
|
3
2
|
import { listItemTextClasses } from '@mui/material/ListItemText';
|
|
4
3
|
import { styled } from '@mui/material/styles';
|
|
5
4
|
import { getContrastAlphaColor } from '../../utils';
|
|
6
|
-
export const
|
|
5
|
+
export const ListItemButton = styled(MuiListItemButton)(({ theme }) => ({
|
|
7
6
|
borderRadius: theme.shape.borderRadiusSecondary,
|
|
8
7
|
paddingLeft: theme.spacing(1.5),
|
|
9
|
-
height:
|
|
8
|
+
height: 56,
|
|
10
9
|
'&:hover': {
|
|
11
10
|
backgroundColor: getContrastAlphaColor(theme, '4%'),
|
|
12
11
|
},
|
|
13
12
|
}));
|
|
14
|
-
export const
|
|
15
|
-
padding: theme.spacing(1.5),
|
|
16
|
-
[`.${listItemSecondaryActionClasses.root}`]: {
|
|
17
|
-
right: theme.spacing(3),
|
|
18
|
-
},
|
|
19
|
-
}));
|
|
20
|
-
export const WalletListItemText = styled(ListItemText)(({ theme }) => ({
|
|
13
|
+
export const ListItemText = styled(MuiListItemText)(({ theme }) => ({
|
|
21
14
|
[`.${listItemTextClasses.primary}`]: {
|
|
22
15
|
fontWeight: 400,
|
|
23
16
|
},
|
|
24
17
|
}));
|
|
25
|
-
export const WalletIdentityPopoverContent = styled(Typography)({
|
|
26
|
-
maxWidth: 400,
|
|
27
|
-
});
|
|
@@ -12,9 +12,9 @@ export const AdvancedPreferences = () => {
|
|
|
12
12
|
const handleAdvancedPreferences = (_, checked) => {
|
|
13
13
|
setValue('advancedPreferences', checked);
|
|
14
14
|
};
|
|
15
|
-
return (_jsxs(Box, Object.assign({ px: 3, pt:
|
|
15
|
+
return (_jsxs(Box, Object.assign({ px: 3, pt: 2 }, { children: [_jsxs(Box, Object.assign({ sx: {
|
|
16
16
|
display: 'flex',
|
|
17
17
|
justifyContent: 'space-between',
|
|
18
18
|
alignItems: 'center',
|
|
19
|
-
} }, { children: [_jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: _jsx(Typography, Object.assign({ variant: "subtitle1", color: "text.primary", lineHeight: "normal" }, { children: t(`settings.advancedPreferences`) })) })), _jsx(Switch, { checked: advancedPreferences, onChange: handleAdvancedPreferences })] })), advancedPreferences && (_jsxs(Box, Object.assign({ mt:
|
|
19
|
+
} }, { children: [_jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: _jsx(Typography, Object.assign({ variant: "subtitle1", color: "text.primary", lineHeight: "normal" }, { children: t(`settings.advancedPreferences`) })) })), _jsx(Switch, { checked: advancedPreferences, onChange: handleAdvancedPreferences })] })), advancedPreferences && (_jsxs(Box, Object.assign({ mt: 2, mb: 1 }, { children: [_jsx(EnabledBridgesSelect, {}), _jsx(Box, Object.assign({ mt: 2 }, { children: _jsx(EnabledExchangesSelect, {}) }))] })))] })));
|
|
20
20
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Brightness4 as Brightness4Icon, DarkMode as DarkModeIcon, LightMode as LightModeIcon, } from '@mui/icons-material';
|
|
3
3
|
import { Box, ToggleButtonGroup } from '@mui/material';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { useWidgetConfig } from '../../providers
|
|
5
|
+
import { useWidgetConfig } from '../../providers';
|
|
6
6
|
import { useAppearance } from '../../stores';
|
|
7
7
|
import { ToggleButton } from './ColorSchemeButtonGroup.style';
|
|
8
8
|
export const ColorSchemeButtonGroup = () => {
|
|
@@ -11,7 +11,7 @@ export declare const ToggleButton: import("@emotion/styled").StyledComponent<{
|
|
|
11
11
|
selected?: boolean | undefined;
|
|
12
12
|
size?: "small" | "medium" | "large" | undefined;
|
|
13
13
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
14
|
-
value:
|
|
14
|
+
value: {};
|
|
15
15
|
} & Omit<{
|
|
16
16
|
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
17
17
|
centerRipple?: boolean | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';
|
|
3
|
-
import { Box, Chip, FormControl, MenuItem, Skeleton } from '@mui/material';
|
|
3
|
+
import { Box, Checkbox, Chip, FormControl, MenuItem, Skeleton, } from '@mui/material';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import shallow from 'zustand/shallow';
|
|
6
6
|
import { Card, CardTitle } from '../../components/Card';
|
|
@@ -8,16 +8,13 @@ import { Select } from '../../components/Select';
|
|
|
8
8
|
import { useTools } from '../../hooks';
|
|
9
9
|
import { useSettingsStore } from '../../stores';
|
|
10
10
|
export const EnabledBridgesSelect = () => {
|
|
11
|
-
var _a;
|
|
12
11
|
const { t } = useTranslation();
|
|
13
12
|
const { tools, formattedTools } = useTools();
|
|
14
13
|
const [enabledBridges, setTools] = useSettingsStore((state) => [state.enabledBridges, state.setTools], shallow);
|
|
15
|
-
return (tools === null || tools === void 0 ? void 0 : tools.bridges.length) ? (_jsxs(Card, { children: [_jsx(CardTitle, { children: t(`settings.enabledBridges`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Select, Object.assign({ multiple: true, placeholder: t(`settings.selectEnabledBridges`), MenuProps: { elevation: 2 }, IconComponent: KeyboardArrowDownIcon, value: enabledBridges !== null && enabledBridges !== void 0 ? enabledBridges : [], onChange: (event) => {
|
|
16
|
-
|
|
17
|
-
setTools('Bridges', event.target.value, tools.bridges);
|
|
18
|
-
}
|
|
14
|
+
return (tools === null || tools === void 0 ? void 0 : tools.bridges.length) ? (_jsxs(Card, { children: [_jsx(CardTitle, { children: t(`settings.enabledBridges`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Select, Object.assign({ multiple: true, placeholder: t(`settings.selectEnabledBridges`), MenuProps: { elevation: 2, PaperProps: { sx: { maxHeight: 320 } } }, IconComponent: KeyboardArrowDownIcon, value: enabledBridges !== null && enabledBridges !== void 0 ? enabledBridges : [], onChange: (event) => {
|
|
15
|
+
setTools('Bridges', event.target.value, tools.bridges);
|
|
19
16
|
}, renderValue: (selected) => (_jsx(Box, Object.assign({ sx: { display: 'flex', flexWrap: 'wrap', gap: 0.5 } }, { children: selected.map((value) => {
|
|
20
17
|
var _a, _b, _c;
|
|
21
18
|
return (_jsx(Chip, { label: (_c = (_b = (_a = formattedTools.bridges) === null || _a === void 0 ? void 0 : _a[value]) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : value }, value));
|
|
22
|
-
}) }))) }, { children: (
|
|
19
|
+
}) }))) }, { children: tools.bridges.map((bridge) => (_jsxs(MenuItem, Object.assign({ value: bridge.key, sx: { paddingTop: 0, paddingBottom: 0 } }, { children: [_jsx(Checkbox, { checked: enabledBridges === null || enabledBridges === void 0 ? void 0 : enabledBridges.includes(bridge.key) }), bridge.name] }), bridge.key))) })) }))] })) : (_jsx(Skeleton, { variant: "rectangular", width: "100%", height: 134, sx: { borderRadius: 1 } }));
|
|
23
20
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';
|
|
3
|
-
import { Box, Chip, FormControl, MenuItem, Skeleton } from '@mui/material';
|
|
3
|
+
import { Box, Checkbox, Chip, FormControl, MenuItem, Skeleton, } from '@mui/material';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import shallow from 'zustand/shallow';
|
|
6
6
|
import { Card, CardTitle } from '../../components/Card';
|
|
@@ -12,11 +12,9 @@ export const EnabledExchangesSelect = () => {
|
|
|
12
12
|
const { tools, formattedTools } = useTools();
|
|
13
13
|
const [enabledExchanges, setTools] = useSettingsStore((state) => [state.enabledExchanges, state.setTools], shallow);
|
|
14
14
|
return (tools === null || tools === void 0 ? void 0 : tools.exchanges.length) ? (_jsxs(Card, { children: [_jsx(CardTitle, { children: t(`settings.enabledExchanges`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Select, Object.assign({ multiple: true, placeholder: t(`settings.selectEnabledExchanges`), value: enabledExchanges !== null && enabledExchanges !== void 0 ? enabledExchanges : [], onChange: (event) => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
}, MenuProps: { elevation: 2 }, IconComponent: KeyboardArrowDownIcon, renderValue: (selected) => (_jsx(Box, Object.assign({ sx: { display: 'flex', flexWrap: 'wrap', gap: 0.5 } }, { children: selected.map((value) => {
|
|
15
|
+
setTools('Exchanges', event.target.value, tools.exchanges);
|
|
16
|
+
}, MenuProps: { elevation: 2, PaperProps: { sx: { maxHeight: 320 } } }, IconComponent: KeyboardArrowDownIcon, renderValue: (selected) => (_jsx(Box, Object.assign({ sx: { display: 'flex', flexWrap: 'wrap', gap: 0.5 } }, { children: selected.map((value) => {
|
|
19
17
|
var _a, _b, _c;
|
|
20
18
|
return (_jsx(Chip, { label: (_c = (_b = (_a = formattedTools.exchanges) === null || _a === void 0 ? void 0 : _a[value]) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : value }, value));
|
|
21
|
-
}) }))) }, { children: tools
|
|
19
|
+
}) }))) }, { children: tools.exchanges.map((exchange) => (_jsxs(MenuItem, Object.assign({ value: exchange.key, sx: { paddingTop: 0, paddingBottom: 0 } }, { children: [_jsx(Checkbox, { checked: enabledExchanges === null || enabledExchanges === void 0 ? void 0 : enabledExchanges.includes(exchange.key) }), exchange.name] }), exchange.key))) })) }))] })) : (_jsx(Skeleton, { variant: "rectangular", width: "100%", height: 206, sx: { borderRadius: 1 } }));
|
|
22
20
|
};
|
|
@@ -10,5 +10,9 @@ export const RoutePrioritySelect = () => {
|
|
|
10
10
|
const { t } = useTranslation();
|
|
11
11
|
const [setValue] = useSetSettings();
|
|
12
12
|
const { routePriority } = useSettings(['routePriority']);
|
|
13
|
-
return (_jsxs(Card, { children: [_jsx(CardTitle, { children: t(`settings.routePriority`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Select, Object.assign({ MenuProps: { elevation: 2 }, value: routePriority, onChange: (event) => setValue('routePriority', event.target.value), IconComponent: KeyboardArrowDownIcon, dense: true }, { children: Orders.map((order) =>
|
|
13
|
+
return (_jsxs(Card, { children: [_jsx(CardTitle, { children: t(`settings.routePriority`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Select, Object.assign({ MenuProps: { elevation: 2 }, value: routePriority, onChange: (event) => setValue('routePriority', event.target.value), IconComponent: KeyboardArrowDownIcon, dense: true }, { children: Orders.map((order) => {
|
|
14
|
+
const tag = t(`swap.tags.${order.toUpperCase()}`);
|
|
15
|
+
const tagName = `${tag[0]}${tag.slice(1).toLowerCase()}`;
|
|
16
|
+
return (_jsx(MenuItem, Object.assign({ value: order }, { children: tagName }), order));
|
|
17
|
+
}) })) }))] }));
|
|
14
18
|
};
|
|
@@ -4,7 +4,8 @@ import { AdvancedPreferences } from './AdvancedPreferences';
|
|
|
4
4
|
import { ColorSchemeButtonGroup } from './ColorSchemeButtonGroup';
|
|
5
5
|
import { GasPriceSelect } from './GasPriceSelect';
|
|
6
6
|
import { RoutePrioritySelect } from './RoutePrioritySelect';
|
|
7
|
+
import { ShowDestinationWallet } from './ShowDestinationWallet';
|
|
7
8
|
import { SlippageInput } from './SlippageInput';
|
|
8
9
|
export const SettingsPage = () => {
|
|
9
|
-
return (_jsxs(Container, Object.assign({ disableGutters: true }, { children: [_jsxs(Box, Object.assign({ px: 3, pt: 1 }, { children: [_jsx(ColorSchemeButtonGroup, {}), _jsx(RoutePrioritySelect, {}), _jsxs(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' }, mt: 2 }, { children: [_jsx(Box, Object.assign({ pr: 2, flex: 1 }, { children: _jsx(SlippageInput, {}) })), _jsx(GasPriceSelect, {})] }))] })), _jsx(AdvancedPreferences, {})] })));
|
|
10
|
+
return (_jsxs(Container, Object.assign({ disableGutters: true }, { children: [_jsxs(Box, Object.assign({ px: 3, pt: 1 }, { children: [_jsx(ColorSchemeButtonGroup, {}), _jsx(RoutePrioritySelect, {}), _jsxs(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' }, mt: 2 }, { children: [_jsx(Box, Object.assign({ pr: 2, flex: 1 }, { children: _jsx(SlippageInput, {}) })), _jsx(GasPriceSelect, {})] }))] })), _jsx(ShowDestinationWallet, {}), _jsx(AdvancedPreferences, {})] })));
|
|
10
11
|
};
|