@rango-dev/widget-embedded 0.17.1-next.3 → 0.17.1-next.31
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 +370 -56
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
- 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/LoadingSwapDetails/LoadingSwapDetailStep.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +1727 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.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 +633 -3
- 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/Quote/QuoteSummary.styles.d.ts +157 -0
- package/dist/components/Quote/QuoteSummary.styles.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/SwapDetails/SwapDetails.styles.d.ts +628 -0
- package/dist/components/SwapDetails/SwapDetails.styles.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 +157 -0
- 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 +942 -0
- 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.styles.ts +2 -2
- package/src/components/BlockchainList/BlockchainList.tsx +4 -4
- package/src/components/BlockchainsSection/BlockchainsSection.tsx +4 -4
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +12 -6
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +20 -21
- 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/LoadingSwapDetails/LoadingSwapDetailStep.tsx +14 -7
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +63 -60
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +17 -8
- 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 +42 -12
- package/src/components/Quote/Quote.tsx +106 -37
- package/src/components/Quote/Quote.types.ts +0 -1
- package/src/components/Quote/QuoteSkeleton.tsx +1 -1
- package/src/components/Quote/QuoteSummary.styles.ts +9 -8
- package/src/components/Quote/QuoteSummary.tsx +2 -2
- 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 +5 -7
- package/src/components/SwapDetails/SwapDetails.helpers.tsx +1 -1
- package/src/components/SwapDetails/SwapDetails.styles.ts +37 -33
- package/src/components/SwapDetails/SwapDetails.tsx +33 -45
- 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 +10 -1
- package/src/components/SwapsGroup/SwapsGroup.tsx +3 -5
- package/src/components/TokenList/TokenList.helpers.ts +2 -2
- package/src/components/TokenList/TokenList.styles.ts +58 -37
- package/src/components/TokenList/TokenList.tsx +28 -23
- 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 +61 -41
- 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
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { styled } from '@rango-dev/ui';
|
|
1
|
+
import { ImageContainer, styled } from '@rango-dev/ui';
|
|
2
2
|
|
|
3
3
|
export const Container = styled('div', {
|
|
4
4
|
display: 'flex',
|
|
@@ -12,7 +12,7 @@ export const List = styled('ul', {
|
|
|
12
12
|
listStyle: 'none',
|
|
13
13
|
overflowY: 'auto',
|
|
14
14
|
paddingRight: '$5',
|
|
15
|
-
|
|
15
|
+
[`& ${ImageContainer}`]: {
|
|
16
16
|
borderRadius: '$xm',
|
|
17
17
|
overflow: 'hidden',
|
|
18
18
|
},
|
|
@@ -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}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as Collapsible from '@radix-ui/react-collapsible';
|
|
2
2
|
import {
|
|
3
3
|
Button,
|
|
4
|
+
css,
|
|
4
5
|
darkTheme,
|
|
5
6
|
IconButton,
|
|
6
7
|
keyframes,
|
|
@@ -110,12 +111,13 @@ export const NavigateBack = styled(IconButton, {
|
|
|
110
111
|
|
|
111
112
|
export const WalletsContainer = styled('div', {
|
|
112
113
|
paddingTop: '$20',
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
export const walletsListStyles = css({
|
|
117
|
+
display: 'grid',
|
|
118
|
+
gap: '$10',
|
|
119
|
+
gridTemplateColumns: ' repeat(3, minmax(0, 1fr))',
|
|
120
|
+
alignContent: 'baseline',
|
|
119
121
|
});
|
|
120
122
|
|
|
121
123
|
export const CollapsibleRoot = styled(Collapsible.Root, {
|
|
@@ -171,6 +173,10 @@ export const CustomDestination = styled('div', {
|
|
|
171
173
|
'& .alarms': { paddingTop: '5px' },
|
|
172
174
|
});
|
|
173
175
|
|
|
176
|
+
export const alarmsStyles = css({
|
|
177
|
+
paddingTop: '5px',
|
|
178
|
+
});
|
|
179
|
+
|
|
174
180
|
export const ExpandedIcon = styled('div', {
|
|
175
181
|
transition: `all ${EXPANDABLE_TRANSITION_DURATION}ms ease`,
|
|
176
182
|
variants: {
|
|
@@ -19,15 +19,16 @@ 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';
|
|
30
30
|
import {
|
|
31
|
+
alarmsStyles,
|
|
31
32
|
CollapsibleContent,
|
|
32
33
|
CollapsibleRoot,
|
|
33
34
|
ConfirmButton,
|
|
@@ -43,6 +44,7 @@ import {
|
|
|
43
44
|
Trigger,
|
|
44
45
|
Wallets,
|
|
45
46
|
WalletsContainer,
|
|
47
|
+
walletsListStyles,
|
|
46
48
|
} from './ConfirmWallets.styles';
|
|
47
49
|
import { WalletList } from './WalletList';
|
|
48
50
|
|
|
@@ -50,8 +52,9 @@ const NUMBER_OF_WALLETS_TO_DISPLAY = 2;
|
|
|
50
52
|
|
|
51
53
|
export function ConfirmWalletsModal(props: PropTypes) {
|
|
52
54
|
//TODO: move component's logics to a custom hook
|
|
53
|
-
const { open, onClose, onCancel, onCheckBalance,
|
|
54
|
-
const
|
|
55
|
+
const { open, onClose, onCancel, onCheckBalance, loading } = props;
|
|
56
|
+
const config = useAppStore().config;
|
|
57
|
+
const blockchains = useAppStore().blockchains();
|
|
55
58
|
const {
|
|
56
59
|
quote,
|
|
57
60
|
setSelectedWallets: selectQuoteWallets,
|
|
@@ -75,10 +78,6 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
75
78
|
const customDestinationRef = useRef<HTMLDivElement | null>(null);
|
|
76
79
|
|
|
77
80
|
const requiredWallets = getRequiredWallets(quote);
|
|
78
|
-
const customDestinationEnabled =
|
|
79
|
-
typeof config?.customDestination === 'undefined'
|
|
80
|
-
? true
|
|
81
|
-
: config.customDestination;
|
|
82
81
|
|
|
83
82
|
const lastStepToBlockchain = blockchains.find(
|
|
84
83
|
(blockchain) =>
|
|
@@ -247,7 +246,8 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
247
246
|
open={open}
|
|
248
247
|
onClose={() => {
|
|
249
248
|
if (!quoteWalletsConfirmed) {
|
|
250
|
-
|
|
249
|
+
const home = '../';
|
|
250
|
+
navigate(home, { replace: true });
|
|
251
251
|
}
|
|
252
252
|
onClose();
|
|
253
253
|
}}
|
|
@@ -288,7 +288,12 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
288
288
|
<Typography variant="headline" size="small">
|
|
289
289
|
{i18n.t({
|
|
290
290
|
id: 'Your {blockchainName} wallets',
|
|
291
|
-
values: {
|
|
291
|
+
values: {
|
|
292
|
+
blockchainName: getBlockchainShortNameFor(
|
|
293
|
+
showMoreWalletFor,
|
|
294
|
+
blockchains
|
|
295
|
+
),
|
|
296
|
+
},
|
|
292
297
|
})}
|
|
293
298
|
</Typography>
|
|
294
299
|
</ShowMoreHeader>
|
|
@@ -315,14 +320,11 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
315
320
|
</Modal>
|
|
316
321
|
{showMoreWalletFor && (
|
|
317
322
|
<WalletsContainer>
|
|
318
|
-
<div className=
|
|
323
|
+
<div className={walletsListStyles()}>
|
|
319
324
|
<WalletList
|
|
320
325
|
chain={showMoreWalletFor}
|
|
321
326
|
isSelected={isSelected}
|
|
322
327
|
selectWallet={onChange}
|
|
323
|
-
multiWallets={config?.multiWallets ?? true}
|
|
324
|
-
supportedWallets={config?.wallets ?? []}
|
|
325
|
-
config={config}
|
|
326
328
|
onShowMore={setShowMoreWalletFor.bind(null, showMoreWalletFor)}
|
|
327
329
|
/>
|
|
328
330
|
</div>
|
|
@@ -361,7 +363,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
361
363
|
<Typography variant="title" size="xmedium">
|
|
362
364
|
{i18n.t({
|
|
363
365
|
id: 'Your {blockchainName} wallets',
|
|
364
|
-
values: { blockchainName: blockchain?.
|
|
366
|
+
values: { blockchainName: blockchain?.shortName },
|
|
365
367
|
})}
|
|
366
368
|
</Typography>
|
|
367
369
|
<Typography
|
|
@@ -370,7 +372,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
370
372
|
size="medium">
|
|
371
373
|
{i18n.t({
|
|
372
374
|
id: 'You need to connect a {blockchainName} wallet.',
|
|
373
|
-
values: { blockchainName: blockchain?.
|
|
375
|
+
values: { blockchainName: blockchain?.shortName },
|
|
374
376
|
})}
|
|
375
377
|
</Typography>
|
|
376
378
|
</Title>
|
|
@@ -380,9 +382,6 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
380
382
|
chain={requiredWallet}
|
|
381
383
|
isSelected={isSelected}
|
|
382
384
|
selectWallet={onChange}
|
|
383
|
-
multiWallets={config?.multiWallets ?? true}
|
|
384
|
-
supportedWallets={config?.wallets ?? []}
|
|
385
|
-
config={config}
|
|
386
385
|
limit={NUMBER_OF_WALLETS_TO_DISPLAY}
|
|
387
386
|
onShowMore={() =>
|
|
388
387
|
setShowMoreWalletFor(blockchain?.name ?? '')
|
|
@@ -390,7 +389,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
390
389
|
/>
|
|
391
390
|
</ListContainer>
|
|
392
391
|
{!isLastWallet && <Divider size={32} />}
|
|
393
|
-
{isLastWallet &&
|
|
392
|
+
{isLastWallet && config?.customDestination && (
|
|
394
393
|
<CustomDestination>
|
|
395
394
|
<CollapsibleRoot
|
|
396
395
|
ref={customDestinationRef}
|
|
@@ -461,7 +460,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
461
460
|
</CollapsibleContent>
|
|
462
461
|
</CollapsibleRoot>
|
|
463
462
|
{isAddressMatched && (
|
|
464
|
-
<div className=
|
|
463
|
+
<div className={alarmsStyles()}>
|
|
465
464
|
<Alert
|
|
466
465
|
variant="alarm"
|
|
467
466
|
type="error"
|
|
@@ -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;
|
|
@@ -3,35 +3,42 @@ import type { StepSkeletonPropsTypes } from './LoadingSwapDetails.types';
|
|
|
3
3
|
import { ChainToken, Divider, NextIcon, Skeleton } from '@rango-dev/ui';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
extraInfoStyles,
|
|
8
|
+
StepContainer,
|
|
9
|
+
stepIconStyles,
|
|
10
|
+
stepInfoStyles,
|
|
11
|
+
stepTitleStyles,
|
|
12
|
+
stepTokensStyles,
|
|
13
|
+
} from './LoadingSwapDetails.styles';
|
|
7
14
|
|
|
8
15
|
export function LoadingSwapDetailStep(props: StepSkeletonPropsTypes) {
|
|
9
16
|
const { extraInfo } = props;
|
|
10
17
|
return (
|
|
11
18
|
<StepContainer>
|
|
12
|
-
<div className=
|
|
19
|
+
<div className={stepTitleStyles()}>
|
|
13
20
|
<Skeleton height={28} width={28} variant="circular" />
|
|
14
21
|
<Divider direction="horizontal" size={8} />
|
|
15
22
|
<Skeleton height={15} width={148} variant="rounded" />
|
|
16
23
|
</div>
|
|
17
|
-
<div className=
|
|
24
|
+
<div className={stepTokensStyles()}>
|
|
18
25
|
<Divider direction="horizontal" size={20} />
|
|
19
|
-
<div className=
|
|
26
|
+
<div className={stepInfoStyles()}>
|
|
20
27
|
<ChainToken size="small" loading chainImage="" tokenImage="" />
|
|
21
28
|
<Divider direction="horizontal" size={8} />
|
|
22
29
|
<Skeleton height={12} width={76} variant="rounded" />
|
|
23
30
|
</div>
|
|
24
|
-
<div className=
|
|
31
|
+
<div className={stepIconStyles()}>
|
|
25
32
|
<NextIcon color="gray" size={16} />
|
|
26
33
|
</div>
|
|
27
|
-
<div className=
|
|
34
|
+
<div className={stepInfoStyles()}>
|
|
28
35
|
<ChainToken size="small" loading chainImage="" tokenImage="" />
|
|
29
36
|
<Divider direction="horizontal" size={8} />
|
|
30
37
|
<Skeleton height={12} width={76} variant="rounded" />
|
|
31
38
|
</div>
|
|
32
39
|
</div>
|
|
33
40
|
{extraInfo && (
|
|
34
|
-
<div className=
|
|
41
|
+
<div className={extraInfoStyles()}>
|
|
35
42
|
<Divider direction="horizontal" size={20} />
|
|
36
43
|
<Skeleton height={22} width={297} variant="rectangular" />
|
|
37
44
|
</div>
|