@@ -3,10 +3,26 @@ import React, {Component} from 'react';
3
3
import { ScrollView } from 'react-native' ;
4
4
import { Constants , Colors , View , Text , ColorSwatch , ColorPalette } from 'react-native-ui-lib' ; //eslint-disable-line
5
5
6
-
7
6
export default class ColorSwatchScreen extends Component {
8
7
colors = [ 'transparent' , Colors . green30 , Colors . yellow30 , Colors . red30 ] ;
9
- mainColors = [ '#66737C' , '#459FED' , '#1D5382' , '#3CC7C5' , '#65C888' , '#FAAD4D' , '#F27052' , '#F2564D' , '#B13DAC' , '#733CA6' , '#79838A' , '#5847FF' , '#00BBF2' , '#00CD8B' , '#FF563D' , '#ffb600' ] ;
8
+ mainColors = [
9
+ '#66737C' ,
10
+ '#459FED' ,
11
+ '#1D5382' ,
12
+ '#3CC7C5' ,
13
+ '#65C888' ,
14
+ '#FAAD4D' ,
15
+ '#F27052' ,
16
+ '#F2564D' ,
17
+ '#B13DAC' ,
18
+ '#733CA6' ,
19
+ '#79838A' ,
20
+ '#5847FF' ,
21
+ '#00BBF2' ,
22
+ '#00CD8B' ,
23
+ '#FF563D' ,
24
+ '#ffb600'
25
+ ] ;
10
26
allColors = _ . filter ( Object . values ( Colors ) , _ . isString ) ;
11
27
12
28
state = {
@@ -18,25 +34,27 @@ export default class ColorSwatchScreen extends Component {
18
34
19
35
onPress = ( ) => {
20
36
this . setState ( { selected : ! this . state . selected } ) ;
21
- }
37
+ } ;
22
38
23
39
onValueChange = ( value : string ) => {
24
40
this . setState ( { color : value } ) ;
25
- }
41
+ } ;
26
42
onValueChange1 = ( value : string ) => {
27
43
this . setState ( { color1 : value } ) ;
28
- }
44
+ } ;
29
45
onValueChange2 = ( value : string ) => {
30
46
this . setState ( { color2 : value } ) ;
31
- }
47
+ } ;
32
48
33
49
render ( ) {
34
50
const { color, color1, color2, selected} = this . state ;
35
51
36
52
return (
37
53
< ScrollView style = { { backgroundColor : Colors . grey80 } } >
38
54
< View flex center useSafeArea >
39
- < Text margin-5 text60 grey10 > Single ColorSwatch</ Text >
55
+ < Text margin-5 text60 grey10 >
56
+ Single ColorSwatch
57
+ </ Text >
40
58
< View row >
41
59
< ColorSwatch selected = { selected } onPress = { this . onPress } />
42
60
< View >
@@ -45,22 +63,22 @@ export default class ColorSwatchScreen extends Component {
45
63
</ View >
46
64
</ View >
47
65
48
- < Text marginT-20 text60 grey10 > ColorPalette </ Text >
49
- < Text marginB-10 text70 style = { { color } } > Selected Color: { color } </ Text >
50
- < ColorPalette
51
- value = { color }
52
- onValueChange = { this . onValueChange }
53
- colors = { this . colors }
54
- />
66
+ < Text marginT-20 text60 grey10 >
67
+ ColorPalette
68
+ </ Text >
69
+ < Text marginB-10 text70 style = { { color} } >
70
+ Selected Color: { color }
71
+ </ Text >
72
+ < ColorPalette value = { color } onValueChange = { this . onValueChange } colors = { this . colors } />
55
73
56
- < Text margin-10 text60 grey10 > Scrollable</ Text >
57
- < ColorPalette
58
- value = { color1 }
59
- onValueChange = { this . onValueChange1 }
60
- colors = { this . mainColors }
61
- />
74
+ < Text margin-10 text60 grey10 >
75
+ Scrollable
76
+ </ Text >
77
+ < ColorPalette value = { color1 } onValueChange = { this . onValueChange1 } colors = { this . mainColors } />
62
78
63
- < Text margin-10 text60 grey10 > Pagination</ Text >
79
+ < Text margin-10 text60 grey10 >
80
+ Pagination
81
+ </ Text >
64
82
< ColorPalette
65
83
numberOfRows = { ! Constants . isTablet ? 4 : undefined }
66
84
value = { color2 }
0 commit comments