11import _ from 'lodash' ;
22import 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
55
66
77const star = require ( '../../assets/icons/star.png' ) ;
8- const onlineColor = Colors . green30 ;
8+ const onlineColor = Colors . $backgroundSuccessHeavy ;
99const examples = [
1010 { title : 'Custom Background' , backgroundColor : Colors . violet60 } ,
1111 { title : 'Empty Avatar with ribbon' , ribbonLabel : 'New' } ,
1212 {
1313 title : 'Initials with Color' ,
1414 label : 'AD' ,
15- backgroundColor : Colors . yellow60 ,
16- labelColor : Colors . orange20 ,
15+ backgroundColor : Colors . $backgroundWarning ,
16+ labelColor : Colors . $textMajor ,
1717 ribbonLabel : 'New' ,
1818 ribbonStyle : { backgroundColor : Colors . purple30 }
1919 } ,
@@ -24,7 +24,7 @@ const examples = [
2424 uri :
2525 'https://lh3.googleusercontent.com/-cw77lUnOvmI/AAAAAAAAAAI/AAAAAAAAAAA/WMNck32dKbc/s181-c/104220521160525129167.jpg'
2626 } ,
27- badgeProps : { size : 10 , backgroundColor : Colors . yellow30 } ,
27+ badgeProps : { size : 10 , backgroundColor : Colors . $backgroundWarningHeavy } ,
2828 badgePosition : 'BOTTOM_RIGHT'
2929 } ,
3030
@@ -35,7 +35,7 @@ const examples = [
3535 uri :
3636 'https://lh3.googleusercontent.com/-CMM0GmT5tiI/AAAAAAAAAAI/AAAAAAAAAAA/-o9gKbC6FVo/s181-c/111308920004613908895.jpg'
3737 } ,
38- badgeProps : { size : 10 , backgroundColor : Colors . grey50 } ,
38+ badgeProps : { size : 10 , backgroundColor : Colors . $backgroundDisabled } ,
3939 badgePosition : 'BOTTOM_LEFT'
4040 } ,
4141 {
@@ -65,8 +65,8 @@ const examples = [
6565 icon : star ,
6666 size : 14 ,
6767 borderWidth : 1.5 ,
68- borderColor : Colors . white ,
69- iconStyle : { backgroundColor : Colors . yellow20 }
68+ borderColor : Colors . $outlineLight ,
69+ iconStyle : { backgroundColor : Colors . $backgroundWarningHeavy }
7070 }
7171 } ,
7272 {
@@ -79,7 +79,7 @@ const examples = [
7979 {
8080 title : 'Invalid Gravatar (see logs)' ,
8181 label : '🤦' ,
82- backgroundColor : Colors . grey60 ,
82+ backgroundColor : Colors . $backgroundNeutralMedium ,
8383 source : { uri : 'https://www.gravatar.com/avatar/00000000000000000000000000000000?d=404' } ,
8484 onImageLoadStart : ( ) => console . log ( 'AvatarScreen: Invalid avatar load STARTED...' ) , // eslint-disable-line
8585 onImageLoadEnd : ( ) => console . log ( 'AvatarScreen: Invalid avatar load ENDED' ) , // eslint-disable-line
@@ -88,26 +88,26 @@ const examples = [
8888 {
8989 title : 'Monitored Avatar (see logs)' ,
9090 label : '?!' ,
91- backgroundColor : Colors . blue20 ,
91+ backgroundColor : Colors . $backgroundGeneralHeavy ,
9292 source : { uri : 'https://static.altomusic.com/media/catalog/product/M/A/MAJ100SBK_0.jpg' } ,
9393 onImageLoadStart : ( ) => console . log ( 'AvatarScreen: Monitored avatar load STARTED...' ) , // eslint-disable-line
9494 onImageLoadEnd : ( ) => console . log ( 'AvatarScreen: Monitored avatar load ENDED' ) // eslint-disable-line
9595 } ,
9696 {
9797 title : 'Empty Gravatar' ,
98- backgroundColor : Colors . red60 ,
98+ backgroundColor : Colors . $backgroundDanger ,
9999 source : { uri : 'https://www.gravatar.com/avatar/2497473d558a37020c558bf26e380a7c?d=blank' }
100100 } ,
101101 {
102102 title : 'With custom badge label' ,
103103 label : 'LD' ,
104- backgroundColor : Colors . red60 ,
104+ backgroundColor : Colors . $backgroundDanger ,
105105 badgePosition : 'BOTTOM_RIGHT' ,
106106 badgeProps : {
107107 label : '+2' ,
108108 size : 24 ,
109109 borderWidth : 1.5 ,
110- borderColor : Colors . white
110+ borderColor : Colors . $outlineLight
111111 }
112112 }
113113] ;
@@ -130,7 +130,7 @@ export default class AvatarsScreen extends Component {
130130 < ScrollView contentContainerStyle = { styles . container } >
131131 { _ . map ( examples , ( example , i ) => (
132132 < View key = { i } style = { styles . section } >
133- < Text style = { { ...Typography . text80 } } > { example . title } </ Text >
133+ < Text $textDefault style = { { ...Typography . text80 } } > { example . title } </ Text >
134134 < Avatar containerStyle = { { marginVertical : 5 } } { ...example } onPress = { ( ) => this . onAvatarPress ( example ) } />
135135 </ View >
136136 ) ) }
@@ -141,7 +141,8 @@ export default class AvatarsScreen extends Component {
141141
142142const styles = StyleSheet . create ( {
143143 container : {
144- padding : 25
144+ padding : 25 ,
145+ backgroundColor : Colors . $backgroundDefault
145146 } ,
146147 section : {
147148 flexDirection : 'row' ,
0 commit comments