@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.
Files changed (134) hide show
  1. package/dist/components/AppRoutes.d.ts.map +1 -1
  2. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +1 -283
  3. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
  4. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
  5. package/dist/components/HeaderButtons/HeaderButtons.d.ts.map +1 -1
  6. package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +489 -1
  7. package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -1
  8. package/dist/components/HeaderButtons/InProgressTransactionBadge.d.ts +4 -0
  9. package/dist/components/HeaderButtons/InProgressTransactionBadge.d.ts.map +1 -0
  10. package/dist/components/HeaderButtons/RefreshButton.d.ts.map +1 -1
  11. package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts.map +1 -1
  12. package/dist/components/HeaderButtons/WalletButton.d.ts.map +1 -1
  13. package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
  14. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +1 -1
  15. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -1
  16. package/dist/components/NoResult/NoResult.d.ts.map +1 -1
  17. package/dist/components/NoResult/NoResult.helpers.d.ts +8 -0
  18. package/dist/components/NoResult/NoResult.helpers.d.ts.map +1 -1
  19. package/dist/components/NoResult/NoResult.styles.d.ts +167 -1
  20. package/dist/components/NoResult/NoResult.styles.d.ts.map +1 -1
  21. package/dist/components/NoResult/NoResult.types.d.ts +1 -0
  22. package/dist/components/NoResult/NoResult.types.d.ts.map +1 -1
  23. package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
  24. package/dist/components/NotificationContent/NotificationContent.styles.d.ts +165 -0
  25. package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -1
  26. package/dist/components/Quote/Quote.d.ts.map +1 -1
  27. package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
  28. package/dist/components/Quote/Quote.types.d.ts +1 -0
  29. package/dist/components/Quote/Quote.types.d.ts.map +1 -1
  30. package/dist/components/Quote/QuoteTrigger.d.ts.map +1 -1
  31. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts.map +1 -1
  32. package/dist/components/Quotes/Quotes.d.ts.map +1 -1
  33. package/dist/components/Quotes/Quotes.types.d.ts +1 -0
  34. package/dist/components/Quotes/Quotes.types.d.ts.map +1 -1
  35. package/dist/components/Quotes/SelectStrategy.d.ts.map +1 -1
  36. package/dist/components/Slippage/Slippage.d.ts.map +1 -1
  37. package/dist/components/TokenList/TokenList.d.ts.map +1 -1
  38. package/dist/components/common/ActivateTabAlert/ActivateTabAlert.d.ts.map +1 -1
  39. package/dist/constants/navigationRoutes.d.ts +0 -1
  40. package/dist/constants/navigationRoutes.d.ts.map +1 -1
  41. package/dist/constants/settings.d.ts +6 -0
  42. package/dist/constants/settings.d.ts.map +1 -0
  43. package/dist/containers/App/App.styles.d.ts.map +1 -1
  44. package/dist/containers/ExpandedQuotes/ExpandedQuotes.d.ts.map +1 -1
  45. package/dist/containers/ExpandedQuotes/ExpandedQuotes.styles.d.ts +3 -1
  46. package/dist/containers/ExpandedQuotes/ExpandedQuotes.styles.d.ts.map +1 -1
  47. package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
  48. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +1 -0
  49. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
  50. package/dist/containers/Settings/Lists.d.ts +3 -0
  51. package/dist/containers/Settings/Lists.d.ts.map +1 -0
  52. package/dist/hooks/useScreenDetect.d.ts +9 -0
  53. package/dist/hooks/useScreenDetect.d.ts.map +1 -0
  54. package/dist/hooks/useSwapInput.d.ts.map +1 -1
  55. package/dist/index.js +2 -2
  56. package/dist/index.js.map +4 -4
  57. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  58. package/dist/pages/Home.d.ts.map +1 -1
  59. package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
  60. package/dist/pages/SettingsPage.d.ts.map +1 -1
  61. package/dist/store/slices/data.d.ts.map +1 -1
  62. package/dist/store/slices/settings.d.ts.map +1 -1
  63. package/dist/types/config.d.ts +9 -5
  64. package/dist/types/config.d.ts.map +1 -1
  65. package/dist/utils/colors.d.ts +5 -3
  66. package/dist/utils/colors.d.ts.map +1 -1
  67. package/dist/utils/configs.d.ts +2 -1
  68. package/dist/utils/configs.d.ts.map +1 -1
  69. package/dist/utils/swap.d.ts +2 -0
  70. package/dist/utils/swap.d.ts.map +1 -1
  71. package/dist/utils/ui.d.ts +5 -2
  72. package/dist/utils/ui.d.ts.map +1 -1
  73. package/package.json +6 -6
  74. package/src/components/AppRoutes.tsx +0 -5
  75. package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +6 -12
  76. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +7 -11
  77. package/src/components/ConfirmWalletsModal/WalletList.tsx +2 -2
  78. package/src/components/HeaderButtons/HeaderButtons.styles.ts +43 -2
  79. package/src/components/HeaderButtons/HeaderButtons.tsx +2 -0
  80. package/src/components/HeaderButtons/InProgressTransactionBadge.tsx +26 -0
  81. package/src/components/HeaderButtons/RefreshButton.tsx +2 -1
  82. package/src/components/HeaderButtons/UnreadNotificationsBadge.tsx +10 -2
  83. package/src/components/HeaderButtons/WalletButton.tsx +26 -6
  84. package/src/components/Layout/Layout.styles.ts +3 -0
  85. package/src/components/Layout/Layout.tsx +4 -4
  86. package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.ts +1 -1
  87. package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.tsx +4 -4
  88. package/src/components/NoResult/NoResult.helpers.ts +13 -0
  89. package/src/components/NoResult/NoResult.styles.ts +19 -1
  90. package/src/components/NoResult/NoResult.tsx +27 -16
  91. package/src/components/NoResult/NoResult.types.ts +1 -0
  92. package/src/components/NotificationContent/NotificationContent.styles.ts +14 -1
  93. package/src/components/NotificationContent/NotificationContent.tsx +49 -39
  94. package/src/components/Quote/Quote.styles.ts +13 -14
  95. package/src/components/Quote/Quote.tsx +166 -145
  96. package/src/components/Quote/Quote.types.ts +1 -0
  97. package/src/components/Quote/QuoteTrigger.tsx +7 -8
  98. package/src/components/QuoteSkeleton/QuoteSkeleton.styles.ts +1 -1
  99. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +2 -3
  100. package/src/components/Quotes/Quotes.tsx +21 -10
  101. package/src/components/Quotes/Quotes.types.ts +1 -0
  102. package/src/components/Quotes/SelectStrategy.tsx +3 -11
  103. package/src/components/Slippage/Slippage.tsx +11 -13
  104. package/src/components/SwapDetails/SwapDetails.tsx +1 -1
  105. package/src/components/TokenList/TokenList.tsx +9 -8
  106. package/src/components/common/ActivateTabAlert/ActivateTabAlert.tsx +2 -4
  107. package/src/constants/navigationRoutes.ts +0 -1
  108. package/src/constants/settings.ts +5 -0
  109. package/src/containers/App/App.styles.ts +0 -4
  110. package/src/containers/ExpandedQuotes/ExpandedQuotes.styles.ts +13 -0
  111. package/src/containers/ExpandedQuotes/ExpandedQuotes.tsx +5 -0
  112. package/src/containers/QuoteInfo/QuoteInfo.tsx +2 -0
  113. package/src/containers/QuoteInfo/QuoteInfo.types.ts +1 -0
  114. package/src/containers/Settings/Lists.tsx +264 -0
  115. package/src/hooks/useScreenDetect.ts +49 -0
  116. package/src/hooks/useSwapInput.ts +7 -2
  117. package/src/pages/ConfirmSwapPage.tsx +7 -3
  118. package/src/pages/Home.tsx +31 -7
  119. package/src/pages/LiquiditySourcePage.tsx +4 -3
  120. package/src/pages/SettingsPage.tsx +6 -185
  121. package/src/store/slices/config.ts +2 -2
  122. package/src/store/slices/data.ts +8 -5
  123. package/src/store/slices/settings.ts +7 -3
  124. package/src/types/config.ts +9 -5
  125. package/src/utils/colors.ts +106 -75
  126. package/src/utils/configs.ts +12 -1
  127. package/src/utils/swap.ts +11 -0
  128. package/src/utils/ui.ts +7 -5
  129. package/dist/hooks/useMobileDetect.d.ts +0 -3
  130. package/dist/hooks/useMobileDetect.d.ts.map +0 -1
  131. package/dist/pages/ThemePage.d.ts +0 -3
  132. package/dist/pages/ThemePage.d.ts.map +0 -1
  133. package/src/hooks/useMobileDetect.ts +0 -21
  134. 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
