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';
2
2
3
3
import { Flex } from '../flex' ;
4
4
import { Text } from '../text' ;
5
+ import { FontWeights } from '../text/create-text.util' ;
5
6
6
7
import * as cx from './assets-table-token-amount.css' ;
7
8
9
+ import type { TypographyVariants } from '../text/text.css' ;
10
+
8
11
interface Props {
9
12
amount : string ;
10
- fiatPrice : string ;
13
+ details : string ;
14
+ detailsColor ?: TypographyVariants [ 'color' ] ;
15
+ detailsWeight ?: FontWeights ;
11
16
}
12
17
13
18
export const TokenAmount = ( {
14
19
amount,
15
- fiatPrice,
20
+ details,
21
+ detailsColor = 'secondary' ,
22
+ detailsWeight = '$regular' ,
16
23
} : Readonly < Props > ) : JSX . Element => {
17
24
return (
18
25
< Flex flexDirection = "column" alignItems = "flex-end" className = { cx . container } >
19
26
< Text . Body . Large weight = "$semibold" data-testid = "token-amount" >
20
27
{ amount }
21
28
</ Text . Body . Large >
22
- < Text . Body . Normal color = "secondary" weight = "$semibold" >
23
- { fiatPrice }
29
+ < Text . Body . Normal color = { detailsColor } weight = { detailsWeight } >
30
+ { details }
24
31
</ Text . Body . Normal >
25
32
</ Flex >
26
33
) ;
Original file line number Diff line number Diff line change @@ -53,7 +53,22 @@ const SimpleAssetInfo = ({ id }: Readonly<AssetInfoProps>): JSX.Element => (
53
53
name = "Token name"
54
54
description = "Subtitle"
55
55
/>
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
+ />
57
72
</ AssetsTable >
58
73
) ;
59
74
@@ -72,7 +87,7 @@ const DetailedAssetInfo = ({
72
87
priceChange = "+3.21"
73
88
priceTrend = { priceTrend }
74
89
/>
75
- < TokenAmount amount = "23,584.48" fiatPrice = "24,568.54 USD" />
90
+ < TokenAmount amount = "23,584.48" details = "24,568.54 USD" />
76
91
</ AssetsTable >
77
92
) ;
78
93
@@ -126,6 +141,11 @@ export const Overview = (): JSX.Element => (
126
141
< DetailedAssetInfo />
127
142
</ Variants . Cell >
128
143
</ Variants . Row >
144
+ < Variants . Row >
145
+ < Variants . Cell >
146
+ < PendingAssetInfo />
147
+ </ Variants . Cell >
148
+ </ Variants . Row >
129
149
</ Variants . Table >
130
150
</ Section >
131
151
@@ -188,7 +208,7 @@ export const Controls: Controls = ({
188
208
priceChange = { priceChange }
189
209
priceTrend = { priceTrend }
190
210
/>
191
- < TokenAmount amount = { tokenAmount } fiatPrice = { fiatPrice } />
211
+ < TokenAmount amount = { tokenAmount } details = { fiatPrice } />
192
212
</ AssetsTable >
193
213
</ Flex >
194
214
</ Section >
Original file line number Diff line number Diff line change 1
- import React , { useState } from 'react' ;
1
+ import React from 'react' ;
2
2
3
3
import { action } from '@storybook/addon-actions' ;
4
4
import type { Meta } from '@storybook/react' ;
You can’t perform that action at this time.
0 commit comments