This repository was archived by the owner on May 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +22
-12
lines changed
src/components/TokenAmount Expand file tree Collapse file tree 1 file changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -44,10 +44,9 @@ const TokenAmount = React.memo(function TokenAmount({
44
44
{ amount && (
45
45
< span
46
46
css = { `
47
- padding -right: ${ size === 'large' ? 0.5 * GU : 0.25 * GU } px;
47
+ margin -right: ${ size === 'large' ? 0.5 * GU : 0.25 * GU } px;
48
48
${ textStyle ( size === 'large' ? 'title2' : 'body2' ) } ;
49
49
line-height: 1;
50
- ${ size === 'large' ? `transform: translateY(2px);` : '' }
51
50
` }
52
51
>
53
52
{ TokenAmountLib . format ( amount , decimals , { digits : digits } ) }
@@ -60,19 +59,30 @@ const TokenAmount = React.memo(function TokenAmount({
60
59
} )
61
60
62
61
const Icon = function Icon ( { address, chainId, iconUrl, size } ) {
62
+ const theme = useTheme ( )
63
63
const token = useToken ( chainId === 1 ? address : '' )
64
64
const { exists } = useImageExists ( iconUrl || token . iconUrl )
65
65
return (
66
- exists && (
67
- < img
68
- alt = ""
69
- height = { 3 * GU }
70
- src = { iconUrl || token . iconUrl }
71
- css = { `
72
- padding-right: ${ size === 'large' ? 1 * GU : 0.5 * GU } px;
73
- ` }
74
- />
75
- )
66
+ < div
67
+ css = { `
68
+ display: flex;
69
+ width: ${ 3 * GU } px;
70
+ height: ${ 3 * GU } px;
71
+ margin-right: ${ size === 'large' ? 1 * GU : 0.75 * GU } px;
72
+ ` }
73
+ >
74
+ { exists ? (
75
+ < img alt = "" width = "100%" src = { iconUrl || token . iconUrl } />
76
+ ) : (
77
+ < div
78
+ css = { `
79
+ flex: 1;
80
+ border-radius: 100%;
81
+ border: 2px solid ${ theme . border } ;
82
+ ` }
83
+ />
84
+ ) }
85
+ </ div >
76
86
)
77
87
}
78
88
You can’t perform that action at this time.
0 commit comments