File tree Expand file tree Collapse file tree 3 files changed +35
-8
lines changed Expand file tree Collapse file tree 3 files changed +35
-8
lines changed Original file line number Diff line number Diff line change @@ -2,25 +2,32 @@ import React from 'react';
22
33import { Flex } from '../flex' ;
44import { Text } from '../text' ;
5+ import { FontWeights } from '../text/create-text.util' ;
56
67import * as cx from './assets-table-token-amount.css' ;
78
9+ import type { TypographyVariants } from '../text/text.css' ;
10+
811interface Props {
912 amount : string ;
10- fiatPrice : string ;
13+ details : string ;
14+ detailsColor ?: TypographyVariants [ 'color' ] ;
15+ detailsWeight ?: FontWeights ;
1116}
1217
1318export const TokenAmount = ( {
1419 amount,
15- fiatPrice,
20+ details,
21+ detailsColor = 'secondary' ,
22+ detailsWeight = '$regular' ,
1623} : Readonly < Props > ) : JSX . Element => {
1724 return (
1825 < Flex flexDirection = "column" alignItems = "flex-end" className = { cx . container } >
1926 < Text . Body . Large weight = "$semibold" data-testid = "token-amount" >
2027 { amount }
2128 </ Text . Body . Large >
22- < Text . Body . Normal color = "secondary" weight = "$semibold" >
23- { fiatPrice }
29+ < Text . Body . Normal color = { detailsColor } weight = { detailsWeight } >
30+ { details }
2431 </ Text . Body . Normal >
2532 </ Flex >
2633 ) ;
Original file line number Diff line number Diff line change @@ -53,7 +53,22 @@ const SimpleAssetInfo = ({ id }: Readonly<AssetInfoProps>): JSX.Element => (
5353 name = "Token name"
5454 description = "Subtitle"
5555 />
56- < TokenAmount amount = "23,584.48" fiatPrice = "24,568.54 USD" />
56+ < TokenAmount amount = "23,584.48" details = "24,568.54 USD" />
57+ </ AssetsTable >
58+ ) ;
59+
60+ const PendingAssetInfo = ( { id } : Readonly < AssetInfoProps > ) : JSX . Element => (
61+ < AssetsTable id = { id } >
62+ < TokenProfile
63+ imageSrc = { cardanoImage }
64+ name = "Token with pending amount"
65+ description = "description"
66+ />
67+ < TokenAmount
68+ amount = "21,584.48"
69+ details = "+ 5 pending"
70+ detailsColor = "success"
71+ />
5772 </ AssetsTable >
5873) ;
5974
@@ -72,7 +87,7 @@ const DetailedAssetInfo = ({
7287 priceChange = "+3.21"
7388 priceTrend = { priceTrend }
7489 />
75- < TokenAmount amount = "23,584.48" fiatPrice = "24,568.54 USD" />
90+ < TokenAmount amount = "23,584.48" details = "24,568.54 USD" />
7691 </ AssetsTable >
7792) ;
7893
@@ -126,6 +141,11 @@ export const Overview = (): JSX.Element => (
126141 < DetailedAssetInfo />
127142 </ Variants . Cell >
128143 </ Variants . Row >
144+ < Variants . Row >
145+ < Variants . Cell >
146+ < PendingAssetInfo />
147+ </ Variants . Cell >
148+ </ Variants . Row >
129149 </ Variants . Table >
130150 </ Section >
131151
@@ -188,7 +208,7 @@ export const Controls: Controls = ({
188208 priceChange = { priceChange }
189209 priceTrend = { priceTrend }
190210 />
191- < TokenAmount amount = { tokenAmount } fiatPrice = { fiatPrice } />
211+ < TokenAmount amount = { tokenAmount } details = { fiatPrice } />
192212 </ AssetsTable >
193213 </ Flex >
194214 </ Section >
Original file line number Diff line number Diff line change 1- import React , { useState } from 'react' ;
1+ import React from 'react' ;
22
33import { action } from '@storybook/addon-actions' ;
44import type { Meta } from '@storybook/react' ;
You can’t perform that action at this time.
0 commit comments