File tree Expand file tree Collapse file tree 5 files changed +22
-8
lines changed
src/design-system/asset-input Expand file tree Collapse file tree 5 files changed +22
-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
1
+ import React from "react" ;
2
+
1
3
export interface Asset {
2
4
id : string ;
3
5
ticker : string ;
4
6
balance : string ;
5
7
amount : string ;
8
+ icon ?: React . ReactNode ;
6
9
}
7
10
8
11
export interface AssetWithFiat extends Asset {
Original file line number Diff line number Diff line change 1
1
import type { AssetWithFiat , AssetState } from './asset-input.data' ;
2
+ import { Image } from '../profile-picture' ;
3
+ import cardanoImage from '../../assets/images/cardano-blue-bg.png' ;
4
+
5
+ import Icon from '../../assets/icons/token.svg' ;
2
6
3
7
export const asset : AssetWithFiat = {
4
8
balance : String ( 10_000_000 ) ,
5
9
amount : '' ,
6
10
id : '' ,
7
11
ticker : 'Token' ,
12
+ icon : < Image imageSrc = { cardanoImage } alt = "Token" /> ,
8
13
fiat : {
9
14
value : '0' ,
10
15
ticker : 'USD' ,
Original file line number Diff line number Diff line change @@ -10,24 +10,29 @@ import * as cx from './ticker-button.css';
10
10
interface Props {
11
11
name : string ;
12
12
id : string ;
13
+ icon ?: React . ReactNode ;
13
14
onClick ?: ( ) => void ;
14
15
}
15
16
16
17
export const TickerButton = ( {
17
18
name,
18
19
id,
20
+ icon,
19
21
onClick,
20
22
} : Readonly < Props > ) : JSX . Element => (
21
23
< button
22
24
className = { cx . button }
23
25
onClick = { onClick }
24
26
data-testid = { `asset-input-ticker-button-${ id } ` }
25
27
>
26
- < Text . SubHeading weight = "$bold" >
27
- < Flex justifyContent = "center" alignItems = "center" >
28
- { name }
29
- < ChevronRight className = { cx . chevronIcon } />
30
- </ Flex >
31
- </ Text . SubHeading >
28
+ < Flex alignItems = "center" gap = "$16" >
29
+ { icon }
30
+ < Text . SubHeading weight = "$bold" >
31
+ < Flex justifyContent = "center" alignItems = "center" >
32
+ < span > { name } </ span >
33
+ < ChevronRight className = { cx . chevronIcon } />
34
+ </ Flex >
35
+ </ Text . SubHeading >
36
+ </ Flex >
32
37
</ button >
33
38
) ;
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