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 = ({
2828 < Box className = { cx . assetNameBox } >
2929 < TickerButton
3030 id = { state . asset . id }
31+ icon = { state . asset . icon }
3132 name = { state . asset . ticker }
3233 onClick = { ( ) : void => {
3334 onTickerClick ?.( state . asset ) ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ export interface Asset {
33 ticker : string ;
44 balance : string ;
55 amount : string ;
6+ icon ?: string ;
67}
78
89export 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+
13import type { AssetWithFiat , AssetState } from './asset-input.data' ;
24
35export const asset : AssetWithFiat = {
46 balance : String ( 10_000_000 ) ,
57 amount : '' ,
68 id : '' ,
79 ticker : 'Token' ,
10+ icon : cardanoImage ,
811 fiat : {
912 value : '0' ,
1013 ticker : 'USD' ,
Original file line number Diff line number Diff line change @@ -3,31 +3,37 @@ import React from 'react';
33import ChevronRight from '@icons/ChevronRightComponent' ;
44
55import { Flex } from '../flex' ;
6+ import { Image } from '../profile-picture' ;
67import { Text } from '../text' ;
78
89import * as cx from './ticker-button.css' ;
910
1011interface Props {
1112 name : string ;
1213 id : string ;
14+ icon ?: string ;
1315 onClick ?: ( ) => void ;
1416}
1517
1618export const TickerButton = ( {
1719 name,
1820 id,
21+ icon,
1922 onClick,
2023} : Readonly < Props > ) : JSX . Element => (
2124 < button
2225 className = { cx . button }
2326 onClick = { onClick }
2427 data-testid = { `asset-input-ticker-button-${ id } ` }
2528 >
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 >
3238 </ button >
3339) ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ export const button = style({
99} ) ;
1010
1111export const chevronIcon = sx ( {
12- w : '$16 ' ,
13- h : '$16 ' ,
12+ w : '$auto ' ,
13+ h : '$auto ' ,
1414 marginLeft : '$8' ,
1515} ) ;
You can’t perform that action at this time.
0 commit comments