@rango-dev/ui 0.45.1-next.7 → 0.45.1-next.9

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.
@@ -8,6 +8,7 @@ import {
8
8
  ChainToken,
9
9
  Divider,
10
10
  Skeleton,
11
+ Tooltip,
11
12
  Typography,
12
13
  } from '../../components/index.js';
13
14
 
@@ -15,6 +16,9 @@ import {
15
16
  chainNameStyles,
16
17
  Container,
17
18
  skeletonStyles,
19
+ SymbolTooltipContent,
20
+ SymbolTooltipStyles,
21
+ Title,
18
22
  TitleContainer,
19
23
  tokenChainStyles,
20
24
  TokenSectionContainer,
@@ -33,6 +37,9 @@ export function TokenSection(props: TokenSectionProps) {
33
37
  warning,
34
38
  tooltipContainer,
35
39
  } = props;
40
+
41
+ const tokenSelected = !error && !loading && !!tokenSymbol;
42
+
36
43
  return (
37
44
  <Container variant="default" disabled={error || loading} onClick={onClick}>
38
45
  <TokenSectionContainer>
@@ -54,11 +61,28 @@ export function TokenSection(props: TokenSectionProps) {
54
61
  ) : (
55
62
  <>
56
63
  <TitleContainer>
57
- <Typography variant="title" size="medium">
58
- {error || (!loading && !tokenSymbol)
59
- ? i18n.t('Select Token')
60
- : tokenSymbol}
61
- </Typography>
64
+ {tokenSelected ? (
65
+ <Tooltip
66
+ styles={SymbolTooltipStyles}
67
+ align="start"
68
+ side="bottom"
69
+ alignOffset={-15}
70
+ sideOffset={15}
71
+ container={tooltipContainer}
72
+ content={
73
+ <SymbolTooltipContent variant="body" size="xsmall">
74
+ {tokenSymbol}
75
+ </SymbolTooltipContent>
76
+ }>
77
+ <Title variant="title" size="medium">
78
+ {tokenSymbol}
79
+ </Title>
80
+ </Tooltip>
81
+ ) : (
82
+ <Typography variant="title" size="medium">
83
+ {i18n.t('Select Token')}
84
+ </Typography>
85
+ )}
62
86
  {warning && (
63
87
  <>
64
88
  <Divider size={4} direction="horizontal" />