@rango-dev/widget-embedded 0.23.1-next.2 → 0.23.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/AppRoutes.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +1 -283
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HeaderButtons.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +489 -1
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -1
- package/dist/components/HeaderButtons/InProgressTransactionBadge.d.ts +4 -0
- package/dist/components/HeaderButtons/InProgressTransactionBadge.d.ts.map +1 -0
- package/dist/components/HeaderButtons/RefreshButton.d.ts.map +1 -1
- package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts.map +1 -1
- package/dist/components/HeaderButtons/WalletButton.d.ts.map +1 -1
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +1 -1
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.helpers.d.ts +8 -0
- package/dist/components/NoResult/NoResult.helpers.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.styles.d.ts +167 -1
- package/dist/components/NoResult/NoResult.styles.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.types.d.ts +1 -0
- package/dist/components/NoResult/NoResult.types.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts +165 -0
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.d.ts.map +1 -1
- package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.types.d.ts +1 -0
- package/dist/components/Quote/Quote.types.d.ts.map +1 -1
- package/dist/components/Quote/QuoteTrigger.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts.map +1 -1
- package/dist/components/Quotes/Quotes.d.ts.map +1 -1
- package/dist/components/Quotes/Quotes.types.d.ts +1 -0
- package/dist/components/Quotes/Quotes.types.d.ts.map +1 -1
- package/dist/components/Quotes/SelectStrategy.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.d.ts.map +1 -1
- package/dist/components/common/ActivateTabAlert/ActivateTabAlert.d.ts.map +1 -1
- package/dist/constants/navigationRoutes.d.ts +0 -1
- package/dist/constants/navigationRoutes.d.ts.map +1 -1
- package/dist/constants/settings.d.ts +6 -0
- package/dist/constants/settings.d.ts.map +1 -0
- package/dist/containers/App/App.styles.d.ts.map +1 -1
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.d.ts.map +1 -1
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.styles.d.ts +3 -1
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.styles.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +1 -0
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
- package/dist/containers/Settings/Lists.d.ts +3 -0
- package/dist/containers/Settings/Lists.d.ts.map +1 -0
- package/dist/hooks/useScreenDetect.d.ts +9 -0
- package/dist/hooks/useScreenDetect.d.ts.map +1 -0
- package/dist/hooks/useSwapInput.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/Home.d.ts.map +1 -1
- package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/store/slices/data.d.ts.map +1 -1
- package/dist/store/slices/settings.d.ts.map +1 -1
- package/dist/types/config.d.ts +9 -5
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/colors.d.ts +5 -3
- package/dist/utils/colors.d.ts.map +1 -1
- package/dist/utils/configs.d.ts +2 -1
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/utils/swap.d.ts +2 -0
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/ui.d.ts +5 -2
- package/dist/utils/ui.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/components/AppRoutes.tsx +0 -5
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +6 -12
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +7 -11
- package/src/components/ConfirmWalletsModal/WalletList.tsx +2 -2
- package/src/components/HeaderButtons/HeaderButtons.styles.ts +43 -2
- package/src/components/HeaderButtons/HeaderButtons.tsx +2 -0
- package/src/components/HeaderButtons/InProgressTransactionBadge.tsx +26 -0
- package/src/components/HeaderButtons/RefreshButton.tsx +2 -1
- package/src/components/HeaderButtons/UnreadNotificationsBadge.tsx +10 -2
- package/src/components/HeaderButtons/WalletButton.tsx +26 -6
- package/src/components/Layout/Layout.styles.ts +3 -0
- package/src/components/Layout/Layout.tsx +4 -4
- package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.ts +1 -1
- package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.tsx +4 -4
- package/src/components/NoResult/NoResult.helpers.ts +13 -0
- package/src/components/NoResult/NoResult.styles.ts +19 -1
- package/src/components/NoResult/NoResult.tsx +27 -16
- package/src/components/NoResult/NoResult.types.ts +1 -0
- package/src/components/NotificationContent/NotificationContent.styles.ts +14 -1
- package/src/components/NotificationContent/NotificationContent.tsx +49 -39
- package/src/components/Quote/Quote.styles.ts +13 -14
- package/src/components/Quote/Quote.tsx +166 -145
- package/src/components/Quote/Quote.types.ts +1 -0
- package/src/components/Quote/QuoteTrigger.tsx +7 -8
- package/src/components/QuoteSkeleton/QuoteSkeleton.styles.ts +1 -1
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +2 -3
- package/src/components/Quotes/Quotes.tsx +21 -10
- package/src/components/Quotes/Quotes.types.ts +1 -0
- package/src/components/Quotes/SelectStrategy.tsx +3 -11
- package/src/components/Slippage/Slippage.tsx +11 -13
- package/src/components/SwapDetails/SwapDetails.tsx +1 -1
- package/src/components/TokenList/TokenList.tsx +9 -8
- package/src/components/common/ActivateTabAlert/ActivateTabAlert.tsx +2 -4
- package/src/constants/navigationRoutes.ts +0 -1
- package/src/constants/settings.ts +5 -0
- package/src/containers/App/App.styles.ts +0 -4
- package/src/containers/ExpandedQuotes/ExpandedQuotes.styles.ts +13 -0
- package/src/containers/ExpandedQuotes/ExpandedQuotes.tsx +5 -0
- package/src/containers/QuoteInfo/QuoteInfo.tsx +2 -0
- package/src/containers/QuoteInfo/QuoteInfo.types.ts +1 -0
- package/src/containers/Settings/Lists.tsx +264 -0
- package/src/hooks/useScreenDetect.ts +49 -0
- package/src/hooks/useSwapInput.ts +7 -2
- package/src/pages/ConfirmSwapPage.tsx +7 -3
- package/src/pages/Home.tsx +31 -7
- package/src/pages/LiquiditySourcePage.tsx +4 -3
- package/src/pages/SettingsPage.tsx +6 -185
- package/src/store/slices/config.ts +2 -2
- package/src/store/slices/data.ts +8 -5
- package/src/store/slices/settings.ts +7 -3
- package/src/types/config.ts +9 -5
- package/src/utils/colors.ts +106 -75
- package/src/utils/configs.ts +12 -1
- package/src/utils/swap.ts +11 -0
- package/src/utils/ui.ts +7 -5
- package/dist/hooks/useMobileDetect.d.ts +0 -3
- package/dist/hooks/useMobileDetect.d.ts.map +0 -1
- package/dist/pages/ThemePage.d.ts +0 -3
- package/dist/pages/ThemePage.d.ts.map +0 -1
- package/src/hooks/useMobileDetect.ts +0 -21
- package/src/pages/ThemePage.tsx +0 -90
|
@@ -6,8 +6,26 @@ export const Container = styled('div', {
|
|
|
6
6
|
alignItems: 'center',
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
+
export const ErrorDescription = styled('div', {
|
|
10
|
+
variants: {
|
|
11
|
+
size: {
|
|
12
|
+
small: {},
|
|
13
|
+
large: {
|
|
14
|
+
maxWidth: '316px',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
9
20
|
export const Footer = styled('div', {
|
|
10
|
-
|
|
21
|
+
variants: {
|
|
22
|
+
size: {
|
|
23
|
+
small: {
|
|
24
|
+
width: '100%',
|
|
25
|
+
},
|
|
26
|
+
large: {},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
11
29
|
});
|
|
12
30
|
|
|
13
31
|
export const PrefixIcon = styled('div', {
|
|
@@ -13,16 +13,24 @@ import React from 'react';
|
|
|
13
13
|
import { errorMessages } from '../../constants/errors';
|
|
14
14
|
import { useAppStore } from '../../store/AppStore';
|
|
15
15
|
|
|
16
|
-
import {
|
|
17
|
-
|
|
16
|
+
import {
|
|
17
|
+
makeInfo,
|
|
18
|
+
NoRouteIconSize,
|
|
19
|
+
NoRouteTitleSize,
|
|
20
|
+
} from './NoResult.helpers';
|
|
21
|
+
import {
|
|
22
|
+
Container,
|
|
23
|
+
ErrorDescription,
|
|
24
|
+
Footer,
|
|
25
|
+
PrefixIcon,
|
|
26
|
+
} from './NoResult.styles';
|
|
18
27
|
|
|
19
28
|
export function NoResult(props: PropTypes) {
|
|
20
|
-
const { fetch, error } = props;
|
|
29
|
+
const { fetch, error, size = 'small' } = props;
|
|
21
30
|
const disabledLiquiditySources = useAppStore().getDisabledLiquiditySources();
|
|
22
31
|
const toggleAllLiquiditySources = useAppStore().toggleAllLiquiditySources;
|
|
23
32
|
|
|
24
33
|
const swappers = useAppStore().swappers();
|
|
25
|
-
|
|
26
34
|
const info = makeInfo(
|
|
27
35
|
error,
|
|
28
36
|
disabledLiquiditySources,
|
|
@@ -32,27 +40,30 @@ export function NoResult(props: PropTypes) {
|
|
|
32
40
|
|
|
33
41
|
return (
|
|
34
42
|
<Container>
|
|
35
|
-
<NoRouteIcon size={
|
|
43
|
+
<NoRouteIcon size={NoRouteIconSize[size]} color="gray" />
|
|
36
44
|
<Divider size={4} />
|
|
37
|
-
<Typography variant="title" size=
|
|
45
|
+
<Typography variant="title" size={NoRouteTitleSize[size]}>
|
|
38
46
|
{errorMessages().noResultError.title}
|
|
39
47
|
</Typography>
|
|
48
|
+
{size === 'large' && <Divider size={4} />}
|
|
40
49
|
{!!info.description && (
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
<ErrorDescription size={size}>
|
|
51
|
+
<Typography
|
|
52
|
+
variant="body"
|
|
53
|
+
size="small"
|
|
54
|
+
align="center"
|
|
55
|
+
color="neutral700">
|
|
56
|
+
{info.description}
|
|
57
|
+
</Typography>
|
|
58
|
+
</ErrorDescription>
|
|
48
59
|
)}
|
|
49
|
-
<Divider size={4} />
|
|
60
|
+
<Divider size={size === 'large' ? '24' : '4'} />
|
|
50
61
|
{!!info.alert && (
|
|
51
|
-
<Footer>
|
|
62
|
+
<Footer size={size}>
|
|
52
63
|
<Alert
|
|
53
64
|
type={info.alert.type}
|
|
54
65
|
title={info.alert.text}
|
|
55
|
-
titleAlign={'
|
|
66
|
+
titleAlign={'left'}
|
|
56
67
|
action={
|
|
57
68
|
info.alert.action && (
|
|
58
69
|
<Button
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { styled } from '@rango-dev/ui';
|
|
1
|
+
import { darkTheme, ListItemButton, styled } from '@rango-dev/ui';
|
|
2
2
|
|
|
3
3
|
export const Container = styled('div', {
|
|
4
4
|
padding: '$10',
|
|
@@ -17,6 +17,19 @@ export const List = styled('ul', {
|
|
|
17
17
|
},
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
+
export const ListItem = styled(ListItemButton, {
|
|
21
|
+
variants: {
|
|
22
|
+
actionRequired: {
|
|
23
|
+
true: {
|
|
24
|
+
backgroundColor: '$error300',
|
|
25
|
+
[`.${darkTheme} &`]: {
|
|
26
|
+
backgroundColor: '$error600',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
20
33
|
export const Images = styled('div', {
|
|
21
34
|
display: 'flex',
|
|
22
35
|
padding: 0,
|
|
@@ -5,7 +5,7 @@ import { EventSeverity } from '@rango-dev/queue-manager-rango-preset';
|
|
|
5
5
|
import {
|
|
6
6
|
ChainToken,
|
|
7
7
|
ChevronRightIcon,
|
|
8
|
-
|
|
8
|
+
Divider,
|
|
9
9
|
Typography,
|
|
10
10
|
} from '@rango-dev/ui';
|
|
11
11
|
import React from 'react';
|
|
@@ -16,7 +16,12 @@ import { useAppStore } from '../../store/AppStore';
|
|
|
16
16
|
import { useNotificationStore } from '../../store/notification';
|
|
17
17
|
import { areTokensEqual } from '../../utils/wallets';
|
|
18
18
|
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
Container,
|
|
21
|
+
Images,
|
|
22
|
+
List,
|
|
23
|
+
ListItem,
|
|
24
|
+
} from './NotificationContent.styles';
|
|
20
25
|
import { NotificationNotFound } from './NotificationNotFound';
|
|
21
26
|
|
|
22
27
|
const MAX_NOTIFICATIONS_DISPLAYED = 4;
|
|
@@ -41,7 +46,7 @@ export function NotificationContent() {
|
|
|
41
46
|
<Container>
|
|
42
47
|
{sortedNotification.length ? (
|
|
43
48
|
<List>
|
|
44
|
-
{sortedNotification.map((notificationItem) => {
|
|
49
|
+
{sortedNotification.map((notificationItem, index) => {
|
|
45
50
|
const { route, requestId, event } = notificationItem;
|
|
46
51
|
const fromToken = tokens.find((tokenItem) =>
|
|
47
52
|
areTokensEqual(tokenItem, route.from)
|
|
@@ -60,42 +65,47 @@ export function NotificationContent() {
|
|
|
60
65
|
);
|
|
61
66
|
|
|
62
67
|
return (
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
68
|
+
<React.Fragment key={requestId}>
|
|
69
|
+
{index > 0 && <Divider size={4} />}
|
|
70
|
+
<ListItem
|
|
71
|
+
onClick={() => handleOnClick(requestId)}
|
|
72
|
+
actionRequired={
|
|
73
|
+
event.messageSeverity === EventSeverity.WARNING
|
|
74
|
+
}
|
|
75
|
+
title={
|
|
76
|
+
<Typography
|
|
77
|
+
variant="body"
|
|
78
|
+
size="small"
|
|
79
|
+
color={
|
|
80
|
+
event.messageSeverity === EventSeverity.WARNING
|
|
81
|
+
? '$foreground'
|
|
82
|
+
: '$neutral700'
|
|
83
|
+
}>
|
|
84
|
+
{i18n.t(event.message)}
|
|
85
|
+
</Typography>
|
|
86
|
+
}
|
|
87
|
+
id={requestId}
|
|
88
|
+
start={
|
|
89
|
+
<Images>
|
|
90
|
+
<div className="from-chain-token">
|
|
91
|
+
<ChainToken
|
|
92
|
+
tokenImage={fromToken ? fromToken.image : ''}
|
|
93
|
+
chainImage={fromBlockchain ? fromBlockchain.logo : ''}
|
|
94
|
+
size="small"
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
97
|
+
<div className="to-chain-token">
|
|
98
|
+
<ChainToken
|
|
99
|
+
tokenImage={toToken ? toToken.image : ''}
|
|
100
|
+
chainImage={toBlockchain ? toBlockchain.logo : ''}
|
|
101
|
+
size="small"
|
|
102
|
+
/>
|
|
103
|
+
</div>
|
|
104
|
+
</Images>
|
|
105
|
+
}
|
|
106
|
+
end={<ChevronRightIcon size={12} color="gray" />}
|
|
107
|
+
/>
|
|
108
|
+
</React.Fragment>
|
|
99
109
|
);
|
|
100
110
|
})}
|
|
101
111
|
</List>
|
|
@@ -55,19 +55,6 @@ export const QuoteContainer = styled(Collapsible.Root, {
|
|
|
55
55
|
backgroundColor: '$$color',
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
|
-
{
|
|
59
|
-
listItem: true,
|
|
60
|
-
selected: false,
|
|
61
|
-
css: {
|
|
62
|
-
cursor: 'pointer',
|
|
63
|
-
'&:hover': {
|
|
64
|
-
backgroundColor: '$neutral300',
|
|
65
|
-
[`.${darkTheme} &`]: {
|
|
66
|
-
backgroundColor: '$neutral400',
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
58
|
],
|
|
72
59
|
});
|
|
73
60
|
|
|
@@ -107,6 +94,18 @@ export const SummaryContainer = styled('div', {
|
|
|
107
94
|
},
|
|
108
95
|
backgroundColor: '$$color',
|
|
109
96
|
'&:hover': {
|
|
97
|
+
'& .quote_container': {
|
|
98
|
+
'& button': {
|
|
99
|
+
backgroundColor: '$neutral500',
|
|
100
|
+
[`.${darkTheme} &`]: {
|
|
101
|
+
backgroundColor: '$neutral200',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
backgroundColor: '$neutral500',
|
|
105
|
+
[`.${darkTheme} &`]: {
|
|
106
|
+
backgroundColor: '$neutral200',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
110
109
|
backgroundColor: '$neutral300',
|
|
111
110
|
[`.${darkTheme} &`]: {
|
|
112
111
|
backgroundColor: '$neutral400',
|
|
@@ -376,6 +375,6 @@ export const Line = styled('div', {
|
|
|
376
375
|
borderTopColor: '$neutral',
|
|
377
376
|
margin: '$5 0',
|
|
378
377
|
[`.${darkTheme} &`]: {
|
|
379
|
-
borderTopColor: '$
|
|
378
|
+
borderTopColor: '$neutral800',
|
|
380
379
|
},
|
|
381
380
|
});
|
|
@@ -6,6 +6,7 @@ import { i18n } from '@lingui/core';
|
|
|
6
6
|
import {
|
|
7
7
|
Alert,
|
|
8
8
|
Divider,
|
|
9
|
+
FullExpandedQuote,
|
|
9
10
|
InfoIcon,
|
|
10
11
|
QuoteTag,
|
|
11
12
|
StepDetails,
|
|
@@ -33,7 +34,7 @@ import {
|
|
|
33
34
|
} from '../../containers/QuoteInfo/QuoteInfo.styles';
|
|
34
35
|
import { useAppStore } from '../../store/AppStore';
|
|
35
36
|
import { QuoteErrorType, QuoteWarningType } from '../../types';
|
|
36
|
-
import { getContainer } from '../../utils/common';
|
|
37
|
+
import { getContainer, getExpanded } from '../../utils/common';
|
|
37
38
|
import {
|
|
38
39
|
getBlockchainShortNameFor,
|
|
39
40
|
getSwapperDisplayName,
|
|
@@ -83,6 +84,7 @@ export function Quote(props: QuoteProps) {
|
|
|
83
84
|
tagHidden = true,
|
|
84
85
|
showModalFee = true,
|
|
85
86
|
onClickAllRoutes,
|
|
87
|
+
fullExpandedMode = false,
|
|
86
88
|
} = props;
|
|
87
89
|
const blockchains = useAppStore().blockchains();
|
|
88
90
|
const tokens = useAppStore().tokens();
|
|
@@ -298,157 +300,176 @@ export function Quote(props: QuoteProps) {
|
|
|
298
300
|
GAS_FEE_MAX_DECIMALS
|
|
299
301
|
);
|
|
300
302
|
|
|
301
|
-
|
|
302
|
-
<>
|
|
303
|
-
<SummaryContainer
|
|
304
|
-
selected={selected}
|
|
305
|
-
listItem={type === 'list-item'}
|
|
306
|
-
basic={type === 'basic'}>
|
|
307
|
-
<div className={summaryStyles()}>
|
|
308
|
-
{!tagHidden && sortedQuoteTags.length ? (
|
|
309
|
-
<>
|
|
310
|
-
<TagContainer>
|
|
311
|
-
{sortedQuoteTags.map((tag, index) => {
|
|
312
|
-
const key = `${tag.value}_${index}`;
|
|
313
|
-
return (
|
|
314
|
-
<>
|
|
315
|
-
<QuoteTag label={tag.label} key={key} value={tag.value} />
|
|
316
|
-
<Divider size={4} direction="horizontal" />
|
|
317
|
-
</>
|
|
318
|
-
);
|
|
319
|
-
})}
|
|
320
|
-
</TagContainer>
|
|
321
|
-
<Line />
|
|
322
|
-
{!showAllRoutesButton && <Divider size={4} />}
|
|
323
|
-
</>
|
|
324
|
-
) : null}
|
|
325
|
-
<div id="portal-root" className={summaryHeaderStyles()}>
|
|
326
|
-
<QuoteCostDetails
|
|
327
|
-
quote={quote}
|
|
328
|
-
time={totalTime}
|
|
329
|
-
fee={fee}
|
|
330
|
-
feeWarning={totalFee.gte(new BigNumber(GAS_FEE_MAX))}
|
|
331
|
-
showModalFee={showModalFee}
|
|
332
|
-
steps={numberOfSteps}
|
|
333
|
-
/>
|
|
303
|
+
const feeWarning = totalFee.gte(new BigNumber(GAS_FEE_MAX));
|
|
334
304
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
}
|
|
368
|
-
</
|
|
369
|
-
|
|
370
|
-
|
|
305
|
+
return fullExpandedMode ? (
|
|
306
|
+
<FullExpandedQuote
|
|
307
|
+
selected={selected}
|
|
308
|
+
fee={fee}
|
|
309
|
+
time={totalTime}
|
|
310
|
+
tooltipContainer={getExpanded()}
|
|
311
|
+
steps={steps}
|
|
312
|
+
tags={sortedQuoteTags}
|
|
313
|
+
feeWarning={feeWarning}
|
|
314
|
+
percentageChange={percentageChange}
|
|
315
|
+
warningLevel={priceImpactWarningLevel}
|
|
316
|
+
outputPrice={{
|
|
317
|
+
value: roundedOutput,
|
|
318
|
+
usdValue: roundedOutputUsdValue,
|
|
319
|
+
realValue: formatTooltipNumbers(output.value),
|
|
320
|
+
realUsdValue: formatTooltipNumbers(output.usdValue),
|
|
321
|
+
}}
|
|
322
|
+
/>
|
|
323
|
+
) : (
|
|
324
|
+
<SummaryContainer
|
|
325
|
+
selected={selected}
|
|
326
|
+
listItem={type === 'list-item'}
|
|
327
|
+
basic={type === 'basic'}>
|
|
328
|
+
<div className={summaryStyles()}>
|
|
329
|
+
{!tagHidden && sortedQuoteTags.length ? (
|
|
330
|
+
<>
|
|
331
|
+
<TagContainer>
|
|
332
|
+
{sortedQuoteTags.map((tag, index) => {
|
|
333
|
+
const key = `${tag.value}_${index}`;
|
|
334
|
+
return (
|
|
335
|
+
<React.Fragment key={key}>
|
|
336
|
+
<QuoteTag label={tag.label} value={tag.value} />
|
|
337
|
+
<Divider size={4} direction="horizontal" />
|
|
338
|
+
</React.Fragment>
|
|
339
|
+
);
|
|
340
|
+
})}
|
|
341
|
+
</TagContainer>
|
|
342
|
+
<Line />
|
|
343
|
+
{!showAllRoutesButton && <Divider size={4} />}
|
|
344
|
+
</>
|
|
345
|
+
) : null}
|
|
346
|
+
<div id="portal-root" className={summaryHeaderStyles()}>
|
|
347
|
+
<QuoteCostDetails
|
|
348
|
+
quote={quote}
|
|
349
|
+
time={totalTime}
|
|
350
|
+
fee={fee}
|
|
351
|
+
feeWarning={feeWarning}
|
|
352
|
+
showModalFee={showModalFee}
|
|
353
|
+
steps={numberOfSteps}
|
|
354
|
+
/>
|
|
355
|
+
|
|
356
|
+
{showAllRoutesButton && (
|
|
357
|
+
<AllRoutesButton
|
|
358
|
+
onClick={(e) => {
|
|
359
|
+
e.stopPropagation();
|
|
360
|
+
onClickAllRoutes();
|
|
361
|
+
}}
|
|
362
|
+
size="xxsmall"
|
|
363
|
+
type="secondary"
|
|
364
|
+
variant="default">
|
|
365
|
+
<Typography color="secondary" variant="label" size="medium">
|
|
366
|
+
{i18n.t('See All Routes')}
|
|
367
|
+
</Typography>
|
|
368
|
+
</AllRoutesButton>
|
|
369
|
+
)}
|
|
370
|
+
</div>
|
|
371
|
+
{type === 'basic' && (
|
|
372
|
+
<div className={basicInfoStyles()}>
|
|
373
|
+
<FrameIcon>
|
|
374
|
+
<InfoIcon size={12} color="gray" />
|
|
375
|
+
</FrameIcon>
|
|
376
|
+
<ContainerInfoOutput>
|
|
377
|
+
<BasicInfoOutput size="small" variant="body">
|
|
378
|
+
{`${roundedInput} ${steps[0].from.token.displayName} = `}
|
|
379
|
+
</BasicInfoOutput>
|
|
371
380
|
<Tooltip
|
|
372
|
-
content={formatTooltipNumbers(output.
|
|
381
|
+
content={formatTooltipNumbers(output.value)}
|
|
373
382
|
container={container}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
variant="body">
|
|
382
|
-
{`($${roundedOutputUsdValue})`}
|
|
383
|
-
</Typography>
|
|
383
|
+
open={!output.value ? false : undefined}>
|
|
384
|
+
<BasicInfoOutput size="small" variant="body">
|
|
385
|
+
|
|
386
|
+
{`${roundedOutput} ${
|
|
387
|
+
steps[steps.length - 1].to.token.displayName
|
|
388
|
+
}`}
|
|
389
|
+
</BasicInfoOutput>
|
|
384
390
|
</Tooltip>
|
|
385
|
-
</
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
391
|
+
</ContainerInfoOutput>
|
|
392
|
+
<Tooltip
|
|
393
|
+
content={formatTooltipNumbers(output.usdValue)}
|
|
394
|
+
container={container}
|
|
395
|
+
style={{
|
|
396
|
+
display: 'flex',
|
|
397
|
+
}}>
|
|
398
|
+
<Typography
|
|
399
|
+
color="$neutral600"
|
|
400
|
+
ml={2}
|
|
401
|
+
size="xsmall"
|
|
402
|
+
variant="body">
|
|
403
|
+
{`($${roundedOutputUsdValue})`}
|
|
404
|
+
</Typography>
|
|
405
|
+
</Tooltip>
|
|
406
|
+
</div>
|
|
407
|
+
)}
|
|
408
|
+
{type === 'list-item' && (
|
|
409
|
+
<TokenAmount
|
|
410
|
+
tooltipContainer={container}
|
|
411
|
+
type="output"
|
|
412
|
+
direction="vertical"
|
|
413
|
+
price={{
|
|
414
|
+
value: roundedOutput,
|
|
415
|
+
usdValue: roundedOutputUsdValue,
|
|
416
|
+
realValue: formatTooltipNumbers(output.value),
|
|
417
|
+
realUsdValue: formatTooltipNumbers(output.usdValue),
|
|
418
|
+
}}
|
|
419
|
+
token={{
|
|
420
|
+
displayName: steps[numberOfSteps - 1].to.token.displayName,
|
|
421
|
+
image: steps[numberOfSteps - 1].to.token.image,
|
|
422
|
+
}}
|
|
423
|
+
chain={{ image: steps[numberOfSteps - 1].to.chain.image }}
|
|
424
|
+
percentageChange={percentageChange}
|
|
425
|
+
warningLevel={priceImpactWarningLevel}
|
|
426
|
+
/>
|
|
427
|
+
)}
|
|
428
|
+
{type === 'swap-preview' && (
|
|
429
|
+
<>
|
|
430
|
+
<QuoteSummary
|
|
431
|
+
from={steps[0].from}
|
|
432
|
+
to={steps[numberOfSteps - 1].to}
|
|
403
433
|
percentageChange={percentageChange}
|
|
404
434
|
warningLevel={priceImpactWarningLevel}
|
|
405
435
|
/>
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
<QuoteContainer
|
|
436
|
+
<Divider size={4} />
|
|
437
|
+
</>
|
|
438
|
+
)}
|
|
439
|
+
</div>
|
|
440
|
+
<QuoteContainer
|
|
441
|
+
selected={selected}
|
|
442
|
+
listItem={type === 'list-item'}
|
|
443
|
+
open={expanded}
|
|
444
|
+
className="quote_container"
|
|
445
|
+
onOpenChange={setExpanded}>
|
|
446
|
+
<QuoteTrigger
|
|
447
|
+
type={type}
|
|
448
|
+
quoteRef={quoteRef}
|
|
420
449
|
selected={selected}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
/>
|
|
446
|
-
);
|
|
447
|
-
})}
|
|
448
|
-
</div>
|
|
449
|
-
</Content>
|
|
450
|
-
</QuoteContainer>
|
|
451
|
-
</SummaryContainer>
|
|
452
|
-
</>
|
|
450
|
+
setExpanded={setExpanded}
|
|
451
|
+
expanded={expanded}
|
|
452
|
+
steps={steps}
|
|
453
|
+
/>
|
|
454
|
+
<Content open={expanded}>
|
|
455
|
+
<HorizontalSeparator />
|
|
456
|
+
<div className={stepsDetailsStyles()}>
|
|
457
|
+
{steps.map((step, index) => {
|
|
458
|
+
const key = `item-${index}`;
|
|
459
|
+
return (
|
|
460
|
+
<StepDetails
|
|
461
|
+
type="quote-details"
|
|
462
|
+
key={key}
|
|
463
|
+
tooltipContainer={container}
|
|
464
|
+
step={step}
|
|
465
|
+
hasSeparator={index !== steps.length - 1}
|
|
466
|
+
state={step.state}
|
|
467
|
+
/>
|
|
468
|
+
);
|
|
469
|
+
})}
|
|
470
|
+
</div>
|
|
471
|
+
</Content>
|
|
472
|
+
</QuoteContainer>
|
|
473
|
+
</SummaryContainer>
|
|
453
474
|
);
|
|
454
475
|
}
|