@rango-dev/widget-embedded 0.24.2-next.6 → 0.25.0

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 (50) hide show
  1. package/dist/components/HeaderButtons/HeaderButtons.d.ts.map +1 -1
  2. package/dist/components/HeaderButtons/HeaderButtons.types.d.ts +1 -0
  3. package/dist/components/HeaderButtons/HeaderButtons.types.d.ts.map +1 -1
  4. package/dist/components/Quote/Quote.d.ts.map +1 -1
  5. package/dist/components/Quote/Quote.types.d.ts +3 -0
  6. package/dist/components/Quote/Quote.types.d.ts.map +1 -1
  7. package/dist/components/Quote/QuoteTrigger.d.ts.map +1 -1
  8. package/dist/components/Quotes/Quotes.d.ts.map +1 -1
  9. package/dist/components/Quotes/Quotes.types.d.ts +1 -0
  10. package/dist/components/Quotes/Quotes.types.d.ts.map +1 -1
  11. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
  12. package/dist/components/SwapDetails/SwapDetails.styles.d.ts +325 -0
  13. package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
  14. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.d.ts.map +1 -1
  15. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +328 -0
  16. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -1
  17. package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +162 -0
  18. package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -1
  19. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +2 -1
  20. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -1
  21. package/dist/containers/ExpandedQuotes/ExpandedQuotes.d.ts.map +1 -1
  22. package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
  23. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +1 -0
  24. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
  25. package/dist/hooks/useWalletList.d.ts.map +1 -1
  26. package/dist/index.js +2 -2
  27. package/dist/index.js.map +4 -4
  28. package/dist/pages/WalletsPage.d.ts.map +1 -1
  29. package/dist/utils/wallets.d.ts.map +1 -1
  30. package/package.json +6 -6
  31. package/src/components/HeaderButtons/HeaderButtons.tsx +2 -1
  32. package/src/components/HeaderButtons/HeaderButtons.types.ts +1 -0
  33. package/src/components/Quote/Quote.tsx +3 -1
  34. package/src/components/Quote/Quote.types.ts +3 -0
  35. package/src/components/Quote/QuoteTrigger.tsx +8 -4
  36. package/src/components/Quotes/Quotes.tsx +4 -1
  37. package/src/components/Quotes/Quotes.types.ts +1 -0
  38. package/src/components/SwapDetails/SwapDetails.styles.ts +10 -1
  39. package/src/components/SwapDetails/SwapDetails.tsx +44 -23
  40. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.tsx +19 -11
  41. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.ts +24 -0
  42. package/src/components/SwapDetailsModal/SwapDetailsModal.styles.ts +8 -0
  43. package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +1 -1
  44. package/src/containers/ExpandedQuotes/ExpandedQuotes.tsx +4 -2
  45. package/src/containers/QuoteInfo/QuoteInfo.tsx +2 -0
  46. package/src/containers/QuoteInfo/QuoteInfo.types.ts +1 -0
  47. package/src/containers/Settings/Lists.tsx +12 -12
  48. package/src/hooks/useWalletList.ts +8 -1
  49. package/src/pages/WalletsPage.tsx +1 -2
  50. package/src/utils/wallets.ts +7 -1
