Skip to content

Commit be68470

Browse files
committed
Prettify
1 parent e59d512 commit be68470

File tree

1 file changed

+39
-21
lines changed

1 file changed

+39
-21
lines changed

demo/src/screens/componentScreens/ColorSwatchScreen.tsx

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,26 @@ import React, {Component} from 'react';
33
import {ScrollView} from 'react-native';
44
import {Constants, Colors, View, Text, ColorSwatch, ColorPalette} from 'react-native-ui-lib'; //eslint-disable-line
55

6-
76
export default class ColorSwatchScreen extends Component {
87
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+
];
1026
allColors = _.filter(Object.values(Colors), _.isString);
1127

1228
state = {
@@ -18,25 +34,27 @@ export default class ColorSwatchScreen extends Component {
1834

1935
onPress = () => {
2036
this.setState({selected: !this.state.selected});
21-
}
37+
};
2238

2339
onValueChange = (value: string) => {
2440
this.setState({color: value});
25-
}
41+
};
2642
onValueChange1 = (value: string) => {
2743
this.setState({color1: value});
28-
}
44+
};
2945
onValueChange2 = (value: string) => {
3046
this.setState({color2: value});
31-
}
47+
};
3248

3349
render() {
3450
const {color, color1, color2, selected} = this.state;
3551

3652
return (
3753
<ScrollView style={{backgroundColor: Colors.grey80}}>
3854
<View flex center useSafeArea>
39-
<Text margin-5 text60 grey10>Single ColorSwatch</Text>
55+
<Text margin-5 text60 grey10>
56+
Single ColorSwatch
57+
</Text>
4058
<View row>
4159
<ColorSwatch selected={selected} onPress={this.onPress}/>
4260
<View>
@@ -45,22 +63,22 @@ export default class ColorSwatchScreen extends Component {
4563
</View>
4664
</View>
4765

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}/>
5573

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}/>
6278

63-
<Text margin-10 text60 grey10>Pagination</Text>
79+
<Text margin-10 text60 grey10>
80+
Pagination
81+
</Text>
6482
<ColorPalette
6583
numberOfRows={!Constants.isTablet ? 4 : undefined}
6684
value={color2}

0 commit comments

Comments
 (0)