@rango-dev/widget-embedded 0.20.1-next.20 → 0.20.1-next.21
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/BlockchainList/BlockchainList.styles.d.ts +161 -1
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts +0 -1
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -1
- package/dist/components/Layout/Layout.d.ts +2 -3
- package/dist/components/Layout/Layout.d.ts.map +1 -1
- package/dist/components/Layout/Layout.helpers.d.ts +2 -0
- package/dist/components/Layout/Layout.helpers.d.ts.map +1 -0
- package/dist/components/Layout/Layout.styles.d.ts +2 -4
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
- package/dist/components/Layout/Layout.types.d.ts +6 -3
- package/dist/components/Layout/Layout.types.d.ts.map +1 -1
- package/dist/components/Layout/PageContainer.d.ts +166 -0
- package/dist/components/Layout/PageContainer.d.ts.map +1 -0
- package/dist/components/Layout/ScrollableArea.d.ts +164 -0
- package/dist/components/Layout/ScrollableArea.d.ts.map +1 -0
- package/dist/components/Layout/index.d.ts +2 -0
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -1
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +0 -161
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -1
- package/dist/components/SettingsContainer/index.d.ts +1 -1
- package/dist/components/SettingsContainer/index.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.styles.d.ts +161 -1
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/containers/App/App.styles.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +0 -324
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +0 -7
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
- package/dist/index.js +2 -2
- 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/SelectSwapItemsPage.d.ts.map +1 -1
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/ThemePage.d.ts.map +1 -1
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/utils/ui.d.ts +2 -0
- package/dist/utils/ui.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/BlockchainList/BlockchainList.styles.ts +4 -3
- package/src/components/BlockchainList/BlockchainList.tsx +1 -1
- package/src/components/HeaderButtons/HeaderButtons.types.ts +0 -1
- package/src/components/HeaderButtons/HomeButtons.tsx +1 -2
- package/src/components/Layout/Layout.helpers.ts +16 -0
- package/src/components/Layout/Layout.styles.ts +17 -31
- package/src/components/Layout/Layout.tsx +23 -21
- package/src/components/Layout/Layout.types.ts +9 -8
- package/src/components/Layout/PageContainer.tsx +24 -0
- package/src/components/Layout/ScrollableArea.tsx +11 -0
- package/src/components/Layout/index.ts +2 -0
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts +0 -1
- package/src/components/SettingsContainer/SettingsContainer.style.ts +0 -5
- package/src/components/SettingsContainer/index.ts +0 -1
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +0 -1
- package/src/components/SwapDetails/SwapDetails.styles.ts +5 -6
- package/src/components/SwapDetails/SwapDetails.tsx +3 -5
- package/src/components/TokenList/TokenList.styles.ts +2 -0
- package/src/components/TokenList/TokenList.tsx +1 -1
- package/src/containers/App/App.styles.ts +2 -0
- package/src/containers/QuoteInfo/QuoteInfo.styles.ts +0 -15
- package/src/containers/QuoteInfo/QuoteInfo.tsx +30 -77
- package/src/containers/QuoteInfo/QuoteInfo.types.ts +0 -7
- package/src/pages/ConfirmSwapPage.tsx +49 -42
- package/src/pages/HistoryPage.tsx +4 -11
- package/src/pages/Home.tsx +35 -37
- package/src/pages/LanguagePage.tsx +3 -4
- package/src/pages/LiquiditySourcePage.tsx +3 -4
- package/src/pages/SelectBlockchainPage.tsx +38 -38
- package/src/pages/SelectSwapItemsPage.tsx +40 -38
- package/src/pages/SettingsPage.tsx +3 -4
- package/src/pages/ThemePage.tsx +3 -4
- package/src/pages/WalletsPage.tsx +12 -13
- package/src/utils/ui.ts +20 -0
|
@@ -1,36 +1,16 @@
|
|
|
1
1
|
import type { PropTypes } from './QuoteInfo.types';
|
|
2
2
|
|
|
3
|
-
import { Divider } from '@rango-dev/ui';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
|
|
6
5
|
import { Quote } from '../../components/Quote';
|
|
7
6
|
import { QuoteSkeleton } from '../../components/QuoteSkeleton';
|
|
8
|
-
import { QuoteWarningsAndErrors } from '../../components/QuoteWarningsAndErrors';
|
|
9
7
|
import { useQuoteStore } from '../../store/quote';
|
|
10
8
|
import { QuoteErrorType } from '../../types';
|
|
11
9
|
|
|
12
|
-
import {
|
|
13
|
-
PositionTopAlerts,
|
|
14
|
-
QuoteContainer,
|
|
15
|
-
SkeletonContainer,
|
|
16
|
-
} from './QuoteInfo.styles';
|
|
10
|
+
import { QuoteContainer } from './QuoteInfo.styles';
|
|
17
11
|
|
|
18
12
|
export function QuoteInfo(props: PropTypes) {
|
|
19
|
-
const {
|
|
20
|
-
quote,
|
|
21
|
-
type,
|
|
22
|
-
loading,
|
|
23
|
-
error,
|
|
24
|
-
warning,
|
|
25
|
-
refetchQuote,
|
|
26
|
-
showWarningModal,
|
|
27
|
-
onOpenWarningModal,
|
|
28
|
-
onCloseWarningModal,
|
|
29
|
-
onConfirmWarningModal,
|
|
30
|
-
onChangeSettings,
|
|
31
|
-
expanded = false,
|
|
32
|
-
alertPosition = 'bottom',
|
|
33
|
-
} = props;
|
|
13
|
+
const { quote, type, loading, error, warning, expanded = false } = props;
|
|
34
14
|
const { inputAmount, inputUsdValue, outputUsdValue, outputAmount } =
|
|
35
15
|
useQuoteStore();
|
|
36
16
|
|
|
@@ -41,59 +21,32 @@ export function QuoteInfo(props: PropTypes) {
|
|
|
41
21
|
|
|
42
22
|
const showQuote = !noResult && quote && quote.result && !loading;
|
|
43
23
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
<Quote
|
|
73
|
-
quote={quote}
|
|
74
|
-
error={error}
|
|
75
|
-
warning={warning}
|
|
76
|
-
type={type}
|
|
77
|
-
expanded={expanded}
|
|
78
|
-
recommended={true}
|
|
79
|
-
input={{
|
|
80
|
-
value: inputAmount,
|
|
81
|
-
usdValue: inputUsdValue?.toString() ?? '',
|
|
82
|
-
}}
|
|
83
|
-
output={{
|
|
84
|
-
value: outputAmount?.toString() ?? '',
|
|
85
|
-
usdValue: outputUsdValue?.toString() ?? '',
|
|
86
|
-
}}
|
|
87
|
-
/>
|
|
88
|
-
</QuoteContainer>
|
|
89
|
-
) : null}
|
|
90
|
-
|
|
91
|
-
{alertPosition === 'bottom' && (
|
|
92
|
-
<>
|
|
93
|
-
{!warning && !error && <Divider size={16} />}
|
|
94
|
-
{quoteWarningsAndErrors}
|
|
95
|
-
</>
|
|
96
|
-
)}
|
|
97
|
-
</>
|
|
98
|
-
);
|
|
24
|
+
if (loading) {
|
|
25
|
+
return (
|
|
26
|
+
<QuoteContainer>
|
|
27
|
+
<QuoteSkeleton type={type} expanded={expanded} />
|
|
28
|
+
</QuoteContainer>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return showQuote ? (
|
|
33
|
+
<QuoteContainer>
|
|
34
|
+
<Quote
|
|
35
|
+
quote={quote}
|
|
36
|
+
error={error}
|
|
37
|
+
warning={warning}
|
|
38
|
+
type={type}
|
|
39
|
+
expanded={expanded}
|
|
40
|
+
recommended={true}
|
|
41
|
+
input={{
|
|
42
|
+
value: inputAmount,
|
|
43
|
+
usdValue: inputUsdValue?.toString() ?? '',
|
|
44
|
+
}}
|
|
45
|
+
output={{
|
|
46
|
+
value: outputAmount?.toString() ?? '',
|
|
47
|
+
usdValue: outputUsdValue?.toString() ?? '',
|
|
48
|
+
}}
|
|
49
|
+
/>
|
|
50
|
+
</QuoteContainer>
|
|
51
|
+
) : null;
|
|
99
52
|
}
|
|
@@ -10,11 +10,4 @@ export type PropTypes = {
|
|
|
10
10
|
warning: QuoteWarning | null;
|
|
11
11
|
autoScrollOnExpanding?: boolean;
|
|
12
12
|
expanded?: boolean;
|
|
13
|
-
alertPosition?: 'top' | 'bottom';
|
|
14
|
-
refetchQuote: () => void;
|
|
15
|
-
showWarningModal: boolean;
|
|
16
|
-
onOpenWarningModal: () => void;
|
|
17
|
-
onCloseWarningModal: () => void;
|
|
18
|
-
onConfirmWarningModal: () => void;
|
|
19
|
-
onChangeSettings: () => void;
|
|
20
13
|
};
|
|
@@ -26,7 +26,8 @@ import { getRequiredWallets } from '../components/ConfirmWalletsModal/ConfirmWal
|
|
|
26
26
|
import { ConfirmWalletsModal } from '../components/ConfirmWalletsModal/ConfirmWalletsModal';
|
|
27
27
|
import { HeaderButton } from '../components/HeaderButtons/HeaderButtons.styles';
|
|
28
28
|
import { RefreshButton } from '../components/HeaderButtons/RefreshButton';
|
|
29
|
-
import { Layout } from '../components/Layout';
|
|
29
|
+
import { Layout, PageContainer } from '../components/Layout';
|
|
30
|
+
import { QuoteWarningsAndErrors } from '../components/QuoteWarningsAndErrors';
|
|
30
31
|
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
31
32
|
import { getQuoteUpdateWarningMessage } from '../constants/warnings';
|
|
32
33
|
import { QuoteInfo } from '../containers/QuoteInfo';
|
|
@@ -37,15 +38,7 @@ import { useUiStore } from '../store/ui';
|
|
|
37
38
|
import { useWalletsStore } from '../store/wallets';
|
|
38
39
|
import { QuoteWarningType } from '../types';
|
|
39
40
|
import { getContainer } from '../utils/common';
|
|
40
|
-
|
|
41
|
-
const Container = styled('div', {
|
|
42
|
-
position: 'relative',
|
|
43
|
-
width: '100%',
|
|
44
|
-
|
|
45
|
-
'& .quote-update__alert': {
|
|
46
|
-
paddingTop: '$10',
|
|
47
|
-
},
|
|
48
|
-
});
|
|
41
|
+
import { joinList } from '../utils/ui';
|
|
49
42
|
|
|
50
43
|
const Buttons = styled('div', {
|
|
51
44
|
width: '100%',
|
|
@@ -263,6 +256,45 @@ export function ConfirmSwapPage() {
|
|
|
263
256
|
}
|
|
264
257
|
}, []);
|
|
265
258
|
|
|
259
|
+
const quoteWarning = confirmSwapResult.warnings?.quote ?? null;
|
|
260
|
+
const quoteError = confirmSwapResult.error;
|
|
261
|
+
const alerts = [];
|
|
262
|
+
if (dbErrorMessage) {
|
|
263
|
+
alerts.push(<Alert type="error" variant="alarm" title={dbErrorMessage} />);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (confirmSwapResult.warnings?.quoteUpdate) {
|
|
267
|
+
alerts.push(
|
|
268
|
+
<Alert
|
|
269
|
+
variant="alarm"
|
|
270
|
+
type="warning"
|
|
271
|
+
title={
|
|
272
|
+
confirmSwapResult.warnings.quoteUpdate &&
|
|
273
|
+
getQuoteUpdateWarningMessage(confirmSwapResult.warnings.quoteUpdate)
|
|
274
|
+
}
|
|
275
|
+
/>
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
if (quoteWarning || quoteError) {
|
|
280
|
+
alerts.push(
|
|
281
|
+
<QuoteWarningsAndErrors
|
|
282
|
+
warning={quoteWarning}
|
|
283
|
+
error={quoteError}
|
|
284
|
+
loading={fetchingConfirmationQuote}
|
|
285
|
+
refetchQuote={onRefresh}
|
|
286
|
+
showWarningModal={showQuoteWarningModal}
|
|
287
|
+
onOpenWarningModal={() => setShowQuoteWarningModal(true)}
|
|
288
|
+
onCloseWarningModal={() => setShowQuoteWarningModal(false)}
|
|
289
|
+
onConfirmWarningModal={async () => {
|
|
290
|
+
setShowQuoteWarningModal(false);
|
|
291
|
+
await addNewSwap();
|
|
292
|
+
}}
|
|
293
|
+
onChangeSettings={() => navigate(navigationRoutes.settings)}
|
|
294
|
+
/>
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
|
|
266
298
|
return (
|
|
267
299
|
<Layout
|
|
268
300
|
header={{
|
|
@@ -319,7 +351,7 @@ export function ConfirmSwapPage() {
|
|
|
319
351
|
/>
|
|
320
352
|
)}
|
|
321
353
|
|
|
322
|
-
<
|
|
354
|
+
<PageContainer>
|
|
323
355
|
<div className={descriptionStyles()}>
|
|
324
356
|
<Typography variant="title" size="small">
|
|
325
357
|
{i18n.t('You get')}
|
|
@@ -336,45 +368,20 @@ export function ConfirmSwapPage() {
|
|
|
336
368
|
/>
|
|
337
369
|
</div>
|
|
338
370
|
</div>
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
)}
|
|
345
|
-
{confirmSwapResult.warnings?.quoteUpdate && (
|
|
346
|
-
<div className="quote-update__alert">
|
|
347
|
-
<Alert
|
|
348
|
-
variant="alarm"
|
|
349
|
-
type="warning"
|
|
350
|
-
title={
|
|
351
|
-
confirmSwapResult.warnings.quoteUpdate &&
|
|
352
|
-
getQuoteUpdateWarningMessage(
|
|
353
|
-
confirmSwapResult.warnings.quoteUpdate
|
|
354
|
-
)
|
|
355
|
-
}
|
|
356
|
-
/>
|
|
357
|
-
</div>
|
|
358
|
-
)}
|
|
371
|
+
<Divider size="12" />
|
|
372
|
+
|
|
373
|
+
{joinList(alerts, <Divider size={10} />)}
|
|
374
|
+
{alerts.length > 0 ? <Divider size={10} /> : null}
|
|
375
|
+
|
|
359
376
|
<QuoteInfo
|
|
360
377
|
quote={quote}
|
|
361
378
|
type="swap-preview"
|
|
362
379
|
expanded={true}
|
|
363
|
-
alertPosition="top"
|
|
364
380
|
error={confirmSwapResult.error}
|
|
365
381
|
loading={fetchingConfirmationQuote}
|
|
366
382
|
warning={confirmSwapResult.warnings?.quote ?? null}
|
|
367
|
-
refetchQuote={onRefresh}
|
|
368
|
-
showWarningModal={showQuoteWarningModal}
|
|
369
|
-
onOpenWarningModal={() => setShowQuoteWarningModal(true)}
|
|
370
|
-
onCloseWarningModal={() => setShowQuoteWarningModal(false)}
|
|
371
|
-
onConfirmWarningModal={async () => {
|
|
372
|
-
setShowQuoteWarningModal(false);
|
|
373
|
-
await addNewSwap();
|
|
374
|
-
}}
|
|
375
|
-
onChangeSettings={() => navigate('../' + navigationRoutes.settings)}
|
|
376
383
|
/>
|
|
377
|
-
</
|
|
384
|
+
</PageContainer>
|
|
378
385
|
</Layout>
|
|
379
386
|
);
|
|
380
387
|
}
|
|
@@ -6,7 +6,7 @@ import { Divider, NotFound, styled } from '@rango-dev/ui';
|
|
|
6
6
|
import React, { useState } from 'react';
|
|
7
7
|
import { useNavigate } from 'react-router-dom';
|
|
8
8
|
|
|
9
|
-
import { Layout } from '../components/Layout';
|
|
9
|
+
import { Layout, PageContainer } from '../components/Layout';
|
|
10
10
|
import { SearchInput } from '../components/SearchInput';
|
|
11
11
|
import { SwapsGroup } from '../components/SwapsGroup';
|
|
12
12
|
import { NotFoundContainer } from '../components/SwapsGroup/SwapsGroup.styles';
|
|
@@ -15,14 +15,6 @@ import { groupSwapsByDate } from '../utils/date';
|
|
|
15
15
|
import { containsText } from '../utils/numbers';
|
|
16
16
|
import { getPendingSwaps } from '../utils/queue';
|
|
17
17
|
|
|
18
|
-
const Container = styled('div', {
|
|
19
|
-
display: 'flex',
|
|
20
|
-
flexDirection: 'column',
|
|
21
|
-
alignItems: 'flex-start',
|
|
22
|
-
height: '100%',
|
|
23
|
-
gap: 15,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
18
|
const SwapsGroupContainer = styled('div', {
|
|
27
19
|
overflowY: 'visible',
|
|
28
20
|
width: '100%',
|
|
@@ -76,7 +68,7 @@ export function HistoryPage() {
|
|
|
76
68
|
header={{
|
|
77
69
|
title: i18n.t('History'),
|
|
78
70
|
}}>
|
|
79
|
-
<
|
|
71
|
+
<PageContainer>
|
|
80
72
|
<SearchInput
|
|
81
73
|
setValue={setSearchedFor}
|
|
82
74
|
fullWidth
|
|
@@ -86,6 +78,7 @@ export function HistoryPage() {
|
|
|
86
78
|
onChange={searchHandler}
|
|
87
79
|
value={searchedFor}
|
|
88
80
|
/>
|
|
81
|
+
<Divider size="16" />
|
|
89
82
|
<SwapsGroupContainer>
|
|
90
83
|
{isEmpty && (
|
|
91
84
|
<NotFoundContainer>
|
|
@@ -110,7 +103,7 @@ export function HistoryPage() {
|
|
|
110
103
|
/>
|
|
111
104
|
)}
|
|
112
105
|
</SwapsGroupContainer>
|
|
113
|
-
</
|
|
106
|
+
</PageContainer>
|
|
114
107
|
</Layout>
|
|
115
108
|
);
|
|
116
109
|
}
|
package/src/pages/Home.tsx
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { i18n } from '@lingui/core';
|
|
2
|
-
import { Button, styled, SwapInput, WarningIcon } from '@rango-dev/ui';
|
|
3
|
-
import React, { useEffect,
|
|
2
|
+
import { Button, Divider, styled, SwapInput, WarningIcon } from '@rango-dev/ui';
|
|
3
|
+
import React, { useEffect, useState } from 'react';
|
|
4
4
|
import { useNavigate } from 'react-router-dom';
|
|
5
5
|
|
|
6
6
|
import { HomeButtons } from '../components/HeaderButtons';
|
|
7
|
-
import { Layout } from '../components/Layout';
|
|
7
|
+
import { Layout, PageContainer } from '../components/Layout';
|
|
8
|
+
import { QuoteWarningsAndErrors } from '../components/QuoteWarningsAndErrors';
|
|
8
9
|
import { SwitchFromAndToButton } from '../components/SwitchFromAndTo';
|
|
9
10
|
import { errorMessages } from '../constants/errors';
|
|
10
11
|
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
@@ -28,15 +29,6 @@ import { getPriceImpact, getPriceImpactLevel } from '../utils/quote';
|
|
|
28
29
|
import { canComputePriceImpact, getSwapButtonState } from '../utils/swap';
|
|
29
30
|
import { formatBalance, isFetchingBalance } from '../utils/wallets';
|
|
30
31
|
|
|
31
|
-
const Container = styled('div', {
|
|
32
|
-
display: 'flex',
|
|
33
|
-
flexDirection: 'column',
|
|
34
|
-
overflowY: 'visible',
|
|
35
|
-
'& .quote__container': {
|
|
36
|
-
paddingTop: '$2',
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
|
|
40
32
|
const FromContainer = styled('div', {
|
|
41
33
|
position: 'relative',
|
|
42
34
|
});
|
|
@@ -75,7 +67,6 @@ export function Home() {
|
|
|
75
67
|
const { connectedWallets, getBalanceFor } = useWalletsStore();
|
|
76
68
|
const setCurrentPage = useUiStore.use.setCurrentPage();
|
|
77
69
|
const [showQuoteWarningModal, setShowQuoteWarningModal] = useState(false);
|
|
78
|
-
const layoutRef = useRef<HTMLDivElement>(null);
|
|
79
70
|
const fetchingBalance =
|
|
80
71
|
!!fromBlockchain &&
|
|
81
72
|
isFetchingBalance(connectedWallets, fromBlockchain.name);
|
|
@@ -128,8 +119,7 @@ export function Home() {
|
|
|
128
119
|
|
|
129
120
|
return (
|
|
130
121
|
<Layout
|
|
131
|
-
|
|
132
|
-
fixedHeight={false}
|
|
122
|
+
height="auto"
|
|
133
123
|
hasLogo
|
|
134
124
|
footer={
|
|
135
125
|
<Button
|
|
@@ -160,7 +150,6 @@ export function Home() {
|
|
|
160
150
|
title: i18n.t('Swap'),
|
|
161
151
|
suffix: (
|
|
162
152
|
<HomeButtons
|
|
163
|
-
layoutRef={layoutRef.current}
|
|
164
153
|
onClickRefresh={
|
|
165
154
|
(!!quote || quoteError) && !showQuoteWarningModal
|
|
166
155
|
? fetchQuote
|
|
@@ -171,7 +160,7 @@ export function Home() {
|
|
|
171
160
|
/>
|
|
172
161
|
),
|
|
173
162
|
}}>
|
|
174
|
-
<
|
|
163
|
+
<PageContainer>
|
|
175
164
|
<InputsContainer>
|
|
176
165
|
<FromContainer>
|
|
177
166
|
<SwapInput
|
|
@@ -262,26 +251,35 @@ export function Home() {
|
|
|
262
251
|
tooltipContainer={getContainer()}
|
|
263
252
|
/>
|
|
264
253
|
</InputsContainer>
|
|
265
|
-
<
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
254
|
+
<Divider size="2" />
|
|
255
|
+
<QuoteInfo
|
|
256
|
+
quote={quote}
|
|
257
|
+
loading={fetchingQuote}
|
|
258
|
+
error={quoteError}
|
|
259
|
+
warning={quoteWarning}
|
|
260
|
+
type="basic"
|
|
261
|
+
/>
|
|
262
|
+
{quoteWarning || quoteError ? (
|
|
263
|
+
<>
|
|
264
|
+
<Divider size="10" />
|
|
265
|
+
<QuoteWarningsAndErrors
|
|
266
|
+
warning={quoteWarning}
|
|
267
|
+
error={quoteError}
|
|
268
|
+
loading={fetchingQuote}
|
|
269
|
+
refetchQuote={fetchQuote}
|
|
270
|
+
showWarningModal={showQuoteWarningModal}
|
|
271
|
+
onOpenWarningModal={() => setShowQuoteWarningModal(true)}
|
|
272
|
+
onCloseWarningModal={() => setShowQuoteWarningModal(false)}
|
|
273
|
+
onConfirmWarningModal={() => {
|
|
274
|
+
setShowQuoteWarningModal(false);
|
|
275
|
+
setQuoteWarningsConfirmed(true);
|
|
276
|
+
navigate(navigationRoutes.confirmSwap);
|
|
277
|
+
}}
|
|
278
|
+
onChangeSettings={() => navigate(navigationRoutes.settings)}
|
|
279
|
+
/>
|
|
280
|
+
</>
|
|
281
|
+
) : null}
|
|
282
|
+
</PageContainer>
|
|
285
283
|
</Layout>
|
|
286
284
|
);
|
|
287
285
|
}
|
|
@@ -8,8 +8,7 @@ import {
|
|
|
8
8
|
} from '@rango-dev/ui';
|
|
9
9
|
import React from 'react';
|
|
10
10
|
|
|
11
|
-
import { Layout } from '../components/Layout';
|
|
12
|
-
import { SettingsContainer } from '../components/SettingsContainer';
|
|
11
|
+
import { Layout, PageContainer } from '../components/Layout';
|
|
13
12
|
import { useLanguage } from '../hooks/useLanguage';
|
|
14
13
|
|
|
15
14
|
export function LanguagePage() {
|
|
@@ -36,7 +35,7 @@ export function LanguagePage() {
|
|
|
36
35
|
header={{
|
|
37
36
|
title: i18n.t('Language'),
|
|
38
37
|
}}>
|
|
39
|
-
<
|
|
38
|
+
<PageContainer>
|
|
40
39
|
<RadioRoot value={activeLanguage}>
|
|
41
40
|
<List
|
|
42
41
|
type={
|
|
@@ -49,7 +48,7 @@ export function LanguagePage() {
|
|
|
49
48
|
items={languageList}
|
|
50
49
|
/>
|
|
51
50
|
</RadioRoot>
|
|
52
|
-
</
|
|
51
|
+
</PageContainer>
|
|
53
52
|
</Layout>
|
|
54
53
|
);
|
|
55
54
|
}
|
|
@@ -14,14 +14,13 @@ import {
|
|
|
14
14
|
} from '@rango-dev/ui';
|
|
15
15
|
import React, { useState } from 'react';
|
|
16
16
|
|
|
17
|
-
import { Layout } from '../components/Layout';
|
|
17
|
+
import { Layout, PageContainer } from '../components/Layout';
|
|
18
18
|
import { LoadingLiquiditySourceList } from '../components/LoadingLiquiditySourceList';
|
|
19
19
|
import { SearchInput } from '../components/SearchInput';
|
|
20
20
|
import {
|
|
21
21
|
LiquiditySourceList,
|
|
22
22
|
LiquiditySourceSuffix,
|
|
23
23
|
NotFoundContainer,
|
|
24
|
-
SettingsContainer,
|
|
25
24
|
} from '../components/SettingsContainer';
|
|
26
25
|
import { useAppStore } from '../store/AppStore';
|
|
27
26
|
import { containsText } from '../utils/numbers';
|
|
@@ -109,7 +108,7 @@ export function LiquiditySourcePage({ sourceType }: PropTypes) {
|
|
|
109
108
|
</LiquiditySourceSuffix>
|
|
110
109
|
),
|
|
111
110
|
}}>
|
|
112
|
-
<
|
|
111
|
+
<PageContainer view>
|
|
113
112
|
<SearchInput
|
|
114
113
|
value={searchedFor}
|
|
115
114
|
setValue={setSearchedFor}
|
|
@@ -148,7 +147,7 @@ export function LiquiditySourcePage({ sourceType }: PropTypes) {
|
|
|
148
147
|
</LiquiditySourceList>
|
|
149
148
|
)
|
|
150
149
|
)}
|
|
151
|
-
</
|
|
150
|
+
</PageContainer>
|
|
152
151
|
</Layout>
|
|
153
152
|
);
|
|
154
153
|
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import React, { useState } from 'react';
|
|
8
8
|
|
|
9
9
|
import { BlockchainList } from '../components/BlockchainList';
|
|
10
|
-
import { Layout } from '../components/Layout';
|
|
10
|
+
import { Layout, PageContainer } from '../components/Layout';
|
|
11
11
|
import { SearchInput } from '../components/SearchInput';
|
|
12
12
|
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
13
13
|
import { useAppStore } from '../store/AppStore';
|
|
@@ -39,45 +39,45 @@ export function SelectBlockchainPage(props: PropTypes) {
|
|
|
39
39
|
header={{
|
|
40
40
|
title: i18n.t(`Select Blockchain`),
|
|
41
41
|
}}>
|
|
42
|
-
<
|
|
42
|
+
<PageContainer view>
|
|
43
|
+
{showCategory && (
|
|
44
|
+
<>
|
|
45
|
+
<SelectableCategoryList
|
|
46
|
+
setCategory={setBlockchainCategory}
|
|
47
|
+
category={blockchainCategory}
|
|
48
|
+
blockchains={blockchains}
|
|
49
|
+
isLoading={fetchStatus === 'loading'}
|
|
50
|
+
/>
|
|
51
|
+
<Divider size={24} />
|
|
52
|
+
</>
|
|
53
|
+
)}
|
|
43
54
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
<SearchInput
|
|
56
|
+
value={searchedFor}
|
|
57
|
+
autoFocus
|
|
58
|
+
placeholder={i18n.t('Search Blockchain')}
|
|
59
|
+
color="light"
|
|
60
|
+
variant="contained"
|
|
61
|
+
size="large"
|
|
62
|
+
setValue={() => setSearchedFor('')}
|
|
63
|
+
onChange={(event) => setSearchedFor(event.target.value)}
|
|
64
|
+
/>
|
|
65
|
+
<Divider size={16} />
|
|
55
66
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
searchedFor={searchedFor}
|
|
71
|
-
blockchainCategory={blockchainCategory}
|
|
72
|
-
onChange={(blockchain) => {
|
|
73
|
-
if (type === 'source') {
|
|
74
|
-
setFromBlockchain(blockchain);
|
|
75
|
-
} else {
|
|
76
|
-
setToBlockchain(blockchain);
|
|
77
|
-
}
|
|
78
|
-
navigateBack();
|
|
79
|
-
}}
|
|
80
|
-
/>
|
|
67
|
+
<BlockchainList
|
|
68
|
+
list={blockchains}
|
|
69
|
+
searchedFor={searchedFor}
|
|
70
|
+
blockchainCategory={blockchainCategory}
|
|
71
|
+
onChange={(blockchain) => {
|
|
72
|
+
if (type === 'source') {
|
|
73
|
+
setFromBlockchain(blockchain);
|
|
74
|
+
} else {
|
|
75
|
+
setToBlockchain(blockchain);
|
|
76
|
+
}
|
|
77
|
+
navigateBack();
|
|
78
|
+
}}
|
|
79
|
+
/>
|
|
80
|
+
</PageContainer>
|
|
81
81
|
</Layout>
|
|
82
82
|
);
|
|
83
83
|
}
|