@@ -1 +1 @@
1
- {"version":3,"file":"WalletsPage.d.ts","sourceRoot":"","sources":["../../src/pages/WalletsPage.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAuBxC,eAAO,MAAM,mBAAmB,OAAQ,CAAC;AACzC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,wBAAgB,WAAW,sBA0E1B"}
1
+ {"version":3,"file":"WalletsPage.d.ts","sourceRoot":"","sources":["../../src/pages/WalletsPage.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAsBxC,eAAO,MAAM,mBAAmB,OAAQ,CAAC;AACzC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,wBAAgB,WAAW,sBA0E1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../src/utils/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,SAAS,EACT,aAAa,EACb,MAAM,EACP,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EACV,KAAK,EACL,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EAEX,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAErE,OAAO,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AAuB5D,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAWvE;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,WAAW,EAC3C,aAAa,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,UAAU,EAC/C,IAAI,EAAE,UAAU,EAAE,EAClB,KAAK,CAAC,EAAE,MAAM,GACb,eAAe,EAAE,CA6BnB;AAED,wBAAgB,6BAA6B,CAC3C,oBAAoB,EAAE,cAAc,EAAE,GACrC,OAAO,EAAE,GAAG,IAAI,CAUlB;AAED,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,MA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mBAAmB,CACjC,aAAa,EAAE,OAAO,GAAG,IAAI,EAC7B,aAAa,EAAE,OAAO,GAAG,IAAI,GAC5B,MAAM,CAgBR;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC,GAAG,IAAI,EAC/D,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC,GAAG,IAAI,WAOhE;AAED,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,eAAe,EAAE,GACzB,eAAe,EAAE,CAcnB;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EAEf,QAAQ,SAAI,EAEZ,cAAc,SAAI,GACjB,MAAM,CAOR;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,gBAAgB,EAChB,UAAU,GACX,EAAE;IACD,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,GAAG,SAAS,CAMrB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,CAEvD;AAED,wBAAgB,iBAAiB,CAAC,gBAAgB,EAAE,eAAe,EAAE,iBAmCpE;AAED,eAAO,MAAM,iBAAiB,qBACV,eAAe,EAAE,cACvB,MAAM,YAIjB,CAAC;AAEJ,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,eAAe,EAAE,UAE9D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.24.2-next.6",
3
+ "version": "0.25.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -22,13 +22,13 @@
22
22
  "@lingui/core": "4.2.1",
23
23
  "@lingui/react": "4.2.1",
24
24
  "@rango-dev/logging-core": "^0.2.0",
25
- "@rango-dev/provider-all": "^0.29.1-next.1",
25
+ "@rango-dev/provider-all": "^0.30.0",
26
26
  "@rango-dev/queue-manager-core": "^0.26.0",
27
- "@rango-dev/queue-manager-rango-preset": "^0.29.2-next.1",
27
+ "@rango-dev/queue-manager-rango-preset": "^0.30.0",
28
28
  "@rango-dev/queue-manager-react": "^0.26.0",
29
- "@rango-dev/ui": "^0.30.1-next.2",
30
- "@rango-dev/wallets-react": "^0.15.1-next.0",
31
- "@rango-dev/wallets-shared": "^0.29.1-next.0",
29
+ "@rango-dev/ui": "^0.31.0",
30
+ "@rango-dev/wallets-react": "^0.16.0",
31
+ "@rango-dev/wallets-shared": "^0.30.0",
32
32
  "bignumber.js": "^9.1.1",
33
33
  "copy-to-clipboard": "^3.3.3",
34
34
  "dayjs": "^1.11.7",
@@ -26,6 +26,7 @@ export function HeaderButtons(props: HeaderButtonsPropTypes) {
26
26
  onClickHistory,
27
27
  onClickSettings,
28
28
  hidden = [],
29
+ container,
29
30
  } = props;
30
31
 
31
32
  const {
@@ -40,7 +41,7 @@ export function HeaderButtons(props: HeaderButtonsPropTypes) {
40
41
  <>
41
42
  {!hidden.includes('refresh') && (
42
43
  <Tooltip
43
- container={getContainer()}
44
+ container={container || getContainer()}
44
45
  side="top"
45
46
  content={i18n.t('Refresh')}>
46
47
  <RefreshButton onClick={onClickRefresh} />
@@ -8,4 +8,5 @@ export interface HeaderButtonsPropTypes {
8
8
  onClickRefresh?: () => void;
9
9
  onClickHistory?: () => void;
10
10
  hidden?: ('settings' | 'refresh' | 'history' | 'notifications')[];
11
+ container?: HTMLElement;
11
12
  }
@@ -85,6 +85,7 @@ export function Quote(props: QuoteProps) {
85
85
  showModalFee = true,
86
86
  onClickAllRoutes,
87
87
  fullExpandedMode = false,
88
+ container: propContainer,
88
89
  } = props;
89
90
  const blockchains = useAppStore().blockchains();
90
91
  const tokens = useAppStore().tokens();
@@ -308,7 +309,7 @@ export function Quote(props: QuoteProps) {
308
309
  const steps = getQuoteSteps(quote?.swaps ?? []);
309
310
 
310
311
  const numberOfSteps = steps.length;
311
- const container = getContainer();
312
+ const container = propContainer || getContainer();
312
313
  const sortedQuoteTags = sortTags(props.quote.tags || []);
313
314
  const showAllRoutesButton = !!onClickAllRoutes;
314
315
  const totalTime = roundedSecondsToString(totalArrivalTime(quote?.swaps));
@@ -467,6 +468,7 @@ export function Quote(props: QuoteProps) {
467
468
  quoteRef={quoteRef}
468
469
  selected={selected}
469
470
  setExpanded={setExpanded}
471
+ container={container}
470
472
  expanded={expanded}
471
473
  steps={steps}
472
474
  />
@@ -15,6 +15,7 @@ export type QuoteProps = {
15
15
  showModalFee?: boolean;
16
16
  onClickAllRoutes?: () => void;
17
17
  fullExpandedMode?: boolean;
18
+ container?: HTMLElement;
18
19
  };
19
20
 
20
21
  export type optionProps = {
@@ -29,6 +30,7 @@ export type QuoteTriggerProps = {
29
30
  setExpanded: React.Dispatch<React.SetStateAction<boolean | undefined>>;
30
31
  steps: Step[];
31
32
  expanded?: boolean;
33
+ container?: HTMLElement;
32
34
  };
33
35
 
34
36
  export type QuoteTriggerImagesProps = {
@@ -37,6 +39,7 @@ export type QuoteTriggerImagesProps = {
37
39
  src: string;
38
40
  open?: boolean;
39
41
  className?: string;
42
+ container?: HTMLElement;
40
43
  };
41
44
 
42
45
  export type QuoteCostDetailsProps = {
@@ -27,8 +27,8 @@ const MAX_STEPS = 4;
27
27
  const MAX_BLOCKCHAINS = 6;
28
28
 
29
29
  const ImageComponent = (props: QuoteTriggerImagesProps) => {
30
- const tooltipContainer = getContainer();
31
- const { content, src, className, open, state } = props;
30
+ const { content, src, className, open, state, container } = props;
31
+ const tooltipContainer = container || getContainer();
32
32
  return (
33
33
  <Tooltip
34
34
  container={tooltipContainer}
@@ -44,8 +44,9 @@ const ImageComponent = (props: QuoteTriggerImagesProps) => {
44
44
  };
45
45
 
46
46
  export function QuoteTrigger(props: QuoteTriggerProps) {
47
- const { quoteRef, selected, setExpanded, steps, expanded, type } = props;
48
- const tooltipContainer = getContainer();
47
+ const { quoteRef, selected, setExpanded, steps, expanded, type, container } =
48
+ props;
49
+ const tooltipContainer = container || getContainer();
49
50
  const numberOfSteps = steps.length;
50
51
  const blockchains = getUniqueBlockchains(steps);
51
52
  const { isTablet, isMobile } = useScreenDetect();
@@ -78,6 +79,7 @@ export function QuoteTrigger(props: QuoteTriggerProps) {
78
79
  content={step.swapper.displayName}
79
80
  src={step.swapper.image}
80
81
  state={step.state}
82
+ container={container}
81
83
  />
82
84
  {index !== numberOfSteps - 1 && <>{arrow}</>}
83
85
  </React.Fragment>
@@ -90,6 +92,7 @@ export function QuoteTrigger(props: QuoteTriggerProps) {
90
92
  content={step.swapper.displayName}
91
93
  src={step.swapper.image}
92
94
  state={step.state}
95
+ container={container}
93
96
  />
94
97
  {index !== numberOfSteps - 1 && <>{arrow}</>}
95
98
  </>
@@ -182,6 +185,7 @@ export function QuoteTrigger(props: QuoteTriggerProps) {
182
185
  src={chain.image}
183
186
  open={false}
184
187
  className={i > index ? 'blockchainImage' : ''}
188
+ container={container}
185
189
  />
186
190
  )
187
191
  )}
@@ -27,6 +27,7 @@ export function Quotes(props: PropTypes) {
27
27
  showModalFee,
28
28
  hasSort = true,
29
29
  fullExpandedMode = false,
30
+ container: propContainer,
30
31
  } = props;
31
32
  const {
32
33
  selectedQuote,
@@ -39,6 +40,7 @@ export function Quotes(props: PropTypes) {
39
40
  } = useQuoteStore();
40
41
  const { slippage, customSlippage } = useAppStore();
41
42
  const tokens = useAppStore().tokens();
43
+ const container = propContainer || getContainer();
42
44
  const hasQuotes = !!quotes && quotes.results.length;
43
45
  const userSlippage = customSlippage ?? slippage;
44
46
  const getQuoteWarning = (quote: MultiRouteSimulationResult) => {
@@ -73,7 +75,7 @@ export function Quotes(props: PropTypes) {
73
75
  <Typography size="xmedium" variant="title">
74
76
  {i18n.t('Sort by')}
75
77
  </Typography>
76
- <SelectStrategy container={getContainer()} />
78
+ <SelectStrategy container={container} />
77
79
  </StrategyContent>
78
80
  <Divider size="10" />
79
81
  </>
@@ -107,6 +109,7 @@ export function Quotes(props: PropTypes) {
107
109
  <React.Fragment key={quote.requestId}>
108
110
  <QuoteInfo
109
111
  showModalFee={showModalFee}
112
+ container={container}
110
113
  selected={selectedQuote?.requestId === quote.requestId}
111
114
  tagHidden={false}
112
115
  quote={{ ...quote, requestAmount: quotes.requestAmount }}
@@ -7,4 +7,5 @@ export type PropTypes = {
7
7
  showModalFee?: boolean;
8
8
  hasSort?: boolean;
9
9
  fullExpandedMode?: boolean;
10
+ container?: HTMLElement;
10
11
  };
@@ -1,4 +1,4 @@
1
- import { css, darkTheme, styled } from '@rango-dev/ui';
1
+ import { css, darkTheme, styled, Typography } from '@rango-dev/ui';
2
2
 
3
3
  import { ScrollableArea } from '../Layout';
4
4
 
@@ -85,3 +85,12 @@ export const StyledLink = styled('a', {
85
85
  alignItems: 'center',
86
86
  justifyContent: 'center',
87
87
  });
88
+
89
+ export const ErrorMessages = styled('div', {
90
+ display: 'flex',
91
+ flexDirection: 'column',
92
+ gap: '$5',
93
+ });
94
+ export const MessageText = styled(Typography, {
95
+ wordBreak: 'break-all',
96
+ });
@@ -64,7 +64,9 @@ import {
64
64
 
65
65
  import { getSteps, getStepState, RESET_INTERVAL } from './SwapDetails.helpers';
66
66
  import {
67
+ ErrorMessages,
67
68
  HeaderDetails,
69
+ MessageText,
68
70
  outputStyles,
69
71
  requestIdStyles,
70
72
  rowStyles,
@@ -211,36 +213,55 @@ export function SwapDetails(props: SwapDetailsProps) {
211
213
 
212
214
  const percentageChange = getPriceImpact(inputUsdValue, outputUsdValue);
213
215
 
216
+ const stepDetailMessage =
217
+ stepMessage.detailedMessage.content || stepMessage.shortMessage;
218
+
214
219
  const completeModalDesc =
215
- swap.status === 'success'
216
- ? i18n.t({
217
- id: 'You have received {amount} {token} in {conciseAddress} wallet on {chain} chain.',
218
- values: {
219
- amount: numberToString(
220
- outputAmount,
221
- TOKEN_AMOUNT_MIN_DECIMALS,
222
- TOKEN_AMOUNT_MAX_DECIMALS
223
- ),
224
- token: steps[numberOfSteps - 1].to.token.displayName,
225
- conciseAddress: getConciseAddress(
226
- swap.wallets[steps[numberOfSteps - 1].to.chain.displayName]
227
- ?.address || ''
228
- ),
229
- chain: steps[numberOfSteps - 1].to.chain.displayName,
230
- },
231
- })
232
- : `${i18n.t('Transaction was not sent.')} ${
233
- lastConvertedTokenInFailedSwap
234
- ? i18n.t({
220
+ swap.status === 'success' ? (
221
+ i18n.t({
222
+ id: 'You have received {amount} {token} in {conciseAddress} wallet on {chain} chain.',
223
+ values: {
224
+ amount: numberToString(
225
+ outputAmount,
226
+ TOKEN_AMOUNT_MIN_DECIMALS,
227
+ TOKEN_AMOUNT_MAX_DECIMALS
228
+ ),
229
+ token: steps[numberOfSteps - 1].to.token.displayName,
230
+ conciseAddress: getConciseAddress(
231
+ swap.wallets[steps[numberOfSteps - 1].to.chain.displayName]
232
+ ?.address || ''
233
+ ),
234
+ chain: steps[numberOfSteps - 1].to.chain.displayName,
235
+ },
236
+ })
237
+ ) : (
238
+ <ErrorMessages>
239
+ <Typography
240
+ variant="body"
241
+ size="medium"
242
+ color="neutral700"
243
+ align="center">
244
+ {!stepDetailMessage ? i18n.t('Transaction was not sent.') : ''}
245
+ {lastConvertedTokenInFailedSwap
246
+ ? `${i18n.t({
235
247
  id: '{amount} {symbol} on {blockchain} remain in your wallet',
236
248
  values: {
237
249
  amount: lastConvertedTokenInFailedSwap.outputAmount,
238
250
  symbol: lastConvertedTokenInFailedSwap.symbol,
239
251
  blockchain: lastConvertedTokenInFailedSwap.blockchain,
240
252
  },
241
- })
242
- : ''
243
- }`;
253
+ })}`
254
+ : ''}
255
+ </Typography>
256
+ <MessageText
257
+ align="center"
258
+ variant="body"
259
+ size="medium"
260
+ color="neutral700">
261
+ {stepDetailMessage}
262
+ </MessageText>
263
+ </ErrorMessages>
264
+ );
244
265
 
245
266
  return (
246
267
  <Layout
@@ -1,13 +1,12 @@
1
1
  import type { FailedAlertsProps } from './SwapDetailsAlerts.types';
2
2
 
3
- import {
4
- Alert,
5
- ChevronDownIcon,
6
- ChevronUpIcon,
7
- IconButton,
8
- } from '@rango-dev/ui';
3
+ import { Alert, ChevronDownIcon, IconButton } from '@rango-dev/ui';
9
4
  import React, { useState } from 'react';
10
5
 
6
+ import { MessageText } from '../SwapDetails/SwapDetails.styles';
7
+
8
+ import { ActionIcon, AlertFooter } from './SwapDetailsAlerts.styles';
9
+
11
10
  export function FailedAlert(props: FailedAlertsProps) {
12
11
  const { message } = props;
13
12
  const [showContentError, setShowContentError] = useState(false);
@@ -16,21 +15,30 @@ export function FailedAlert(props: FailedAlertsProps) {
16
15
  <Alert
17
16
  type="error"
18
17
  title={message.shortMessage}
18
+ containerStyles={{
19
+ '& .footer': {
20
+ paddingTop: '$0',
21
+ },
22
+ }}
19
23
  action={
20
24
  message.detailedMessage.content && (
21
25
  <IconButton
22
26
  onClick={() => setShowContentError((prev) => !prev)}
23
27
  variant="ghost"
24
28
  size="xsmall">
25
- {showContentError ? (
26
- <ChevronUpIcon size={12} color="gray" />
27
- ) : (
29
+ <ActionIcon rotated={showContentError}>
28
30
  <ChevronDownIcon size={12} color="gray" />
29
- )}
31
+ </ActionIcon>
30
32
  </IconButton>
31
33
  )
32
34
  }
33
- footer={showContentError ? message.detailedMessage.content : undefined}
35
+ footer={
36
+ <AlertFooter open={showContentError}>
37
+ <MessageText variant="body" size="xsmall" color="neutral700">
38
+ {message.detailedMessage.content}
39
+ </MessageText>
40
+ </AlertFooter>
41
+ }
34
42
  />
35
43
  );
36
44
  }
@@ -5,3 +5,27 @@ export const Alerts = styled('div', {
5
5
  flexDirection: 'column',
6
6
  gap: '$10',
7
7
  });
8
+
9
+ export const ActionIcon = styled('div', {
10
+ transition: 'transform 0.3s ease-in-out',
11
+ variants: {
12
+ rotated: {
13
+ true: {
14
+ transform: 'rotate(180deg)',
15
+ },
16
+ },
17
+ },
18
+ });
19
+
20
+ export const AlertFooter = styled('div', {
21
+ transition: 'max-height 0.3s ease-in-out',
22
+ maxHeight: '0px',
23
+ overflow: 'hidden',
24
+ variants: {
25
+ open: {
26
+ true: {
27
+ maxHeight: '200px',
28
+ },
29
+ },
30
+ },
31
+ });
@@ -4,3 +4,11 @@ export const WalletContainer = styled('div', {
4
4
  display: 'flex',
5
5
  justifyContent: 'center',
6
6
  });
7
+
8
+ export const TooltipErrorContent = styled('div', {
9
+ maxWidth: 280,
10
+ '& ._typography': {
11
+ wordWrap: 'break-word',
12
+ display: 'block',
13
+ },
14
+ });
@@ -37,7 +37,7 @@ export interface CompleteModalPropTypes {
37
37
  displayName: string;
38
38
  image: string;
39
39
  };
40
- description?: string;
40
+ description?: React.ReactNode;
41
41
  diagnosisUrl?: string | null;
42
42
  }
43
43
 
@@ -22,7 +22,7 @@ export function ExpandedQuotes(props: PropTypes) {
22
22
  const containerClass = isDelayedVisible ? '' : 'is-hidden';
23
23
  const { config } = useAppStore();
24
24
  const fullExpandedMode = config?.variant === 'full-expanded';
25
-
25
+ const container = getExpanded();
26
26
  useEffect(() => {
27
27
  let timeout: ReturnType<typeof setTimeout> | null = null;
28
28
 
@@ -53,8 +53,9 @@ export function ExpandedQuotes(props: PropTypes) {
53
53
  title={i18n.t('Routes')}
54
54
  suffix={
55
55
  <>
56
- <SelectStrategy container={getExpanded()} />
56
+ <SelectStrategy container={container} />
57
57
  <HeaderButtons
58
+ container={container}
58
59
  onClickRefresh={onClickRefresh}
59
60
  hidden={['history', 'notifications', 'settings']}
60
61
  />
@@ -67,6 +68,7 @@ export function ExpandedQuotes(props: PropTypes) {
67
68
  fetch={fetch}
68
69
  hasSort={false}
69
70
  loading={loading}
71
+ container={getExpanded()}
70
72
  onClickOnQuote={onClickOnQuote}
71
73
  fullExpandedMode={fullExpandedMode}
72
74
  />
@@ -26,6 +26,7 @@ export function QuoteInfo(props: PropTypes) {
26
26
  selected,
27
27
  onClickAllRoutes,
28
28
  fullExpandedMode = false,
29
+ container,
29
30
  } = props;
30
31
  const { inputAmount, inputUsdValue, toToken } = useQuoteStore();
31
32
 
@@ -59,6 +60,7 @@ export function QuoteInfo(props: PropTypes) {
59
60
  <Quote
60
61
  quote={quote}
61
62
  error={error}
63
+ container={container}
62
64
  showModalFee={showModalFee}
63
65
  warning={warning}
64
66
  tagHidden={tagHidden}
@@ -15,4 +15,5 @@ export type PropTypes = {
15
15
  selected?: boolean;
16
16
  showModalFee?: boolean;
17
17
  fullExpandedMode?: boolean;
18
+ container?: HTMLElement;
18
19
  };
@@ -4,12 +4,12 @@ import type { ListPropTypes, SvgIconProps } from '@rango-dev/ui';
4
4
  import { i18n } from '@lingui/core';
5
5
  import {
6
6
  AutoThemeIcon,
7
- BridgeIcon,
7
+ BridgesIcon,
8
8
  ChevronRightIcon,
9
9
  DarkModeIcon,
10
10
  Divider,
11
- DoneIcon,
12
11
  ExchangeIcon,
12
+ InfinityIcon,
13
13
  InfoIcon,
14
14
  LanguageIcon,
15
15
  LightModeIcon,
@@ -42,7 +42,7 @@ const ThemeSection = styled('div', {
42
42
  const themesList = [
43
43
  {
44
44
  id: ThemeModeEnum.LIGHT,
45
- icon: <LightModeIcon color="black" size={16} />,
45
+ icon: <LightModeIcon color="black" size={24} />,
46
46
  tooltip: (
47
47
  <Typography size="xsmall" variant="body">
48
48
  {i18n.t('Light')}
@@ -51,7 +51,7 @@ const themesList = [
51
51
  },
52
52
  {
53
53
  id: ThemeModeEnum.DARK,
54
- icon: <DarkModeIcon color="black" size={14} />,
54
+ icon: <DarkModeIcon color="black" size={24} />,
55
55
  tooltip: (
56
56
  <Typography size="xsmall" variant="body">
57
57
  {i18n.t('Dark')}
@@ -60,7 +60,7 @@ const themesList = [
60
60
  },
61
61
  {
62
62
  id: ThemeModeEnum.AUTO,
63
- icon: <AutoThemeIcon color="black" size={16} />,
63
+ icon: <AutoThemeIcon color="black" size={24} />,
64
64
  tooltip: (
65
65
  <Typography size="xsmall" variant="body">
66
66
  {i18n.t('Auto')}
@@ -70,7 +70,7 @@ const themesList = [
70
70
  ];
71
71
 
72
72
  const getThemeIcon = (theme: ThemeMode) => {
73
- const iconProps: SvgIconProps = { color: 'gray', size: 14 };
73
+ const iconProps: SvgIconProps = { color: 'gray', size: 16 };
74
74
 
75
75
  switch (theme) {
76
76
  case 'auto':
@@ -161,7 +161,7 @@ export function SettingsLists() {
161
161
  </>
162
162
  ),
163
163
  onClick: () => navigate(navigationRoutes.bridges),
164
- start: <BridgeIcon color="gray" size={14} />,
164
+ start: <BridgesIcon color="gray" size={16} />,
165
165
  };
166
166
 
167
167
  const exchangeItem = {
@@ -178,10 +178,10 @@ export function SettingsLists() {
178
178
  totalExchangeSources
179
179
  )}
180
180
  <Divider direction="horizontal" size={8} />
181
- <ChevronRightIcon color="gray" />
181
+ <ChevronRightIcon color="black" />
182
182
  </>
183
183
  ),
184
- start: <ExchangeIcon color="gray" size={14} />,
184
+ start: <ExchangeIcon color="gray" size={16} />,
185
185
  onClick: () => navigate(navigationRoutes.exchanges),
186
186
  };
187
187
 
@@ -192,14 +192,14 @@ export function SettingsLists() {
192
192
  {i18n.t('Language')}
193
193
  </Typography>
194
194
  ),
195
- start: <LanguageIcon color="gray" size={14} />,
195
+ start: <LanguageIcon color="gray" size={16} />,
196
196
  end: (
197
197
  <>
198
198
  <Typography variant="body" size="medium">
199
199
  {currentLanguage}
200
200
  </Typography>
201
201
  <Divider direction="horizontal" size={8} />
202
- <ChevronRightIcon color="gray" />
202
+ <ChevronRightIcon color="black" />
203
203
  </>
204
204
  ),
205
205
  onClick: () => navigate(navigationRoutes.languages),
@@ -230,7 +230,7 @@ export function SettingsLists() {
230
230
  </Tooltip>
231
231
  </>
232
232
  ),
233
- start: <DoneIcon color="gray" size={14} />,
233
+ start: <InfinityIcon color="gray" size={16} />,
234
234
  end: <Switch checked={infiniteApprove} />,
235
235
  onClick: toggleInfiniteApprove,
236
236
  };
@@ -5,6 +5,7 @@ import type { BlockchainMeta } from 'rango-sdk';
5
5
  import { WalletState } from '@rango-dev/ui';
6
6
  import { useWallets } from '@rango-dev/wallets-react';
7
7
  import {
8
+ detectMobileScreens,
8
9
  KEPLR_COMPATIBLE_WALLETS,
9
10
  type WalletType,
10
11
  WalletTypes,
@@ -47,13 +48,19 @@ export function useWalletList(params: Params) {
47
48
  walletConnectProjectId: config?.walletConnectProjectId,
48
49
  }) || ALL_SUPPORTED_WALLETS;
49
50
 
50
- const wallets = mapWalletTypesToWalletInfo(
51
+ let wallets = mapWalletTypesToWalletInfo(
51
52
  state,
52
53
  getWalletInfo,
53
54
  listAvailableWalletTypes,
54
55
  chain
55
56
  );
56
57
 
58
+ wallets = detectMobileScreens()
59
+ ? wallets.filter(
60
+ (wallet) => wallet.showOnMobile || state(wallet.type).installed
61
+ )
62
+ : wallets;
63
+
57
64
  const sortedWallets = sortWalletsBasedOnConnectionState(wallets);
58
65
  const [error, setError] = useState('');
59
66
 
@@ -13,12 +13,11 @@ import { getContainer } from '../utils/common';
13
13
 
14
14
  const ListContainer = styled('div', {
15
15
  display: 'flex',
16
- justifyContent: 'space-evenly',
16
+ justifyContent: 'center',
17
17
  alignItems: 'center',
18
18
  gap: '$10',
19
19
  flexWrap: 'wrap',
20
20
  paddingTop: '$5',
21
- height: '100%',
22
21
  });
23
22
 
24
23
  const Container = styled(PageContainer, {
@@ -77,7 +77,12 @@ export function mapWalletTypesToWalletInfo(
77
77
  return true;
78
78
  })
79
79
  .map((type) => {
80
- const { name, img: image, installLink } = getWalletInfo(type);
80
+ const {
81
+ name,
82
+ img: image,
83
+ installLink,
84
+ showOnMobile,
85
+ } = getWalletInfo(type);
81
86
  const state = mapStatusToWalletState(getState(type));
82
87
  return {
83
88
  title: name,
@@ -85,6 +90,7 @@ export function mapWalletTypesToWalletInfo(
85
90
  link: detectInstallLink(installLink),
86
91
  state,
87
92
  type,
93
+ showOnMobile,
88
94
  };
89
95
  });
90
96
  }