@rango-dev/widget-embedded 0.23.1-next.12 → 0.23.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.
Files changed (42) hide show
  1. package/dist/components/NoResult/NoResult.d.ts.map +1 -1
  2. package/dist/components/NoResult/NoResult.helpers.d.ts +8 -0
  3. package/dist/components/NoResult/NoResult.helpers.d.ts.map +1 -1
  4. package/dist/components/NoResult/NoResult.styles.d.ts +167 -1
  5. package/dist/components/NoResult/NoResult.styles.d.ts.map +1 -1
  6. package/dist/components/NoResult/NoResult.types.d.ts +1 -0
  7. package/dist/components/NoResult/NoResult.types.d.ts.map +1 -1
  8. package/dist/components/Quote/Quote.d.ts.map +1 -1
  9. package/dist/components/Quote/Quote.types.d.ts +1 -0
  10. package/dist/components/Quote/Quote.types.d.ts.map +1 -1
  11. package/dist/components/Quotes/Quotes.d.ts.map +1 -1
  12. package/dist/components/Quotes/Quotes.types.d.ts +1 -0
  13. package/dist/components/Quotes/Quotes.types.d.ts.map +1 -1
  14. package/dist/containers/ExpandedQuotes/ExpandedQuotes.d.ts.map +1 -1
  15. package/dist/containers/ExpandedQuotes/ExpandedQuotes.styles.d.ts +3 -1
  16. package/dist/containers/ExpandedQuotes/ExpandedQuotes.styles.d.ts.map +1 -1
  17. package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
  18. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +1 -0
  19. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
  20. package/dist/index.js +2 -2
  21. package/dist/index.js.map +3 -3
  22. package/dist/pages/Home.d.ts.map +1 -1
  23. package/dist/types/config.d.ts +3 -2
  24. package/dist/types/config.d.ts.map +1 -1
  25. package/dist/utils/configs.d.ts +2 -1
  26. package/dist/utils/configs.d.ts.map +1 -1
  27. package/package.json +2 -2
  28. package/src/components/NoResult/NoResult.helpers.ts +13 -0
  29. package/src/components/NoResult/NoResult.styles.ts +19 -1
  30. package/src/components/NoResult/NoResult.tsx +27 -16
  31. package/src/components/NoResult/NoResult.types.ts +1 -0
  32. package/src/components/Quote/Quote.tsx +162 -145
  33. package/src/components/Quote/Quote.types.ts +1 -0
  34. package/src/components/Quotes/Quotes.tsx +17 -7
  35. package/src/components/Quotes/Quotes.types.ts +1 -0
  36. package/src/containers/ExpandedQuotes/ExpandedQuotes.styles.ts +12 -0
  37. package/src/containers/ExpandedQuotes/ExpandedQuotes.tsx +5 -0
  38. package/src/containers/QuoteInfo/QuoteInfo.tsx +2 -0
  39. package/src/containers/QuoteInfo/QuoteInfo.types.ts +1 -0
  40. package/src/pages/Home.tsx +2 -1
  41. package/src/types/config.ts +3 -2
  42. package/src/utils/configs.ts +5 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../../src/pages/Home.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AA2BnD,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD,wBAAgB,IAAI,sBAsLnB"}
1
+ {"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../../src/pages/Home.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AA4BnD,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD,wBAAgB,IAAI,sBAsLnB"}
@@ -2,7 +2,7 @@ import type { Language } from '@rango-dev/ui';
2
2
  import type { ProviderInterface } from '@rango-dev/wallets-react';
3
3
  import type { WalletType } from '@rango-dev/wallets-shared';
4
4
  import type { Asset } from 'rango-sdk';
5
- export type WidgetVariant = 'default' | 'expandable';
5
+ export type WidgetVariant = 'default' | 'expanded' | 'full-expanded';
6
6
  /**
7
7
  * The above type defines a set of optional color properties for a widget.
8
8
  * @property {string} background
@@ -170,7 +170,8 @@ export type Features = Partial<Record<'theme' | 'language' | 'connectWalletButto
170
170
  * - 'language': Visibility state for the language.
171
171
  * - 'experimentalRoute': Enablement state for the experimental route.
172
172
  * @property {WidgetVariant} variant
173
- * If it is expandable, multiple routes will show up on the home page;
173
+ * If it is expanded, multiple routes will show up on the home page;
174
+ * If it is full-expanded, multiple routes will show up on the home page with full routes;
174
175
  * if not, you will need to go to a different page to see the suggested routes.
175
176
  */
