1
1
import _ from 'lodash' ;
2
2
import React , { Component } from 'react' ;
3
- import { ScrollView , View , Text , StyleSheet , Alert } from 'react-native' ;
4
- import { Avatar , AvatarHelper , Colors , Typography } from 'react-native-ui-lib' ; //eslint-disable-line
3
+ import { ScrollView , StyleSheet , Alert } from 'react-native' ;
4
+ import { Avatar , AvatarHelper , View , Text , Colors , Typography } from 'react-native-ui-lib' ; //eslint-disable-line
5
5
6
6
7
7
const star = require ( '../../assets/icons/star.png' ) ;
8
- const onlineColor = Colors . green30 ;
8
+ const onlineColor = Colors . $backgroundSuccessHeavy ;
9
9
const examples = [
10
10
{ title : 'Custom Background' , backgroundColor : Colors . violet60 } ,
11
11
{ title : 'Empty Avatar with ribbon' , ribbonLabel : 'New' } ,
12
12
{
13
13
title : 'Initials with Color' ,
14
14
label : 'AD' ,
15
- backgroundColor : Colors . yellow60 ,
16
- labelColor : Colors . orange20 ,
15
+ backgroundColor : Colors . $backgroundWarning ,
16
+ labelColor : Colors . $textMajor ,
17
17
ribbonLabel : 'New' ,
18
18
ribbonStyle : { backgroundColor : Colors . purple30 }
19
19
} ,
@@ -24,7 +24,7 @@ const examples = [
24
24
uri :
25
25
'https://lh3.googleusercontent.com/-cw77lUnOvmI/AAAAAAAAAAI/AAAAAAAAAAA/WMNck32dKbc/s181-c/104220521160525129167.jpg'
26
26
} ,
27
- badgeProps : { size : 10 , backgroundColor : Colors . yellow30 } ,
27
+ badgeProps : { size : 10 , backgroundColor : Colors . $backgroundWarningHeavy } ,
28
28
badgePosition : 'BOTTOM_RIGHT'
29
29
} ,
30
30
@@ -35,7 +35,7 @@ const examples = [
35
35
uri :
36
36
'https://lh3.googleusercontent.com/-CMM0GmT5tiI/AAAAAAAAAAI/AAAAAAAAAAA/-o9gKbC6FVo/s181-c/111308920004613908895.jpg'
37
37
} ,
38
- badgeProps : { size : 10 , backgroundColor : Colors . grey50 } ,
38
+ badgeProps : { size : 10 , backgroundColor : Colors . $backgroundDisabled } ,
39
39
badgePosition : 'BOTTOM_LEFT'
40
40
} ,
41
41
{
@@ -65,8 +65,8 @@ const examples = [
65
65
icon : star ,
66
66
size : 14 ,
67
67
borderWidth : 1.5 ,
68
- borderColor : Colors . white ,
69
- iconStyle : { backgroundColor : Colors . yellow20 }
68
+ borderColor : Colors . $outlineLight ,
69
+ iconStyle : { backgroundColor : Colors . $backgroundWarningHeavy }
70
70
}
71
71
} ,
72
72
{
@@ -79,7 +79,7 @@ const examples = [
79
79
{
80
80
title : 'Invalid Gravatar (see logs)' ,
81
81
label : '🤦' ,
82
- backgroundColor : Colors . grey60 ,
82
+ backgroundColor : Colors . $backgroundNeutralMedium ,
83
83
source : { uri : 'https://www.gravatar.com/avatar/00000000000000000000000000000000?d=404' } ,
84
84
onImageLoadStart : ( ) => console . log ( 'AvatarScreen: Invalid avatar load STARTED...' ) , // eslint-disable-line
85
85
onImageLoadEnd : ( ) => console . log ( 'AvatarScreen: Invalid avatar load ENDED' ) , // eslint-disable-line
@@ -88,26 +88,26 @@ const examples = [
88
88
{
89
89
title : 'Monitored Avatar (see logs)' ,
90
90
label : '?!' ,
91
- backgroundColor : Colors . blue20 ,
91
+ backgroundColor : Colors . $backgroundGeneralHeavy ,
92
92
source : { uri : 'https://static.altomusic.com/media/catalog/product/M/A/MAJ100SBK_0.jpg' } ,
93
93
onImageLoadStart : ( ) => console . log ( 'AvatarScreen: Monitored avatar load STARTED...' ) , // eslint-disable-line
94
94
onImageLoadEnd : ( ) => console . log ( 'AvatarScreen: Monitored avatar load ENDED' ) // eslint-disable-line
95
95
} ,
96
96
{
97
97
title : 'Empty Gravatar' ,
98
- backgroundColor : Colors . red60 ,
98
+ backgroundColor : Colors . $backgroundDanger ,
99
99
source : { uri : 'https://www.gravatar.com/avatar/2497473d558a37020c558bf26e380a7c?d=blank' }
100
100
} ,
101
101
{
102
102
title : 'With custom badge label' ,
103
103
label : 'LD' ,
104
- backgroundColor : Colors . red60 ,
104
+ backgroundColor : Colors . $backgroundDanger ,
105
105
badgePosition : 'BOTTOM_RIGHT' ,
106
106
badgeProps : {
107
107
label : '+2' ,
108
108
size : 24 ,
109
109
borderWidth : 1.5 ,
110
- borderColor : Colors . white
110
+ borderColor : Colors . $outlineLight
111
111
}
112
112
}
113
113
] ;
@@ -130,7 +130,7 @@ export default class AvatarsScreen extends Component {
130
130
< ScrollView contentContainerStyle = { styles . container } >
131
131
{ _ . map ( examples , ( example , i ) => (
132
132
< View key = { i } style = { styles . section } >
133
- < Text style = { { ...Typography . text80 } } > { example . title } </ Text >
133
+ < Text $textDefault style = { { ...Typography . text80 } } > { example . title } </ Text >
134
134
< Avatar containerStyle = { { marginVertical : 5 } } { ...example } onPress = { ( ) => this . onAvatarPress ( example ) } />
135
135
</ View >
136
136
) ) }
@@ -141,7 +141,8 @@ export default class AvatarsScreen extends Component {
141
141
142
142
const styles = StyleSheet . create ( {
143
143
container : {
144
- padding : 25
144
+ padding : 25 ,
145
+ backgroundColor : Colors . $backgroundDefault
145
146
} ,
146
147
section : {
147
148
flexDirection : 'row' ,
0 commit comments