File tree 4 files changed +32
-7
lines changed
4 files changed +32
-7
lines changed Original file line number Diff line number Diff line change @@ -2,16 +2,19 @@ import React from 'react'
2
2
import { LayoutChangeEvent } from 'react-native'
3
3
import { Text , View } from '../Primitives'
4
4
import { PriceChangeIndicator } from '../PriceChangeIndicator/PriceChangeIndicator'
5
+ import { Icons } from '../../theme/tokens/Icons'
5
6
6
7
export const BalanceHeader = ( {
7
8
accountName,
8
9
formattedBalance,
9
10
currency,
11
+ errorMessage,
10
12
onLayout
11
13
} : {
12
14
accountName : string
13
15
formattedBalance : string
14
16
currency : string
17
+ errorMessage ?: string
15
18
onLayout ?: ( event : LayoutChangeEvent ) => void
16
19
} ) : JSX . Element => {
17
20
return (
@@ -32,12 +35,23 @@ export const BalanceHeader = ({
32
35
</ Text >
33
36
</ View >
34
37
</ View >
35
- < PriceChangeIndicator
36
- formattedPrice = "$12.7"
37
- status = "up"
38
- formattedPercent = "3.7%"
39
- textVariant = "buttonMedium"
40
- />
38
+ { errorMessage ? (
39
+ < View sx = { { gap : 4 , alignItems : 'center' , flexDirection : 'row' } } >
40
+ < Icons . Alert . Error width = { 16 } height = { 16 } color = { ERROR_COLOR } />
41
+ < Text variant = "buttonMedium" sx = { { color : ERROR_COLOR } } >
42
+ { errorMessage }
43
+ </ Text >
44
+ </ View >
45
+ ) : (
46
+ < PriceChangeIndicator
47
+ formattedPrice = "$12.7"
48
+ status = "up"
49
+ formattedPercent = "3.7%"
50
+ textVariant = "buttonMedium"
51
+ />
52
+ ) }
41
53
</ View >
42
54
)
43
55
}
56
+
57
+ const ERROR_COLOR = '#F5643B'
Original file line number Diff line number Diff line change @@ -20,6 +20,12 @@ export const All = (): JSX.Element => {
20
20
formattedBalance = "$7,377.37"
21
21
currency = "USD"
22
22
/>
23
+ < BalanceHeader
24
+ accountName = "Account 1"
25
+ formattedBalance = "$7,377.37"
26
+ errorMessage = "Unable to load all balances"
27
+ currency = "USD"
28
+ />
23
29
< NavigationTitleHeader title = "Account 1" subtitle = "$51.72 USD" />
24
30
</ View >
25
31
</ ScrollView >
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import IconTrendingArrowUp from '../../assets/icons/trending_arrow_up.svg'
32
32
import IconTrendingArrowDown from '../../assets/icons/trending_arrow_down.svg'
33
33
import IconQRCode2 from '../../assets/icons/qr_code_2.svg'
34
34
import IconNotifications from '../../assets/icons/notifications.svg'
35
+ import IconAlertError from '../../assets/icons/alert_error.svg'
35
36
36
37
export const Icons = {
37
38
Action : {
@@ -40,7 +41,8 @@ export const Icons = {
40
41
Clear : IconClear
41
42
} ,
42
43
Alert : {
43
- IconErrorOutline : IconErrorOutline
44
+ IconErrorOutline : IconErrorOutline ,
45
+ Error : IconAlertError
44
46
} ,
45
47
Device : {
46
48
IconGPPMaybe : IconGPPMaybe
You can’t perform that action at this time.
0 commit comments