1
1
import React , { Component } from 'react' ;
2
- import { Checkbox , Assets , Text , View , Colors , Spacings } from 'react-native-ui-lib' ; //eslint-disable-line
2
+ import { StyleSheet } from 'react-native' ;
3
+ import { Checkbox , Assets , Text , View , Colors } from 'react-native-ui-lib' ; //eslint-disable-line
3
4
4
- class CheckboxScreen extends Component {
5
+ export default class CheckboxScreen extends Component {
5
6
state = {
6
7
value1 : false ,
7
8
value2 : false ,
@@ -14,63 +15,67 @@ class CheckboxScreen extends Component {
14
15
render ( ) {
15
16
return (
16
17
< View useSafeArea flex >
17
- < View flex padding-20 >
18
- < View flex center >
19
- < Checkbox
20
- value = { this . state . value1 }
21
- onValueChange = { value1 => this . setState ( { value1} ) }
22
- style = { { marginBottom : 20 } }
23
- />
24
- < Checkbox
25
- value = { this . state . value6 }
26
- label = { 'With label' }
27
- color = { Colors . green20 }
28
- onValueChange = { value6 => this . setState ( { value6} ) }
29
- containerStyle = { { marginBottom : 20 , marginLeft : 75 } }
30
- />
31
- < Checkbox
32
- value = { this . state . value2 }
33
- onValueChange = { value2 => this . setState ( { value2} ) }
34
- borderRadius = { 2 }
35
- size = { 30 }
36
- color = { Colors . purple30 }
37
- selectedIcon = { Assets . icons . x }
38
- style = { { marginBottom : 20 } }
39
- />
40
- < Checkbox
41
- value = { this . state . value3 }
42
- onValueChange = { value3 => this . setState ( { value3} ) }
43
- borderRadius = { 5 }
44
- size = { 18 }
45
- color = { Colors . grey10 }
46
- iconColor = { Colors . green10 }
47
- style = { { marginBottom : 20 } }
48
- />
49
- < View row marginB-20 >
50
- < Text text70 centerV >
51
- Disabled:{ ' ' }
52
- </ Text >
53
- < Checkbox
54
- disabled
55
- value = { this . state . value5 }
56
- onValueChange = { value5 => this . setState ( { value5} ) }
57
- style = { { marginRight : 10 } }
58
- />
59
- < Checkbox
60
- disabled
61
- value = { ! this . state . value5 }
62
- onValueChange = { value5 => this . setState ( { value5} ) }
63
- iconColor = { Colors . green10 }
64
- />
65
- </ View >
66
- </ View >
67
- < Text text40 grey10 >
68
- Checkbox
18
+ < Text text40 $textDefault margin-20 >
19
+ Checkbox
20
+ </ Text >
21
+
22
+ < Checkbox
23
+ value = { this . state . value1 }
24
+ onValueChange = { value1 => this . setState ( { value1} ) }
25
+ style = { styles . checkbox }
26
+ />
27
+ < Checkbox
28
+ value = { this . state . value6 }
29
+ label = { 'With label' }
30
+ color = { Colors . green20 }
31
+ onValueChange = { value6 => this . setState ( { value6} ) }
32
+ containerStyle = { styles . checkbox }
33
+ />
34
+ < Checkbox
35
+ value = { this . state . value2 }
36
+ onValueChange = { value2 => this . setState ( { value2} ) }
37
+ borderRadius = { 2 }
38
+ size = { 30 }
39
+ color = { Colors . purple30 }
40
+ selectedIcon = { Assets . icons . x }
41
+ style = { styles . checkbox }
42
+ />
43
+ < Checkbox
44
+ value = { this . state . value3 }
45
+ onValueChange = { value3 => this . setState ( { value3} ) }
46
+ borderRadius = { 5 }
47
+ size = { 18 }
48
+ color = { Colors . grey10 }
49
+ iconColor = { Colors . green10 }
50
+ style = { styles . checkbox }
51
+ />
52
+ < View row margin-20 style = { styles . row } >
53
+ < Text $textDefault marginR-10 >
54
+ Disabled:
69
55
</ Text >
56
+ < Checkbox
57
+ disabled
58
+ value = { this . state . value5 }
59
+ onValueChange = { value5 => this . setState ( { value5} ) }
60
+ style = { { marginRight : 10 } }
61
+ />
62
+ < Checkbox
63
+ disabled
64
+ value = { ! this . state . value5 }
65
+ onValueChange = { value5 => this . setState ( { value5} ) }
66
+ iconColor = { Colors . green10 }
67
+ />
70
68
</ View >
71
69
</ View >
72
70
) ;
73
71
}
74
72
}
75
73
76
- export default CheckboxScreen ;
74
+ const styles = StyleSheet . create ( {
75
+ checkbox : {
76
+ margin : 20
77
+ } ,
78
+ row : {
79
+ alignItems : 'center'
80
+ }
81
+ } ) ;
0 commit comments