@rango-dev/widget-embedded 0.17.1-next.11 → 0.17.1-next.13
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/components/AppRoutes.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.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/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -1
- package/dist/components/UpdateUrl.d.ts.map +1 -1
- package/dist/constants/navigationRoutes.d.ts +1 -2
- package/dist/constants/navigationRoutes.d.ts.map +1 -1
- package/dist/hooks/useNavigateBack.d.ts +1 -3
- package/dist/hooks/useNavigateBack.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- 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.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.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.map +1 -1
- package/package.json +2 -2
- package/src/components/AppRoutes.tsx +54 -33
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +2 -2
- package/src/components/Layout/Layout.tsx +10 -7
- package/src/components/Layout/Layout.types.ts +2 -2
- package/src/components/NotificationContent/NotificationContent.tsx +1 -1
- package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +1 -1
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +0 -4
- package/src/components/SwapDetails/SwapDetails.tsx +2 -5
- package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +4 -3
- package/src/components/UpdateUrl.tsx +0 -3
- package/src/constants/navigationRoutes.ts +7 -8
- package/src/hooks/useNavigateBack.ts +3 -52
- package/src/pages/ConfirmSwapPage.tsx +10 -9
- package/src/pages/HistoryPage.tsx +1 -5
- package/src/pages/Home.tsx +6 -3
- package/src/pages/LanguagePage.tsx +0 -5
- package/src/pages/LiquiditySourcePage.tsx +0 -4
- package/src/pages/SelectBlockchainPage.tsx +2 -8
- package/src/pages/SelectSwapItemsPage.tsx +4 -18
- package/src/pages/SettingsPage.tsx +0 -3
- package/src/pages/SwapDetailsPage.tsx +3 -4
- package/src/pages/ThemePage.tsx +0 -4
- package/src/pages/WalletsPage.tsx +0 -4
|
@@ -5,7 +5,6 @@ import React, { useState } from 'react';
|
|
|
5
5
|
import { BlockchainList } from '../components/BlockchainList';
|
|
6
6
|
import { Layout } from '../components/Layout';
|
|
7
7
|
import { SearchInput } from '../components/SearchInput';
|
|
8
|
-
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
9
8
|
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
10
9
|
import { useAppStore } from '../store/AppStore';
|
|
11
10
|
import { useQuoteStore } from '../store/quote';
|
|
@@ -16,7 +15,7 @@ interface PropTypes {
|
|
|
16
15
|
|
|
17
16
|
export function SelectBlockchainPage(props: PropTypes) {
|
|
18
17
|
const { type } = props;
|
|
19
|
-
const
|
|
18
|
+
const navigateBack = useNavigateBack();
|
|
20
19
|
const [searchedFor, setSearchedFor] = useState<string>('');
|
|
21
20
|
const [blockchainCategory, setBlockchainCategory] = useState<string>('ALL');
|
|
22
21
|
const setToBlockchain = useQuoteStore.use.setToBlockchain();
|
|
@@ -26,14 +25,10 @@ export function SelectBlockchainPage(props: PropTypes) {
|
|
|
26
25
|
const blockchains = useAppStore().blockchains({
|
|
27
26
|
type: type,
|
|
28
27
|
});
|
|
29
|
-
const routeKey = type === 'source' ? 'fromBlockchain' : 'toBlockchain';
|
|
30
28
|
|
|
31
29
|
return (
|
|
32
30
|
<Layout
|
|
33
31
|
header={{
|
|
34
|
-
onBack: () => {
|
|
35
|
-
navigateBackFrom(navigationRoutes[routeKey]);
|
|
36
|
-
},
|
|
37
32
|
title: i18n.t(`Select Blockchain`),
|
|
38
33
|
}}>
|
|
39
34
|
<Divider size={12} />
|
|
@@ -66,8 +61,7 @@ export function SelectBlockchainPage(props: PropTypes) {
|
|
|
66
61
|
} else {
|
|
67
62
|
setToBlockchain(blockchain);
|
|
68
63
|
}
|
|
69
|
-
|
|
70
|
-
navigateBackFrom(navigationRoutes[routeKey]);
|
|
64
|
+
navigateBack();
|
|
71
65
|
}}
|
|
72
66
|
/>
|
|
73
67
|
</Layout>
|
|
@@ -23,7 +23,7 @@ interface PropTypes {
|
|
|
23
23
|
export function SelectSwapItemsPage(props: PropTypes) {
|
|
24
24
|
const { type } = props;
|
|
25
25
|
const navigate = useNavigate();
|
|
26
|
-
const
|
|
26
|
+
const navigateBack = useNavigateBack();
|
|
27
27
|
const {
|
|
28
28
|
fromBlockchain,
|
|
29
29
|
toBlockchain,
|
|
@@ -72,27 +72,13 @@ export function SelectSwapItemsPage(props: PropTypes) {
|
|
|
72
72
|
return (
|
|
73
73
|
<Layout
|
|
74
74
|
header={{
|
|
75
|
-
|
|
76
|
-
navigateBackFrom(
|
|
77
|
-
type === 'source'
|
|
78
|
-
? navigationRoutes.fromSwap
|
|
79
|
-
: navigationRoutes.toSwap
|
|
80
|
-
),
|
|
81
|
-
title: i18n.t('Swap {type}', {
|
|
82
|
-
type: type === 'source' ? 'from' : 'to',
|
|
83
|
-
}),
|
|
75
|
+
title: i18n.t('Swap {type}', { type }),
|
|
84
76
|
}}>
|
|
85
77
|
<BlockchainsSection
|
|
86
78
|
blockchains={blockchains}
|
|
87
79
|
type={type == 'source' ? 'from' : 'to'}
|
|
88
80
|
blockchain={type === 'source' ? fromBlockchain : toBlockchain}
|
|
89
|
-
onMoreClick={() =>
|
|
90
|
-
navigate(
|
|
91
|
-
type === 'source'
|
|
92
|
-
? navigationRoutes.fromBlockchain
|
|
93
|
-
: navigationRoutes.toBlockchain
|
|
94
|
-
)
|
|
95
|
-
}
|
|
81
|
+
onMoreClick={() => navigate(navigationRoutes.blockchains)}
|
|
96
82
|
onChange={(blockchain) => {
|
|
97
83
|
updateBlockchain(blockchain);
|
|
98
84
|
}}
|
|
@@ -123,7 +109,7 @@ export function SelectSwapItemsPage(props: PropTypes) {
|
|
|
123
109
|
updateBlockchain(tokenBlockchain);
|
|
124
110
|
}
|
|
125
111
|
|
|
126
|
-
|
|
112
|
+
navigateBack();
|
|
127
113
|
}}
|
|
128
114
|
/>
|
|
129
115
|
</Layout>
|
|
@@ -18,7 +18,6 @@ import { SettingsContainer } from '../components/SettingsContainer';
|
|
|
18
18
|
import { Slippage } from '../components/Slippage';
|
|
19
19
|
import { SlippageTooltipContainer as TooltipContainer } from '../components/Slippage/Slippage.styles';
|
|
20
20
|
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
21
|
-
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
22
21
|
import { useAppStore } from '../store/AppStore';
|
|
23
22
|
import { useSettingsStore } from '../store/settings';
|
|
24
23
|
import { getContainer } from '../utils/common';
|
|
@@ -29,7 +28,6 @@ export function SettingsPage() {
|
|
|
29
28
|
const { theme } = useAppStore().config;
|
|
30
29
|
const fetchStatus = useAppStore().fetchStatus;
|
|
31
30
|
const swappers = useAppStore().swappers();
|
|
32
|
-
const { navigateBackFrom } = useNavigateBack();
|
|
33
31
|
|
|
34
32
|
const infiniteApprove = useSettingsStore.use.infiniteApprove();
|
|
35
33
|
const toggleInfiniteApprove = useSettingsStore.use.toggleInfiniteApprove();
|
|
@@ -171,7 +169,6 @@ export function SettingsPage() {
|
|
|
171
169
|
return (
|
|
172
170
|
<Layout
|
|
173
171
|
header={{
|
|
174
|
-
onBack: () => navigateBackFrom(navigationRoutes.settings),
|
|
175
172
|
title: i18n.t('Setting'),
|
|
176
173
|
}}>
|
|
177
174
|
<SettingsContainer>
|
|
@@ -4,7 +4,6 @@ import React from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { SwapDetails } from '../components/SwapDetails';
|
|
6
6
|
import { SwapDetailsPlaceholder } from '../components/SwapDetails/SwapDetails.Placeholder';
|
|
7
|
-
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
8
7
|
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
9
8
|
import { useAppStore } from '../store/AppStore';
|
|
10
9
|
import { useUiStore } from '../store/ui';
|
|
@@ -15,7 +14,7 @@ export function SwapDetailsPage() {
|
|
|
15
14
|
const loading = !state.loadedFromPersistor;
|
|
16
15
|
const pendingSwaps = getPendingSwaps(manager);
|
|
17
16
|
const requestId = useUiStore.use.selectedSwapRequestId();
|
|
18
|
-
const
|
|
17
|
+
const navigateBack = useNavigateBack();
|
|
19
18
|
const { fetchStatus: fetchMetaStatus } = useAppStore();
|
|
20
19
|
|
|
21
20
|
const showSkeleton = loading || fetchMetaStatus === 'loading';
|
|
@@ -36,8 +35,8 @@ export function SwapDetailsPage() {
|
|
|
36
35
|
const onDelete = async () => {
|
|
37
36
|
if (selectedSwap?.id) {
|
|
38
37
|
try {
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
manager?.deleteQueue(selectedSwap.id);
|
|
39
|
+
navigateBack();
|
|
41
40
|
} catch (e) {
|
|
42
41
|
console.log(e);
|
|
43
42
|
}
|
package/src/pages/ThemePage.tsx
CHANGED
|
@@ -13,8 +13,6 @@ import React from 'react';
|
|
|
13
13
|
|
|
14
14
|
import { Layout } from '../components/Layout';
|
|
15
15
|
import { SettingsContainer } from '../components/SettingsContainer';
|
|
16
|
-
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
17
|
-
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
18
16
|
import { useSettingsStore } from '../store/settings';
|
|
19
17
|
|
|
20
18
|
type Theme = 'dark' | 'light' | 'auto';
|
|
@@ -26,7 +24,6 @@ enum Mode {
|
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
export function ThemePage() {
|
|
29
|
-
const { navigateBackFrom } = useNavigateBack();
|
|
30
27
|
const theme = useSettingsStore.use.theme();
|
|
31
28
|
const setTheme = useSettingsStore.use.setTheme();
|
|
32
29
|
|
|
@@ -72,7 +69,6 @@ export function ThemePage() {
|
|
|
72
69
|
return (
|
|
73
70
|
<Layout
|
|
74
71
|
header={{
|
|
75
|
-
onBack: () => navigateBackFrom(navigationRoutes.settings),
|
|
76
72
|
title: i18n.t('Theme'),
|
|
77
73
|
}}>
|
|
78
74
|
<SettingsContainer>
|
|
@@ -6,8 +6,6 @@ import React, { Fragment, useState } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Layout } from '../components/Layout';
|
|
8
8
|
import { WalletModal } from '../components/WalletModal';
|
|
9
|
-
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
10
|
-
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
11
9
|
import { useWalletList } from '../hooks/useWalletList';
|
|
12
10
|
import { useAppStore } from '../store/AppStore';
|
|
13
11
|
import { getContainer } from '../utils/common';
|
|
@@ -30,7 +28,6 @@ export const TIME_TO_IGNORE_MODAL = 300;
|
|
|
30
28
|
|
|
31
29
|
export function WalletsPage() {
|
|
32
30
|
const { config, fetchStatus: fetchMetaStatus } = useAppStore();
|
|
33
|
-
const { navigateBackFrom } = useNavigateBack();
|
|
34
31
|
const [openModal, setOpenModal] = useState(false);
|
|
35
32
|
const [selectedWalletType, setSelectedWalletType] = useState<WalletType>('');
|
|
36
33
|
let modalTimerId: ReturnType<typeof setTimeout> | null = null;
|
|
@@ -64,7 +61,6 @@ export function WalletsPage() {
|
|
|
64
61
|
<Layout
|
|
65
62
|
header={{
|
|
66
63
|
title: i18n.t('Connect Wallets'),
|
|
67
|
-
onBack: () => navigateBackFrom(navigationRoutes.wallets),
|
|
68
64
|
}}>
|
|
69
65
|
<Container>
|
|
70
66
|
<Typography variant="title" size="xmedium" align="center">
|