@rango-dev/widget-embedded 0.17.1-next.3 → 0.17.1-next.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/QueueManager.d.ts +5 -2
- package/dist/QueueManager.d.ts.map +1 -1
- package/dist/components/AppRouter.d.ts +0 -2
- package/dist/components/AppRouter.d.ts.map +1 -1
- package/dist/components/AppRoutes.d.ts +1 -6
- package/dist/components/AppRoutes.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +56 -56
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +0 -2
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +1 -4
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -1
- package/dist/components/Layout/Layout.d.ts.map +1 -1
- package/dist/components/Layout/Layout.types.d.ts +2 -2
- package/dist/components/Layout/Layout.types.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
- package/dist/components/Quote/Quote.d.ts.map +1 -1
- package/dist/components/Quote/Quote.styles.d.ts +159 -0
- package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.types.d.ts +0 -1
- package/dist/components/Quote/Quote.types.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +1 -0
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +1 -1
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -1
- package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -1
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.helpers.d.ts +2 -2
- package/dist/components/TokenList/TokenList.helpers.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.types.d.ts +3 -9
- package/dist/components/TokenList/TokenList.types.d.ts.map +1 -1
- package/dist/components/TokenList/index.d.ts +0 -1
- package/dist/components/TokenList/index.d.ts.map +1 -1
- package/dist/components/UpdateUrl.d.ts +1 -6
- package/dist/components/UpdateUrl.d.ts.map +1 -1
- package/dist/components/WidgetEvents.d.ts.map +1 -1
- package/dist/constants/errors.d.ts.map +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/navigationRoutes.d.ts +1 -2
- package/dist/constants/navigationRoutes.d.ts.map +1 -1
- package/dist/constants/searchParams.d.ts +2 -1
- package/dist/constants/searchParams.d.ts.map +1 -1
- package/dist/containers/App/App.d.ts +3 -0
- package/dist/containers/App/App.d.ts.map +1 -0
- package/dist/containers/App/App.styles.d.ts +158 -0
- package/dist/containers/App/App.styles.d.ts.map +1 -0
- package/dist/containers/App/index.d.ts +2 -0
- package/dist/containers/App/index.d.ts.map +1 -0
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +316 -0
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +3 -0
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
- package/dist/containers/Wallets/Wallets.d.ts +6 -0
- package/dist/containers/Wallets/Wallets.d.ts.map +1 -0
- package/dist/containers/Wallets/Wallets.types.d.ts +11 -0
- package/dist/containers/Wallets/Wallets.types.d.ts.map +1 -0
- package/dist/containers/Wallets/index.d.ts +2 -0
- package/dist/containers/Wallets/index.d.ts.map +1 -0
- package/dist/containers/Widget/Widget.d.ts +5 -0
- package/dist/containers/Widget/Widget.d.ts.map +1 -0
- package/dist/containers/Widget/Widget.types.d.ts +5 -0
- package/dist/containers/Widget/Widget.types.d.ts.map +1 -0
- package/dist/containers/Widget/index.d.ts +3 -0
- package/dist/containers/Widget/index.d.ts.map +1 -0
- package/dist/containers/WidgetInfo/WidgetInfo.d.ts +6 -0
- package/dist/containers/WidgetInfo/WidgetInfo.d.ts.map +1 -0
- package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts +20 -0
- package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts.map +1 -0
- package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts +21 -0
- package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts.map +1 -0
- package/dist/containers/WidgetInfo/index.d.ts +2 -0
- package/dist/containers/WidgetInfo/index.d.ts.map +1 -0
- package/dist/containers/WidgetProvider/WidgetProvider.d.ts +5 -0
- package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +1 -0
- package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts +7 -0
- package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts.map +1 -0
- package/dist/containers/WidgetProvider/index.d.ts +2 -0
- package/dist/containers/WidgetProvider/index.d.ts.map +1 -0
- package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts.map +1 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts +6 -3
- package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts.map +1 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts +1 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts.map +1 -1
- package/dist/hooks/useForceAutoConnect.d.ts +2 -0
- package/dist/hooks/useForceAutoConnect.d.ts.map +1 -0
- package/dist/hooks/useLanguage.d.ts +1 -1
- package/dist/hooks/useLanguage.d.ts.map +1 -1
- package/dist/hooks/useNavigateBack.d.ts +1 -3
- package/dist/hooks/useNavigateBack.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.d.ts +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts +2 -2
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts +3 -5
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts +1 -0
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts +5 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts.map +1 -1
- package/dist/hooks/useSwapInput.d.ts.map +1 -1
- package/dist/hooks/useSyncStoresWithConfig.d.ts +1 -2
- package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/hooks/useWalletList.d.ts.map +1 -1
- package/dist/index.d.ts +20 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/pages/ConfirmSwapPage.d.ts +1 -6
- package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
- package/dist/pages/HistoryPage.d.ts.map +1 -1
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/pages/LanguagePage.d.ts.map +1 -1
- package/dist/pages/LiquiditySourcePage.d.ts +1 -2
- package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
- package/dist/pages/SelectBlockchainPage.d.ts.map +1 -1
- package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -1
- package/dist/pages/SettingsPage.d.ts +1 -6
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
- package/dist/pages/ThemePage.d.ts.map +1 -1
- package/dist/pages/WalletsPage.d.ts +1 -8
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/AppStore.d.ts +47 -0
- package/dist/store/AppStore.d.ts.map +1 -0
- package/dist/store/app.d.ts +41 -22
- package/dist/store/app.d.ts.map +1 -1
- package/dist/store/notification.d.ts +4 -3
- package/dist/store/notification.d.ts.map +1 -1
- package/dist/store/quote.d.ts +23 -16
- package/dist/store/quote.d.ts.map +1 -1
- package/dist/store/slices/config.d.ts +3 -2
- package/dist/store/slices/config.d.ts.map +1 -1
- package/dist/store/slices/data.d.ts +3 -0
- package/dist/store/slices/data.d.ts.map +1 -1
- package/dist/store/slices/settings.d.ts +39 -0
- package/dist/store/slices/settings.d.ts.map +1 -0
- package/dist/store/ui.d.ts +2 -1
- package/dist/store/ui.d.ts.map +1 -1
- package/dist/store/wallets.d.ts +14 -9
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/types/config.d.ts +38 -5
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/swap.d.ts +4 -14
- package/dist/types/swap.d.ts.map +1 -1
- package/dist/types/wallets.d.ts +15 -1
- package/dist/types/wallets.d.ts.map +1 -1
- package/dist/utils/colors.d.ts.map +1 -1
- package/dist/utils/configs.d.ts +1 -0
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/utils/meta.d.ts +2 -1
- package/dist/utils/meta.d.ts.map +1 -1
- package/dist/utils/providers.d.ts +2 -2
- package/dist/utils/providers.d.ts.map +1 -1
- package/dist/utils/queue.d.ts +2 -2
- package/dist/utils/queue.d.ts.map +1 -1
- package/dist/utils/quote.d.ts +1 -1
- package/dist/utils/quote.d.ts.map +1 -1
- package/dist/utils/settings.d.ts +6 -2
- package/dist/utils/settings.d.ts.map +1 -1
- package/dist/utils/swap.d.ts +16 -7
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/time.d.ts +1 -1
- package/dist/utils/time.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +7 -9
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +12 -10
- package/src/QueueManager.tsx +18 -17
- package/src/components/AppRouter.tsx +8 -32
- package/src/components/AppRoutes.tsx +57 -69
- package/src/components/BlockchainList/BlockchainList.tsx +4 -4
- package/src/components/BlockchainsSection/BlockchainsSection.tsx +4 -4
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +16 -19
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +0 -2
- package/src/components/ConfirmWalletsModal/WalletList.tsx +6 -5
- package/src/components/ConfirmWalletsModal/WalletList.type.ts +1 -4
- package/src/components/HeaderButtons/HomeButtons.tsx +28 -18
- package/src/components/Layout/Layout.tsx +20 -7
- package/src/components/Layout/Layout.types.ts +2 -2
- package/src/components/NoResult/NoResult.helpers.ts +12 -12
- package/src/components/NoResult/NoResult.tsx +6 -6
- package/src/components/NotificationContent/NotificationContent.tsx +5 -3
- package/src/components/Quote/Quote.styles.ts +28 -1
- package/src/components/Quote/Quote.tsx +100 -34
- package/src/components/Quote/Quote.types.ts +0 -1
- package/src/components/Quote/QuoteSkeleton.tsx +1 -1
- package/src/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.tsx +1 -1
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +11 -4
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts +8 -1
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +13 -13
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +1 -0
- package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +3 -3
- package/src/components/Slippage/Slippage.tsx +3 -5
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +0 -4
- package/src/components/SwapDetails/SwapDetails.helpers.tsx +1 -1
- package/src/components/SwapDetails/SwapDetails.tsx +19 -39
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +4 -3
- package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +2 -2
- package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +1 -1
- package/src/components/SwapsGroup/SwapsGroup.styles.ts +8 -1
- package/src/components/SwapsGroup/SwapsGroup.tsx +0 -2
- package/src/components/TokenList/TokenList.helpers.ts +2 -2
- package/src/components/TokenList/TokenList.styles.ts +14 -2
- package/src/components/TokenList/TokenList.tsx +16 -19
- package/src/components/TokenList/TokenList.types.ts +3 -10
- package/src/components/TokenList/index.ts +0 -1
- package/src/components/UpdateUrl.tsx +23 -18
- package/src/components/WidgetEvents.tsx +4 -2
- package/src/constants/errors.ts +9 -5
- package/src/constants/index.ts +1 -0
- package/src/constants/navigationRoutes.ts +7 -8
- package/src/constants/searchParams.ts +1 -0
- package/src/containers/App/App.styles.ts +18 -0
- package/src/containers/App/App.tsx +52 -0
- package/src/containers/App/index.ts +1 -0
- package/src/containers/QuoteInfo/QuoteInfo.styles.ts +17 -1
- package/src/containers/QuoteInfo/QuoteInfo.tsx +44 -43
- package/src/containers/QuoteInfo/QuoteInfo.types.ts +3 -0
- package/src/{Wallets.tsx → containers/Wallets/Wallets.tsx} +48 -34
- package/src/containers/Wallets/Wallets.types.ts +12 -0
- package/src/containers/Wallets/index.ts +1 -0
- package/src/containers/Widget/Widget.tsx +19 -0
- package/src/containers/Widget/Widget.types.ts +5 -0
- package/src/containers/Widget/index.ts +2 -0
- package/src/containers/WidgetInfo/WidgetInfo.helpers.ts +64 -0
- package/src/containers/WidgetInfo/WidgetInfo.tsx +62 -0
- package/src/containers/WidgetInfo/WidgetInfo.types.ts +21 -0
- package/src/containers/WidgetInfo/index.ts +1 -0
- package/src/containers/WidgetProvider/WidgetProvider.tsx +28 -0
- package/src/containers/WidgetProvider/WidgetProvider.types.ts +7 -0
- package/src/containers/WidgetProvider/index.ts +1 -0
- package/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts +15 -11
- package/src/hooks/useConfirmSwap/useConfirmSwap.ts +25 -24
- package/src/hooks/useConfirmSwap/useConfirmSwap.types.ts +1 -1
- package/src/hooks/useForceAutoConnect.ts +27 -0
- package/src/hooks/useLanguage.ts +4 -5
- package/src/hooks/useNavigateBack.ts +3 -52
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.ts +1 -1
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.ts +37 -7
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.ts +60 -0
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.test.ts +78 -3
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.ts +15 -6
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.ts +6 -1
- package/src/hooks/useSwapInput.ts +89 -30
- package/src/hooks/useSyncStoresWithConfig.ts +38 -22
- package/src/hooks/useTheme.ts +4 -5
- package/src/hooks/useWalletList.ts +3 -5
- package/src/index.ts +53 -5
- package/src/pages/ConfirmSwapPage.tsx +39 -24
- package/src/pages/HistoryPage.tsx +2 -7
- package/src/pages/Home.tsx +58 -88
- package/src/pages/LanguagePage.tsx +0 -5
- package/src/pages/LiquiditySourcePage.tsx +24 -37
- package/src/pages/SelectBlockchainPage.tsx +28 -21
- package/src/pages/SelectSwapItemsPage.tsx +10 -27
- package/src/pages/SettingsPage.tsx +28 -24
- package/src/pages/SwapDetailsPage.tsx +6 -7
- package/src/pages/ThemePage.tsx +2 -7
- package/src/pages/WalletsPage.tsx +4 -15
- package/src/services/httpService.ts +1 -1
- package/src/store/AppStore.tsx +41 -0
- package/src/store/app.ts +44 -6
- package/src/store/quote.ts +29 -26
- package/src/store/slices/config.ts +25 -15
- package/src/store/slices/data.ts +64 -29
- package/src/store/slices/settings.ts +168 -0
- package/src/store/wallets.ts +68 -37
- package/src/types/config.ts +50 -5
- package/src/types/swap.ts +4 -13
- package/src/types/wallets.ts +18 -1
- package/src/utils/colors.ts +2 -1
- package/src/utils/configs.ts +2 -1
- package/src/utils/date.ts +1 -1
- package/src/utils/meta.ts +8 -1
- package/src/utils/providers.ts +8 -5
- package/src/utils/queue.ts +2 -2
- package/src/utils/quote.ts +7 -7
- package/src/utils/settings.ts +17 -10
- package/src/utils/swap.ts +59 -55
- package/src/utils/time.ts +1 -1
- package/src/utils/wallets.ts +107 -149
- package/dist/Wallets.d.ts +0 -17
- package/dist/Wallets.d.ts.map +0 -1
- package/dist/Widget.d.ts +0 -9
- package/dist/Widget.d.ts.map +0 -1
- package/dist/store/meta.d.ts +0 -23
- package/dist/store/meta.d.ts.map +0 -1
- package/dist/store/settings.d.ts +0 -81
- package/dist/store/settings.d.ts.map +0 -1
- package/src/Widget.tsx +0 -119
- package/src/store/meta.ts +0 -39
- package/src/store/settings.ts +0 -158
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { WidgetConfig } from '../types';
|
|
2
|
-
|
|
3
1
|
import React from 'react';
|
|
4
2
|
import { useRoutes } from 'react-router-dom';
|
|
5
3
|
|
|
@@ -16,15 +14,7 @@ import { SwapDetailsPage } from '../pages/SwapDetailsPage';
|
|
|
16
14
|
import { ThemePage } from '../pages/ThemePage';
|
|
17
15
|
import { WalletsPage } from '../pages/WalletsPage';
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
interface PropTypes {
|
|
22
|
-
config?: WidgetConfig;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function AppRoutes(props: PropTypes) {
|
|
26
|
-
const { config } = props;
|
|
27
|
-
|
|
17
|
+
export function AppRoutes() {
|
|
28
18
|
return useRoutes([
|
|
29
19
|
{
|
|
30
20
|
path: navigationRoutes.home,
|
|
@@ -32,77 +22,75 @@ export function AppRoutes(props: PropTypes) {
|
|
|
32
22
|
},
|
|
33
23
|
{
|
|
34
24
|
path: navigationRoutes.fromSwap,
|
|
35
|
-
|
|
25
|
+
children: [
|
|
26
|
+
{
|
|
27
|
+
index: true,
|
|
28
|
+
element: <SelectSwapItemsPage type="source" />,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
path: navigationRoutes.blockchains,
|
|
32
|
+
element: <SelectBlockchainPage type="source" />,
|
|
33
|
+
},
|
|
34
|
+
],
|
|
36
35
|
},
|
|
37
36
|
{
|
|
38
37
|
path: navigationRoutes.toSwap,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
children: [
|
|
39
|
+
{
|
|
40
|
+
index: true,
|
|
41
|
+
element: <SelectSwapItemsPage type="destination" />,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
path: navigationRoutes.blockchains,
|
|
45
|
+
element: <SelectBlockchainPage type="destination" />,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
path: navigationRoutes.settings,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
sourceType="
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
),
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
path: navigationRoutes.bridges,
|
|
77
|
-
element: (
|
|
78
|
-
<LiquiditySourcePage
|
|
79
|
-
sourceType="Bridges"
|
|
80
|
-
supportedSwappers={config?.liquiditySources}
|
|
81
|
-
/>
|
|
82
|
-
),
|
|
51
|
+
children: [
|
|
52
|
+
{
|
|
53
|
+
index: true,
|
|
54
|
+
element: <SettingsPage />,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
path: navigationRoutes.themes,
|
|
58
|
+
element: <ThemePage />,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
path: navigationRoutes.languages,
|
|
62
|
+
element: <LanguagePage />,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
path: navigationRoutes.exchanges,
|
|
66
|
+
element: <LiquiditySourcePage sourceType="Exchanges" />,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
path: navigationRoutes.bridges,
|
|
70
|
+
element: <LiquiditySourcePage sourceType="Bridges" />,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
83
73
|
},
|
|
84
|
-
{ path: navigationRoutes.swaps, element: <HistoryPage /> },
|
|
85
74
|
{
|
|
86
|
-
path: navigationRoutes.
|
|
87
|
-
|
|
75
|
+
path: navigationRoutes.swaps,
|
|
76
|
+
children: [
|
|
77
|
+
{
|
|
78
|
+
index: true,
|
|
79
|
+
element: <HistoryPage />,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
path: navigationRoutes.swapDetails,
|
|
83
|
+
element: <SwapDetailsPage />,
|
|
84
|
+
},
|
|
85
|
+
],
|
|
88
86
|
},
|
|
89
87
|
{
|
|
90
88
|
path: navigationRoutes.wallets,
|
|
91
|
-
element:
|
|
92
|
-
<WalletsPage
|
|
93
|
-
supportedWallets={config?.wallets}
|
|
94
|
-
multiWallets={
|
|
95
|
-
typeof config?.multiWallets === 'undefined'
|
|
96
|
-
? true
|
|
97
|
-
: config.multiWallets
|
|
98
|
-
}
|
|
99
|
-
config={config}
|
|
100
|
-
/>
|
|
101
|
-
),
|
|
89
|
+
element: <WalletsPage />,
|
|
102
90
|
},
|
|
103
91
|
{
|
|
104
|
-
path:
|
|
105
|
-
element: <ConfirmSwapPage
|
|
92
|
+
path: navigationRoutes.confirmSwap,
|
|
93
|
+
element: <ConfirmSwapPage />,
|
|
106
94
|
},
|
|
107
95
|
]);
|
|
108
96
|
}
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from '@rango-dev/ui';
|
|
12
12
|
import React, { useEffect, useState } from 'react';
|
|
13
13
|
|
|
14
|
-
import {
|
|
14
|
+
import { useAppStore } from '../../store/AppStore';
|
|
15
15
|
|
|
16
16
|
import { filterBlockchains } from './BlockchainList.helpers';
|
|
17
17
|
import { Container, List } from './BlockchainList.styles';
|
|
@@ -20,7 +20,7 @@ import { LoadingBlockchainList } from './LoadingBlockchainList';
|
|
|
20
20
|
export function BlockchainList(props: PropTypes) {
|
|
21
21
|
const { list, searchedFor, onChange, blockchainCategory } = props;
|
|
22
22
|
const [blockchains, setBlockchains] = useState<BlockchainMeta[]>(list);
|
|
23
|
-
const
|
|
23
|
+
const { fetchStatus } = useAppStore();
|
|
24
24
|
|
|
25
25
|
useEffect(() => {
|
|
26
26
|
setBlockchains([
|
|
@@ -66,8 +66,8 @@ export function BlockchainList(props: PropTypes) {
|
|
|
66
66
|
{i18n.t('Select Blockchain')}
|
|
67
67
|
</Typography>
|
|
68
68
|
<Divider size={4} />
|
|
69
|
-
{
|
|
70
|
-
{
|
|
69
|
+
{fetchStatus === 'loading' && <LoadingBlockchainList />}
|
|
70
|
+
{fetchStatus === 'success' && renderList()}
|
|
71
71
|
</Container>
|
|
72
72
|
);
|
|
73
73
|
}
|
|
@@ -13,7 +13,7 @@ import React from 'react';
|
|
|
13
13
|
|
|
14
14
|
import { BLOCKCHAIN_LIST_SIZE } from '../../constants/configs';
|
|
15
15
|
import { usePrepareBlockchainList } from '../../hooks/usePrepareBlockchainList';
|
|
16
|
-
import {
|
|
16
|
+
import { useAppStore } from '../../store/AppStore';
|
|
17
17
|
import { useQuoteStore } from '../../store/quote';
|
|
18
18
|
|
|
19
19
|
import { Container } from './BlockchainsSection.styles';
|
|
@@ -27,7 +27,7 @@ export function BlockchainsSection(props: PropTypes) {
|
|
|
27
27
|
selected: blockchain?.name,
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
const
|
|
30
|
+
const { fetchStatus } = useAppStore();
|
|
31
31
|
const resetToBlockchain = useQuoteStore.use.resetToBlockchain();
|
|
32
32
|
const resetFromBlockchain = useQuoteStore.use.resetFromBlockchain();
|
|
33
33
|
const hasMoreItemsInList = blockchainsList.more.length > 0;
|
|
@@ -45,11 +45,11 @@ export function BlockchainsSection(props: PropTypes) {
|
|
|
45
45
|
</Typography>
|
|
46
46
|
<Divider size={12} />
|
|
47
47
|
<Container>
|
|
48
|
-
{
|
|
48
|
+
{fetchStatus === 'loading' &&
|
|
49
49
|
Array.from(Array(NUMBER_OF_LOADING), (e) => (
|
|
50
50
|
<Skeleton key={e} variant="rounded" height={50} />
|
|
51
51
|
))}
|
|
52
|
-
{
|
|
52
|
+
{fetchStatus === 'success' && (
|
|
53
53
|
<>
|
|
54
54
|
<BlockchainsChip
|
|
55
55
|
selected={!blockchain}
|
|
@@ -19,11 +19,11 @@ import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
|
19
19
|
import { useNavigate } from 'react-router-dom';
|
|
20
20
|
|
|
21
21
|
import { getQuoteErrorMessage } from '../../constants/errors';
|
|
22
|
-
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
23
22
|
import { getQuoteUpdateWarningMessage } from '../../constants/warnings';
|
|
24
|
-
import {
|
|
23
|
+
import { useAppStore } from '../../store/AppStore';
|
|
25
24
|
import { useQuoteStore } from '../../store/quote';
|
|
26
25
|
import { useWalletsStore } from '../../store/wallets';
|
|
26
|
+
import { getBlockchainShortNameFor } from '../../utils/meta';
|
|
27
27
|
import { confirmSwapDisabled } from '../../utils/swap';
|
|
28
28
|
|
|
29
29
|
import { getRequiredWallets, isValidAddress } from './ConfirmWallets.helpers';
|
|
@@ -50,8 +50,9 @@ const NUMBER_OF_WALLETS_TO_DISPLAY = 2;
|
|
|
50
50
|
|
|
51
51
|
export function ConfirmWalletsModal(props: PropTypes) {
|
|
52
52
|
//TODO: move component's logics to a custom hook
|
|
53
|
-
const { open, onClose, onCancel, onCheckBalance,
|
|
54
|
-
const
|
|
53
|
+
const { open, onClose, onCancel, onCheckBalance, loading } = props;
|
|
54
|
+
const config = useAppStore().config;
|
|
55
|
+
const blockchains = useAppStore().blockchains();
|
|
55
56
|
const {
|
|
56
57
|
quote,
|
|
57
58
|
setSelectedWallets: selectQuoteWallets,
|
|
@@ -75,10 +76,6 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
75
76
|
const customDestinationRef = useRef<HTMLDivElement | null>(null);
|
|
76
77
|
|
|
77
78
|
const requiredWallets = getRequiredWallets(quote);
|
|
78
|
-
const customDestinationEnabled =
|
|
79
|
-
typeof config?.customDestination === 'undefined'
|
|
80
|
-
? true
|
|
81
|
-
: config.customDestination;
|
|
82
79
|
|
|
83
80
|
const lastStepToBlockchain = blockchains.find(
|
|
84
81
|
(blockchain) =>
|
|
@@ -247,7 +244,8 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
247
244
|
open={open}
|
|
248
245
|
onClose={() => {
|
|
249
246
|
if (!quoteWalletsConfirmed) {
|
|
250
|
-
|
|
247
|
+
const home = '../';
|
|
248
|
+
navigate(home, { replace: true });
|
|
251
249
|
}
|
|
252
250
|
onClose();
|
|
253
251
|
}}
|
|
@@ -288,7 +286,12 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
288
286
|
<Typography variant="headline" size="small">
|
|
289
287
|
{i18n.t({
|
|
290
288
|
id: 'Your {blockchainName} wallets',
|
|
291
|
-
values: {
|
|
289
|
+
values: {
|
|
290
|
+
blockchainName: getBlockchainShortNameFor(
|
|
291
|
+
showMoreWalletFor,
|
|
292
|
+
blockchains
|
|
293
|
+
),
|
|
294
|
+
},
|
|
292
295
|
})}
|
|
293
296
|
</Typography>
|
|
294
297
|
</ShowMoreHeader>
|
|
@@ -320,9 +323,6 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
320
323
|
chain={showMoreWalletFor}
|
|
321
324
|
isSelected={isSelected}
|
|
322
325
|
selectWallet={onChange}
|
|
323
|
-
multiWallets={config?.multiWallets ?? true}
|
|
324
|
-
supportedWallets={config?.wallets ?? []}
|
|
325
|
-
config={config}
|
|
326
326
|
onShowMore={setShowMoreWalletFor.bind(null, showMoreWalletFor)}
|
|
327
327
|
/>
|
|
328
328
|
</div>
|
|
@@ -361,7 +361,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
361
361
|
<Typography variant="title" size="xmedium">
|
|
362
362
|
{i18n.t({
|
|
363
363
|
id: 'Your {blockchainName} wallets',
|
|
364
|
-
values: { blockchainName: blockchain?.
|
|
364
|
+
values: { blockchainName: blockchain?.shortName },
|
|
365
365
|
})}
|
|
366
366
|
</Typography>
|
|
367
367
|
<Typography
|
|
@@ -370,7 +370,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
370
370
|
size="medium">
|
|
371
371
|
{i18n.t({
|
|
372
372
|
id: 'You need to connect a {blockchainName} wallet.',
|
|
373
|
-
values: { blockchainName: blockchain?.
|
|
373
|
+
values: { blockchainName: blockchain?.shortName },
|
|
374
374
|
})}
|
|
375
375
|
</Typography>
|
|
376
376
|
</Title>
|
|
@@ -380,9 +380,6 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
380
380
|
chain={requiredWallet}
|
|
381
381
|
isSelected={isSelected}
|
|
382
382
|
selectWallet={onChange}
|
|
383
|
-
multiWallets={config?.multiWallets ?? true}
|
|
384
|
-
supportedWallets={config?.wallets ?? []}
|
|
385
|
-
config={config}
|
|
386
383
|
limit={NUMBER_OF_WALLETS_TO_DISPLAY}
|
|
387
384
|
onShowMore={() =>
|
|
388
385
|
setShowMoreWalletFor(blockchain?.name ?? '')
|
|
@@ -390,7 +387,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
390
387
|
/>
|
|
391
388
|
</ListContainer>
|
|
392
389
|
{!isLastWallet && <Divider size={32} />}
|
|
393
|
-
{isLastWallet &&
|
|
390
|
+
{isLastWallet && config?.customDestination && (
|
|
394
391
|
<CustomDestination>
|
|
395
392
|
<CollapsibleRoot
|
|
396
393
|
ref={customDestinationRef}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { WidgetConfig } from '../..';
|
|
2
1
|
import type { ConfirmSwap } from '../../hooks/useConfirmSwap/useConfirmSwap.types';
|
|
3
2
|
|
|
4
3
|
export type PropTypes = {
|
|
@@ -6,6 +5,5 @@ export type PropTypes = {
|
|
|
6
5
|
onClose: () => void;
|
|
7
6
|
onCancel: () => void;
|
|
8
7
|
onCheckBalance: ConfirmSwap['fetch'];
|
|
9
|
-
config?: WidgetConfig;
|
|
10
8
|
loading: boolean;
|
|
11
9
|
};
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
TIME_TO_CLOSE_MODAL,
|
|
24
24
|
TIME_TO_IGNORE_MODAL,
|
|
25
25
|
} from '../../pages/WalletsPage';
|
|
26
|
-
import {
|
|
26
|
+
import { useAppStore } from '../../store/AppStore';
|
|
27
27
|
import { useWalletsStore } from '../../store/wallets';
|
|
28
28
|
import { getBlockchainDisplayNameFor } from '../../utils/meta';
|
|
29
29
|
import {
|
|
@@ -41,10 +41,11 @@ import {
|
|
|
41
41
|
} from './WalletList.styles';
|
|
42
42
|
|
|
43
43
|
export function WalletList(props: PropTypes) {
|
|
44
|
-
const {
|
|
44
|
+
const { chain, isSelected, selectWallet, limit, onShowMore } = props;
|
|
45
|
+
const { config } = useAppStore();
|
|
45
46
|
|
|
46
47
|
const connectedWallets = useWalletsStore.use.connectedWallets();
|
|
47
|
-
const { blockchains } =
|
|
48
|
+
const { blockchains } = useAppStore();
|
|
48
49
|
const [openWalletStateModal, setOpenWalletStateModal] =
|
|
49
50
|
useState<WalletType>('');
|
|
50
51
|
const [experimentalChainWallet, setExperimentalChainWallet] =
|
|
@@ -137,7 +138,7 @@ export function WalletList(props: PropTypes) {
|
|
|
137
138
|
});
|
|
138
139
|
const conciseAddress = address ? getConciseAddress(address) : '';
|
|
139
140
|
|
|
140
|
-
const experimentalChain = isExperimentalChain(blockchains, chain);
|
|
141
|
+
const experimentalChain = isExperimentalChain(blockchains(), chain);
|
|
141
142
|
|
|
142
143
|
const experimentalChainNotAdded = !connectedWallets.find(
|
|
143
144
|
(connectedWallet) =>
|
|
@@ -180,7 +181,7 @@ export function WalletList(props: PropTypes) {
|
|
|
180
181
|
experimentalChainWallet?.chain
|
|
181
182
|
? getBlockchainDisplayNameFor(
|
|
182
183
|
experimentalChainWallet.chain,
|
|
183
|
-
blockchains
|
|
184
|
+
blockchains()
|
|
184
185
|
)
|
|
185
186
|
: undefined;
|
|
186
187
|
return (
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import type { Wallet
|
|
1
|
+
import type { Wallet } from '../../types';
|
|
2
2
|
|
|
3
3
|
export type PropTypes = {
|
|
4
4
|
chain: string;
|
|
5
|
-
supportedWallets: WidgetConfig['wallets'];
|
|
6
5
|
isSelected: (walletType: string, chain: string) => boolean;
|
|
7
6
|
selectWallet: (wallet: Wallet) => void;
|
|
8
|
-
multiWallets: boolean;
|
|
9
|
-
config?: WidgetConfig;
|
|
10
7
|
limit?: number;
|
|
11
8
|
onShowMore: () => void;
|
|
12
9
|
};
|
|
@@ -11,7 +11,9 @@ import {
|
|
|
11
11
|
} from '@rango-dev/ui';
|
|
12
12
|
import React from 'react';
|
|
13
13
|
|
|
14
|
+
import { useAppStore } from '../../store/AppStore';
|
|
14
15
|
import { getContainer } from '../../utils/common';
|
|
16
|
+
import { isFeatureHidden } from '../../utils/settings';
|
|
15
17
|
import { NotificationContent } from '../NotificationContent';
|
|
16
18
|
|
|
17
19
|
import { HeaderButton } from './HeaderButtons.styles';
|
|
@@ -26,6 +28,12 @@ export function HomeButtons(props: HomeButtonsPropTypes) {
|
|
|
26
28
|
onClickNotifications,
|
|
27
29
|
} = props;
|
|
28
30
|
|
|
31
|
+
const {
|
|
32
|
+
config: { features },
|
|
33
|
+
} = useAppStore();
|
|
34
|
+
|
|
35
|
+
const isNotificationsHidden = isFeatureHidden('notification', features);
|
|
36
|
+
|
|
29
37
|
return (
|
|
30
38
|
<>
|
|
31
39
|
<Tooltip
|
|
@@ -41,25 +49,27 @@ export function HomeButtons(props: HomeButtonsPropTypes) {
|
|
|
41
49
|
</HeaderButton>
|
|
42
50
|
</Tooltip>
|
|
43
51
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
side="top"
|
|
47
|
-
content={i18n.t('Notifications')}>
|
|
48
|
-
<Popover
|
|
49
|
-
align="center"
|
|
50
|
-
collisionBoundary={layoutRef}
|
|
51
|
-
collisionPadding={{ right: 20, left: 20 }}
|
|
52
|
+
{!isNotificationsHidden && (
|
|
53
|
+
<Tooltip
|
|
52
54
|
container={getContainer()}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
side="top"
|
|
56
|
+
content={i18n.t('Notifications')}>
|
|
57
|
+
<Popover
|
|
58
|
+
align="center"
|
|
59
|
+
collisionBoundary={layoutRef}
|
|
60
|
+
collisionPadding={{ right: 20, left: 20 }}
|
|
61
|
+
container={getContainer()}
|
|
62
|
+
content={<NotificationContent />}>
|
|
63
|
+
<HeaderButton
|
|
64
|
+
size="small"
|
|
65
|
+
variant="ghost"
|
|
66
|
+
onClick={onClickNotifications}>
|
|
67
|
+
<NotificationsIcon size={18} color="black" />
|
|
68
|
+
<UnreadNotificationsBadge />
|
|
69
|
+
</HeaderButton>
|
|
70
|
+
</Popover>
|
|
71
|
+
</Tooltip>
|
|
72
|
+
)}
|
|
63
73
|
<Tooltip
|
|
64
74
|
container={getContainer()}
|
|
65
75
|
side="top"
|
|
@@ -3,12 +3,13 @@ import type { PropsWithChildren } from 'react';
|
|
|
3
3
|
|
|
4
4
|
import { BottomLogo, Divider, Header } from '@rango-dev/ui';
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { useNavigate } from 'react-router-dom';
|
|
7
6
|
|
|
8
|
-
import {
|
|
7
|
+
import { useNavigateBack } from '../../hooks/useNavigateBack';
|
|
8
|
+
import { useAppStore } from '../../store/AppStore';
|
|
9
9
|
import { useUiStore } from '../../store/ui';
|
|
10
10
|
import { useWalletsStore } from '../../store/wallets';
|
|
11
11
|
import { getContainer } from '../../utils/common';
|
|
12
|
+
import { isFeatureHidden } from '../../utils/settings';
|
|
12
13
|
import { BackButton, CancelButton, WalletButton } from '../HeaderButtons';
|
|
13
14
|
|
|
14
15
|
import { Container, Content, Footer } from './Layout.styles';
|
|
@@ -23,25 +24,37 @@ function LayoutComponent(props: PropsWithChildren<PropTypes>, ref: Ref) {
|
|
|
23
24
|
fixedHeight = true,
|
|
24
25
|
} = props;
|
|
25
26
|
const connectedWallets = useWalletsStore.use.connectedWallets();
|
|
27
|
+
const {
|
|
28
|
+
config: { features },
|
|
29
|
+
} = useAppStore();
|
|
30
|
+
|
|
31
|
+
const isConnectWalletHidden = isFeatureHidden(
|
|
32
|
+
'connectWalletButton',
|
|
33
|
+
features
|
|
34
|
+
);
|
|
26
35
|
|
|
27
36
|
const connectWalletsButtonDisabled =
|
|
28
37
|
useUiStore.use.connectWalletsButtonDisabled();
|
|
29
|
-
const
|
|
38
|
+
const navigateBack = useNavigateBack();
|
|
30
39
|
|
|
31
40
|
const onConnectWallet = () => {
|
|
32
|
-
if (!connectWalletsButtonDisabled) {
|
|
33
|
-
|
|
41
|
+
if (!connectWalletsButtonDisabled && header.onWallet) {
|
|
42
|
+
header.onWallet();
|
|
34
43
|
}
|
|
35
44
|
};
|
|
45
|
+
|
|
46
|
+
const showBackButton =
|
|
47
|
+
typeof header.hasBackButton === 'undefined' || header.hasBackButton;
|
|
48
|
+
|
|
36
49
|
return (
|
|
37
50
|
<Container ref={ref} fixedHeight={fixedHeight} id="swap-box">
|
|
38
51
|
<Header
|
|
39
|
-
prefix={<>{
|
|
52
|
+
prefix={<>{showBackButton && <BackButton onClick={navigateBack} />}</>}
|
|
40
53
|
title={header.title}
|
|
41
54
|
suffix={
|
|
42
55
|
<>
|
|
43
56
|
{header.suffix}
|
|
44
|
-
{header.
|
|
57
|
+
{header.onWallet && !isConnectWalletHidden && (
|
|
45
58
|
<WalletButton
|
|
46
59
|
container={getContainer()}
|
|
47
60
|
onClick={onConnectWallet}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export interface PropTypes {
|
|
2
2
|
header: {
|
|
3
3
|
title: string;
|
|
4
|
-
|
|
4
|
+
onWallet?: () => void;
|
|
5
5
|
hasSettings?: boolean;
|
|
6
6
|
suffix?: React.ReactNode;
|
|
7
|
-
|
|
7
|
+
hasBackButton?: boolean;
|
|
8
8
|
onCancel?: () => void;
|
|
9
9
|
};
|
|
10
10
|
hasLogo?: boolean;
|
|
@@ -27,18 +27,6 @@ export function makeInfo(
|
|
|
27
27
|
},
|
|
28
28
|
description: '',
|
|
29
29
|
};
|
|
30
|
-
} else if (
|
|
31
|
-
error?.type === QuoteErrorType.NO_RESULT &&
|
|
32
|
-
error.diagnosisMessage
|
|
33
|
-
) {
|
|
34
|
-
return {
|
|
35
|
-
alert: {
|
|
36
|
-
type: 'error',
|
|
37
|
-
text: error.diagnosisMessage,
|
|
38
|
-
action: null,
|
|
39
|
-
},
|
|
40
|
-
description: '',
|
|
41
|
-
};
|
|
42
30
|
} else if (disabledLiquiditySources.length) {
|
|
43
31
|
return {
|
|
44
32
|
alert: {
|
|
@@ -51,6 +39,18 @@ export function makeInfo(
|
|
|
51
39
|
},
|
|
52
40
|
description: errorMessages().liquiditySourcesError.description,
|
|
53
41
|
};
|
|
42
|
+
} else if (
|
|
43
|
+
error?.type === QuoteErrorType.NO_RESULT &&
|
|
44
|
+
error.diagnosisMessage
|
|
45
|
+
) {
|
|
46
|
+
return {
|
|
47
|
+
alert: {
|
|
48
|
+
type: 'error',
|
|
49
|
+
text: error.diagnosisMessage,
|
|
50
|
+
action: null,
|
|
51
|
+
},
|
|
52
|
+
description: '',
|
|
53
|
+
};
|
|
54
54
|
}
|
|
55
55
|
return {
|
|
56
56
|
alert: null,
|
|
@@ -11,22 +11,22 @@ import {
|
|
|
11
11
|
import React from 'react';
|
|
12
12
|
|
|
13
13
|
import { errorMessages } from '../../constants/errors';
|
|
14
|
-
import {
|
|
14
|
+
import { useAppStore } from '../../store/AppStore';
|
|
15
15
|
|
|
16
16
|
import { makeInfo } from './NoResult.helpers';
|
|
17
17
|
import { Container, Footer, PrefixIcon } from './NoResult.styles';
|
|
18
18
|
|
|
19
19
|
export function NoResult(props: PropTypes) {
|
|
20
20
|
const { fetch, error } = props;
|
|
21
|
-
const disabledLiquiditySources =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const disabledLiquiditySources = useAppStore().disabledLiquiditySources;
|
|
22
|
+
const toggleAllLiquiditySources = useAppStore().toggleAllLiquiditySources;
|
|
23
|
+
|
|
24
|
+
const swappers = useAppStore().swappers();
|
|
25
25
|
|
|
26
26
|
const info = makeInfo(
|
|
27
27
|
error,
|
|
28
28
|
disabledLiquiditySources,
|
|
29
|
-
toggleAllLiquiditySources,
|
|
29
|
+
() => toggleAllLiquiditySources(swappers, true),
|
|
30
30
|
fetch
|
|
31
31
|
);
|
|
32
32
|
|
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { useNavigate } from 'react-router-dom';
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
14
|
+
import { useAppStore } from '../../store/AppStore';
|
|
14
15
|
import { useNotificationStore } from '../../store/notification';
|
|
15
16
|
import { useUiStore } from '../../store/ui';
|
|
16
17
|
|
|
@@ -26,14 +27,15 @@ export function NotificationContent() {
|
|
|
26
27
|
const { getUnreadNotifications } = useNotificationStore();
|
|
27
28
|
|
|
28
29
|
const notifications: Notification[] = getUnreadNotifications();
|
|
29
|
-
const
|
|
30
|
+
const blockchains = useAppStore().blockchains();
|
|
31
|
+
const tokens = useAppStore().tokens();
|
|
30
32
|
const sortedNotification = notifications
|
|
31
33
|
.sort((a, b) => b.creationTime - a.creationTime)
|
|
32
34
|
.slice(0, MAX_NOTIFICATIONS_DISPLAYED);
|
|
33
35
|
|
|
34
36
|
const handleOnClick = (requestId: Notification['requestId']) => {
|
|
35
37
|
setSelectedSwap(requestId);
|
|
36
|
-
navigate(
|
|
38
|
+
navigate(`${navigationRoutes.swaps}/${requestId}`);
|
|
37
39
|
};
|
|
38
40
|
|
|
39
41
|
return (
|