- width: '100%',
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 { makeInfo } from './NoResult.helpers';
17
- import { Container, Footer, PrefixIcon } from './NoResult.styles';
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={24} color="gray" />
43
+ <NoRouteIcon size={NoRouteIconSize[size]} color="gray" />
36
44
  <Divider size={4} />
37
- <Typography variant="title" size="small">
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
- <Typography
42
- variant="body"
43
- size="small"
44
- align="center"
45
- color="neutral700">
46
- {info.description}
47
- </Typography>
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={'center'}
66
+ titleAlign={'left'}
56
67
  action={
57
68
  info.alert.action && (
58
69
  <Button
@@ -3,6 +3,7 @@ import type { NoResultError, QuoteRequestFailed } from '../../types';
3
3
  export interface PropTypes {
4
4
  fetch: () => void;
5
5
  error: NoResultError | QuoteRequestFailed | null;
6
+ size?: 'small' | 'large';
6
7
  }
7
8
 
8
9
  type AlertAction = {
@@ -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
- ListItemButton,
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 { Container, Images, List } from './NotificationContent.styles';
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
- <ListItemButton
64
- key={requestId}
65
- onClick={() => handleOnClick(requestId)}
66
- title={
67
- <Typography
68
- variant="body"
69
- size="small"
70
- color={
71
- event.messageSeverity === EventSeverity.WARNING
72
- ? '$foreground'
73
- : '$neutral700'
74
- }>
75
- {i18n.t(event.message)}
76
- </Typography>
77
- }
78
- id={requestId}
79
- start={
80
- <Images>
81
- <div className="from-chain-token">
82
- <ChainToken
83
- tokenImage={fromToken ? fromToken.image : ''}
84
- chainImage={fromBlockchain ? fromBlockchain.logo : ''}
85
- size="small"
86
- />
87
- </div>
88
- <div className="to-chain-token">
89
- <ChainToken
90
- tokenImage={toToken ? toToken.image : ''}
91
- chainImage={toBlockchain ? toBlockchain.logo : ''}
92
- size="small"
93
- />
94
- </div>
95
- </Images>
96
- }
97
- end={<ChevronRightIcon size={12} color="gray" />}
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: '$neutral400',
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
- return (
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
- {showAllRoutesButton && (
336
- <AllRoutesButton
337
- onClick={(e) => {
338
- e.stopPropagation();
339
- onClickAllRoutes();
340
- }}
341
- size="xxsmall"
342
- type="secondary"
343
- variant="default">
344
- <Typography color="secondary" variant="label" size="medium">
345
- {i18n.t('See All Routes')}
346
- </Typography>
347
- </AllRoutesButton>
348
- )}
349
- </div>
350
- {type === 'basic' && (
351
- <div className={basicInfoStyles()}>
352
- <FrameIcon>
353
- <InfoIcon size={12} color="gray" />
354
- </FrameIcon>
355
- <ContainerInfoOutput>
356
- <BasicInfoOutput size="small" variant="body">
357
- {`${roundedInput} ${steps[0].from.token.displayName} = `}
358
- </BasicInfoOutput>
359
- <Tooltip
360
- content={formatTooltipNumbers(output.value)}
361
- container={container}
362
- open={!output.value ? false : undefined}>
363
- <BasicInfoOutput size="small" variant="body">
364
- &nbsp;
365
- {`${roundedOutput} ${
366
- steps[steps.length - 1].to.token.displayName
367
- }`}
368
- </BasicInfoOutput>
369
- </Tooltip>
370
- </ContainerInfoOutput>
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.usdValue)}
381
+ content={formatTooltipNumbers(output.value)}
373
382
  container={container}
374
- style={{
375
- display: 'flex',
376
- }}>
377
- <Typography
378
- color="$neutral600"
379
- ml={2}
380
- size="xsmall"
381
- variant="body">
382
- {`($${roundedOutputUsdValue})`}
383
- </Typography>
383
+ open={!output.value ? false : undefined}>
384
+ <BasicInfoOutput size="small" variant="body">
385
+ &nbsp;
386
+ {`${roundedOutput} ${
387
+ steps[steps.length - 1].to.token.displayName
388
+ }`}
389
+ </BasicInfoOutput>
384
390
  </Tooltip>
385
- </div>
386
- )}
387
- {type === 'list-item' && (
388
- <TokenAmount
389
- tooltipContainer={container}
390
- type="output"
391
- direction="vertical"
392
- price={{
393
- value: roundedOutput,
394
- usdValue: roundedOutputUsdValue,
395
- realValue: formatTooltipNumbers(output.value),
396
- realUsdValue: formatTooltipNumbers(output.usdValue),
397
- }}
398
- token={{
399
- displayName: steps[numberOfSteps - 1].to.token.displayName,
400
- image: steps[numberOfSteps - 1].to.token.image,
401
- }}
402
- chain={{ image: steps[numberOfSteps - 1].to.chain.image }}
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
- {type === 'swap-preview' && (
408
- <>
409
- <QuoteSummary
410
- from={steps[0].from}
411
- to={steps[numberOfSteps - 1].to}
412
- percentageChange={percentageChange}
413
- warningLevel={priceImpactWarningLevel}
414
- />
415
- <Divider size={4} />
416
- </>
417
- )}
418
- </div>
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
- listItem={type === 'list-item'}
422
- open={expanded}
423
- onOpenChange={setExpanded}>
424
- <QuoteTrigger
425
- type={type}
426
- quoteRef={quoteRef}
427
- selected={selected}
428
- setExpanded={setExpanded}
429
- expanded={expanded}
430
- steps={steps}
431
- />
432
- <Content open={expanded}>
433
- <HorizontalSeparator />
434
- <div className={stepsDetailsStyles()}>
435
- {steps.map((step, index) => {
436
- const key = `item-${index}`;
437
- return (
438
- <StepDetails
439
- type="quote-details"
440
- key={key}
441
- tooltipContainer={container}
442
- step={step}
443
- hasSeparator={index !== steps.length - 1}
444
- state={step.state}
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
  }
@@ -14,6 +14,7 @@ export type QuoteProps = {
14
14
  selected?: boolean;
15
15
  showModalFee?: boolean;
16
16
  onClickAllRoutes?: () => void;
17
+ fullExpandedMode?: boolean;
17
18
  };
18
19
 
19
20
  export type optionProps = {