176
177
  export type WidgetConfig = {
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,YAAY,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,YAAY,CAAC;AAClD,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,YAAY,CAAC;QAAC,IAAI,CAAC,EAAE,YAAY,CAAA;KAAE,CAAC;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,KAA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;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,CAC5B,MAAM,CACF,OAAO,GACP,UAAU,GACV,qBAAqB,GACrB,cAAc,GACd,iBAAiB,EACnB,SAAS,GAAG,QAAQ,CACrB,CACF,GACC,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,wBAAwB,CAAC;IAChC,EAAE,CAAC,EAAE,wBAAwB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,CAAC,UAAU,GAAG,iBAAiB,CAAC,EAAE,CAAC;IAC7C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { Tokens } from '../types';
1
+ import type { Tokens, WidgetVariant } from '../types';
2
2
  import type { Asset, BlockchainMeta, Token } from 'rango-sdk';
3
3
  export interface Configs {
4
4
  API_KEY: string;
@@ -19,5 +19,6 @@ export declare const DEFAULT_FONT_FAMILY = "Roboto";
19
19
  export declare const THEME_CLASS_NAME_PREFIX = "theme-widget";
20
20
  export declare const isTokenExcludedInConfig: (token: Token | null, tokensConfig?: TokensConfig) => boolean;
21
21
  export declare const isBlockchainExcludedInConfig: (blockchain: BlockchainMeta | null, blockchainsConfig?: string[]) => boolean | null | undefined;
22
+ export declare const isVarianExpandable: (variant?: WidgetVariant) => boolean;
22
23
  export {};
23
24
  //# sourceMappingURL=configs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../src/utils/configs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAM9D,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,KAAK,YAAY,GACb,KAAK,EAAE,GACP;IACE,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9B,CAAC;AAMN,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,UAE5C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,EAAE,KAAK,EAAE,GAAG,OAIxD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,OAAO,WAS9C;AAED,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAC3C,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AAEtD,eAAO,MAAM,uBAAuB,UAC3B,KAAK,GAAG,IAAI,iBACJ,YAAY,YAe5B,CAAC;AAEF,eAAO,MAAM,4BAA4B,eAC3B,cAAc,GAAG,IAAI,sBACb,MAAM,EAAE,+BAO7B,CAAC"}
1
+ {"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../src/utils/configs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAM9D,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,KAAK,YAAY,GACb,KAAK,EAAE,GACP;IACE,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9B,CAAC;AAMN,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,UAE5C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,EAAE,KAAK,EAAE,GAAG,OAIxD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,OAAO,WAS9C;AAED,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAC3C,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AAEtD,eAAO,MAAM,uBAAuB,UAC3B,KAAK,GAAG,IAAI,iBACJ,YAAY,YAe5B,CAAC;AAEF,eAAO,MAAM,4BAA4B,eAC3B,cAAc,GAAG,IAAI,sBACb,MAAM,EAAE,+BAO7B,CAAC;AAEF,eAAO,MAAM,kBAAkB,aAAc,aAAa,YAEzD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.23.1-next.12",
3
+ "version": "0.23.1-next.13",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -25,7 +25,7 @@
25
25
  "@rango-dev/queue-manager-core": "^0.26.0",
26
26
  "@rango-dev/queue-manager-rango-preset": "^0.28.1-next.3",
27
27
  "@rango-dev/queue-manager-react": "^0.26.0",
28
- "@rango-dev/ui": "^0.29.1-next.9",
28
+ "@rango-dev/ui": "^0.29.1-next.10",
29
29
  "@rango-dev/wallets-react": "^0.14.1-next.1",
30
30
  "@rango-dev/wallets-shared": "^0.28.1-next.1",
31
31
  "bignumber.js": "^9.1.1",
@@ -9,6 +9,9 @@ import {
9
9
  type QuoteRequestFailed,
10
10
  } from '../../types';
11
11
 
12
+ const SMALL_NO_ROUTE__ICON_SIZE = 24;
13
+ const LARGE_NO_ROUTE_ICON_SIZE = 60;
14
+
12
15
  export function makeInfo(
13
16
  error: NoResultError | QuoteRequestFailed | null,
14
17
  disabledLiquiditySources: string[],
@@ -57,3 +60,13 @@ export function makeInfo(
57
60
  description: errorMessages().noResultError.description,
58
61
  };
59
62
  }
63
+
64
+ export enum NoRouteIconSize {
65
+ small = SMALL_NO_ROUTE__ICON_SIZE,
66
+ large = LARGE_NO_ROUTE_ICON_SIZE,
67
+ }
68
+
69
+ export enum NoRouteTitleSize {
70
+ small = 'small',
71
+ large = 'medium',
72
+ }
@@ -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 = {
@@ -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,172 @@ 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
+ return fullExpandedMode ? (
304
+ <FullExpandedQuote
305
+ selected={selected}
306
+ fee={fee}
307
+ time={totalTime}
308
+ tooltipContainer={getExpanded()}
309
+ steps={steps}
310
+ tags={sortedQuoteTags}
311
+ percentageChange={percentageChange}
312
+ warningLevel={priceImpactWarningLevel}
313
+ outputPrice={{
314
+ value: roundedOutput,
315
+ usdValue: roundedOutputUsdValue,
316
+ realValue: formatTooltipNumbers(output.value),
317
+ realUsdValue: formatTooltipNumbers(output.usdValue),
318
+ }}
319
+ />
320
+ ) : (
321
+ <SummaryContainer
322
+ selected={selected}
323
+ listItem={type === 'list-item'}
324
+ basic={type === 'basic'}>
325
+ <div className={summaryStyles()}>
326
+ {!tagHidden && sortedQuoteTags.length ? (
327
+ <>
328
+ <TagContainer>
329
+ {sortedQuoteTags.map((tag, index) => {
330
+ const key = `${tag.value}_${index}`;
331
+ return (
332
+ <>
333
+ <QuoteTag label={tag.label} key={key} value={tag.value} />
334
+ <Divider size={4} direction="horizontal" />
335
+ </>
336
+ );
337
+ })}
338
+ </TagContainer>
339
+ <Line />
340
+ {!showAllRoutesButton && <Divider size={4} />}
341
+ </>
342
+ ) : null}
343
+ <div id="portal-root" className={summaryHeaderStyles()}>
344
+ <QuoteCostDetails
345
+ quote={quote}
346
+ time={totalTime}
347
+ fee={fee}
348
+ feeWarning={totalFee.gte(new BigNumber(GAS_FEE_MAX))}
349
+ showModalFee={showModalFee}
350
+ steps={numberOfSteps}
351
+ />
334
352
 
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>
353
+ {showAllRoutesButton && (
354
+ <AllRoutesButton
355
+ onClick={(e) => {
356
+ e.stopPropagation();
357
+ onClickAllRoutes();
358
+ }}
359
+ size="xxsmall"
360
+ type="secondary"
361
+ variant="default">
362
+ <Typography color="secondary" variant="label" size="medium">
363
+ {i18n.t('See All Routes')}
364
+ </Typography>
365
+ </AllRoutesButton>
366
+ )}
367
+ </div>
368
+ {type === 'basic' && (
369
+ <div className={basicInfoStyles()}>
370
+ <FrameIcon>
371
+ <InfoIcon size={12} color="gray" />
372
+ </FrameIcon>
373
+ <ContainerInfoOutput>
374
+ <BasicInfoOutput size="small" variant="body">
375
+ {`${roundedInput} ${steps[0].from.token.displayName} = `}
376
+ </BasicInfoOutput>
371
377
  <Tooltip
372
- content={formatTooltipNumbers(output.usdValue)}
378
+ content={formatTooltipNumbers(output.value)}
373
379
  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>
380
+ open={!output.value ? false : undefined}>
381
+ <BasicInfoOutput size="small" variant="body">
382
+ &nbsp;
383
+ {`${roundedOutput} ${
384
+ steps[steps.length - 1].to.token.displayName
385
+ }`}
386
+ </BasicInfoOutput>
384
387
  </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 }}
388
+ </ContainerInfoOutput>
389
+ <Tooltip
390
+ content={formatTooltipNumbers(output.usdValue)}
391
+ container={container}
392
+ style={{
393
+ display: 'flex',
394
+ }}>
395
+ <Typography
396
+ color="$neutral600"
397
+ ml={2}
398
+ size="xsmall"
399
+ variant="body">
400
+ {`($${roundedOutputUsdValue})`}
401
+ </Typography>
402
+ </Tooltip>
403
+ </div>
404
+ )}
405
+ {type === 'list-item' && (
406
+ <TokenAmount
407
+ tooltipContainer={container}
408
+ type="output"
409
+ direction="vertical"
410
+ price={{
411
+ value: roundedOutput,
412
+ usdValue: roundedOutputUsdValue,
413
+ realValue: formatTooltipNumbers(output.value),
414
+ realUsdValue: formatTooltipNumbers(output.usdValue),
415
+ }}
416
+ token={{
417
+ displayName: steps[numberOfSteps - 1].to.token.displayName,
418
+ image: steps[numberOfSteps - 1].to.token.image,
419
+ }}
420
+ chain={{ image: steps[numberOfSteps - 1].to.chain.image }}
421
+ percentageChange={percentageChange}
422
+ warningLevel={priceImpactWarningLevel}
423
+ />
424
+ )}
425
+ {type === 'swap-preview' && (
426
+ <>
427
+ <QuoteSummary
428
+ from={steps[0].from}
429
+ to={steps[numberOfSteps - 1].to}
403
430
  percentageChange={percentageChange}
404
431
  warningLevel={priceImpactWarningLevel}
405
432
  />
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
433
+ <Divider size={4} />
434
+ </>
435
+ )}
436
+ </div>
437
+ <QuoteContainer
438
+ selected={selected}
439
+ listItem={type === 'list-item'}
440
+ open={expanded}
441
+ onOpenChange={setExpanded}>
442
+ <QuoteTrigger
443
+ type={type}
444
+ quoteRef={quoteRef}
420
445
  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
- </>
446
+ setExpanded={setExpanded}
447
+ expanded={expanded}
448
+ steps={steps}
449
+ />
450
+ <Content open={expanded}>
451
+ <HorizontalSeparator />
452
+ <div className={stepsDetailsStyles()}>
453
+ {steps.map((step, index) => {
454
+ const key = `item-${index}`;
455
+ return (
456
+ <StepDetails
457
+ type="quote-details"
458
+ key={key}
459
+ tooltipContainer={container}
460
+ step={step}
461
+ hasSeparator={index !== steps.length - 1}
462
+ state={step.state}
463
+ />
464
+ );
465
+ })}
466
+ </div>
467
+ </Content>
468
+ </QuoteContainer>
469
+ </SummaryContainer>
453
470
  );
454
471
  }
@@ -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 = {
@@ -2,7 +2,7 @@ import type { PropTypes } from './Quotes.types';
2
2
  import type { MultiRouteSimulationResult } from 'rango-sdk';
3
3
 
4
4
  import { i18n } from '@lingui/core';
5
- import { Divider, Typography } from '@rango-dev/ui';
5
+ import { Divider, FullExpandedQuote, Typography } from '@rango-dev/ui';
6
6
  import React from 'react';
7
7
 
8
8
  import { QuoteInfo } from '../../containers/QuoteInfo';
@@ -26,6 +26,7 @@ export function Quotes(props: PropTypes) {
26
26
  fetch,
27
27
  showModalFee,
28
28
  hasSort = true,
29
+ fullExpandedMode = false,
29
30
  } = props;
30
31
  const {
31
32
  selectedQuote,
@@ -69,11 +70,15 @@ export function Quotes(props: PropTypes) {
69
70
  {loading &&
70
71
  Array.from({ length: ITEM_SKELETON_COUNT }, (_, index) => (
71
72
  <React.Fragment key={index}>
72
- <QuoteSkeleton
73
- tagHidden={false}
74
- type="list-item"
75
- expanded={false}
76
- />
73
+ {fullExpandedMode ? (
74
+ <FullExpandedQuote loading />
75
+ ) : (
76
+ <QuoteSkeleton
77
+ tagHidden={false}
78
+ type="list-item"
79
+ expanded={false}
80
+ />
81
+ )}
77
82
  <Divider size={16} />
78
83
  </React.Fragment>
79
84
  ))}
@@ -106,6 +111,7 @@ export function Quotes(props: PropTypes) {
106
111
  loading={loading}
107
112
  error={quoteError?.options || null}
108
113
  warning={quoteWarning}
114
+ fullExpandedMode={fullExpandedMode}
109
115
  onClick={(quote) => {
110
116
  if (!quoteError) {
111
117
  updateQuotePartialState('warning', quoteWarning);
@@ -124,7 +130,11 @@ export function Quotes(props: PropTypes) {
124
130
  })
125
131
  : showNoResultMessage && (
126
132
  <ErrorsContainer>
127
- <NoResult error={error} fetch={fetch} />
133
+ <NoResult
134
+ size={fullExpandedMode ? 'large' : 'small'}
135
+ error={error}
136
+ fetch={fetch}
137
+ />
128
138
  </ErrorsContainer>
129
139
  )}
130
140
  </>
@@ -6,4 +6,5 @@ export type PropTypes = {
6
6
  fetch: (shouldChangeSelectedQuote?: boolean) => void;
7
7
  showModalFee?: boolean;
8
8
  hasSort?: boolean;
9
+ fullExpandedMode?: boolean;
9
10
  };
@@ -10,6 +10,18 @@ export const Container = styled('div', {
10
10
  [`.${darkTheme} &`]: {
11
11
  backgroundColor: '$neutral300',
12
12
  },
13
+
14
+ variants: {
15
+ expandMode: {
16
+ default: {
17
+ width: '390px',
18
+ },
19
+ full: {
20
+ width: '719px',
21
+ },
22
+ },
23
+ },
24
+
13
25
  '&.is-hidden': {
14
26
  width: 0,
15
27
  opacity: 0,