File tree Expand file tree Collapse file tree 5 files changed +19
-8
lines changed
src/design-system/asset-input Expand file tree Collapse file tree 5 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ export const AssetInput = ({
28
28
< Box className = { cx . assetNameBox } >
29
29
< TickerButton
30
30
id = { state . asset . id }
31
+ icon = { state . asset . icon }
31
32
name = { state . asset . ticker }
32
33
onClick = { ( ) : void => {
33
34
onTickerClick ?.( state . asset ) ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ export interface Asset {
3
3
ticker : string ;
4
4
balance : string ;
5
5
amount : string ;
6
+ icon ?: string ;
6
7
}
7
8
8
9
export interface AssetWithFiat extends Asset {
Original file line number Diff line number Diff line change
1
+ import cardanoImage from '../../assets/images/cardano-blue-bg.png' ;
2
+
1
3
import type { AssetWithFiat , AssetState } from './asset-input.data' ;
2
4
3
5
export const asset : AssetWithFiat = {
4
6
balance : String ( 10_000_000 ) ,
5
7
amount : '' ,
6
8
id : '' ,
7
9
ticker : 'Token' ,
10
+ icon : cardanoImage ,
8
11
fiat : {
9
12
value : '0' ,
10
13
ticker : 'USD' ,
Original file line number Diff line number Diff line change @@ -3,31 +3,37 @@ import React from 'react';
3
3
import ChevronRight from '@icons/ChevronRightComponent' ;
4
4
5
5
import { Flex } from '../flex' ;
6
+ import { Image } from '../profile-picture' ;
6
7
import { Text } from '../text' ;
7
8
8
9
import * as cx from './ticker-button.css' ;
9
10
10
11
interface Props {
11
12
name : string ;
12
13
id : string ;
14
+ icon ?: string ;
13
15
onClick ?: ( ) => void ;
14
16
}
15
17
16
18
export const TickerButton = ( {
17
19
name,
18
20
id,
21
+ icon,
19
22
onClick,
20
23
} : Readonly < Props > ) : JSX . Element => (
21
24
< button
22
25
className = { cx . button }
23
26
onClick = { onClick }
24
27
data-testid = { `asset-input-ticker-button-${ id } ` }
25
28
>
26
- < Text . SubHeading weight = "$bold" >
27
- < Flex justifyContent = "center" alignItems = "center" >
28
- { name }
29
- < ChevronRight className = { cx . chevronIcon } />
30
- </ Flex >
31
- </ Text . SubHeading >
29
+ < Flex alignItems = "center" gap = "$16" >
30
+ { icon && < Image imageSrc = { icon } alt = "Token" /> }
31
+ < Text . SubHeading weight = "$bold" >
32
+ < Flex justifyContent = "center" alignItems = "center" >
33
+ < span > { name } </ span >
34
+ < ChevronRight className = { cx . chevronIcon } />
35
+ </ Flex >
36
+ </ Text . SubHeading >
37
+ </ Flex >
32
38
</ button >
33
39
) ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ export const button = style({
9
9
} ) ;
10
10
11
11
export const chevronIcon = sx ( {
12
- w : '$16 ' ,
13
- h : '$16 ' ,
12
+ w : '$auto ' ,
13
+ h : '$auto ' ,
14
14
marginLeft : '$8' ,
15
15
} ) ;
You can’t perform that action at this time.
0 commit comments