2
2
import React , { Component } from 'react' ;
3
3
import PropTypes from 'prop-types' ;
4
4
import { ScrollView , View , StyleSheet } from 'react-native' ;
5
- import { Paragraph , Button , Dialog , RadioButton } from 'react-native-paper' ;
5
+ import {
6
+ Paragraph ,
7
+ Button ,
8
+ Dialog ,
9
+ RadioButton ,
10
+ TouchableRipple ,
11
+ } from 'react-native-paper' ;
6
12
7
13
type Props = {
8
14
visible : boolean ,
@@ -31,36 +37,40 @@ export default class extends Component<void, Props, State> {
31
37
< Dialog onRequestClose = { close } visible = { visible } >
32
38
< Dialog . Title > Choose an option</ Dialog . Title >
33
39
< Dialog . ScrollArea style = { { maxHeight : 170 , paddingHorizontal : 0 } } >
34
- < ScrollView contentContainerStyle = { { paddingHorizontal : 24 } } >
40
+ < ScrollView >
35
41
< View >
36
- < View style = { styles . checkBoxRow } >
37
- < RadioButton
38
- checked = { checked === 0 }
39
- onPress = { ( ) => this . setState ( { checked : 0 } ) }
40
- />
41
- < Paragraph style = { styles . paragraph } > Option 1</ Paragraph >
42
- </ View >
43
- < View style = { styles . checkBoxRow } >
44
- < RadioButton
45
- checked = { checked === 1 }
46
- onPress = { ( ) => this . setState ( { checked : 1 } ) }
47
- />
48
- < Paragraph style = { styles . paragraph } > Option 2</ Paragraph >
49
- </ View >
50
- < View style = { styles . checkBoxRow } >
51
- < RadioButton
52
- checked = { checked === 2 }
53
- onPress = { ( ) => this . setState ( { checked : 2 } ) }
54
- />
55
- < Paragraph style = { styles . paragraph } > Option 3</ Paragraph >
56
- </ View >
57
- < View style = { styles . checkBoxRow } >
58
- < RadioButton
59
- checked = { checked === 3 }
60
- onPress = { ( ) => this . setState ( { checked : 3 } ) }
61
- />
62
- < Paragraph style = { styles . paragraph } > Option 4</ Paragraph >
63
- </ View >
42
+ < TouchableRipple onPress = { ( ) => this . setState ( { checked : 0 } ) } >
43
+ < View style = { styles . row } >
44
+ < Paragraph > Option 1</ Paragraph >
45
+ < View pointerEvents = "none" >
46
+ < RadioButton value = "normal" checked = { checked === 0 } />
47
+ </ View >
48
+ </ View >
49
+ </ TouchableRipple >
50
+ < TouchableRipple onPress = { ( ) => this . setState ( { checked : 1 } ) } >
51
+ < View style = { styles . row } >
52
+ < Paragraph > Option 2</ Paragraph >
53
+ < View pointerEvents = "none" >
54
+ < RadioButton value = "normal" checked = { checked === 1 } />
55
+ </ View >
56
+ </ View >
57
+ </ TouchableRipple >
58
+ < TouchableRipple onPress = { ( ) => this . setState ( { checked : 2 } ) } >
59
+ < View style = { styles . row } >
60
+ < Paragraph > Option 3</ Paragraph >
61
+ < View pointerEvents = "none" >
62
+ < RadioButton value = "normal" checked = { checked === 2 } />
63
+ </ View >
64
+ </ View >
65
+ </ TouchableRipple >
66
+ < TouchableRipple onPress = { ( ) => this . setState ( { checked : 3 } ) } >
67
+ < View style = { styles . row } >
68
+ < Paragraph > Option 4</ Paragraph >
69
+ < View pointerEvents = "none" >
70
+ < RadioButton value = "normal" checked = { checked === 3 } />
71
+ </ View >
72
+ </ View >
73
+ </ TouchableRipple >
64
74
</ View >
65
75
</ ScrollView >
66
76
</ Dialog . ScrollArea >
@@ -75,10 +85,11 @@ export default class extends Component<void, Props, State> {
75
85
}
76
86
77
87
const styles = StyleSheet . create ( {
78
- checkBoxRow : {
88
+ row : {
79
89
flexDirection : 'row' ,
80
90
alignItems : 'center' ,
81
- height : 56 ,
91
+ justifyContent : 'space-between' ,
92
+ padding : 8 ,
93
+ paddingHorizontal : 24 ,
82
94
} ,
83
- paragraph : { marginLeft : 16 } ,
84
95
} ) ;
0 commit comments