Skip to content

Commit 75af81c

Browse files
committed
Cleanup RadioButto example screen
1 parent f27c060 commit 75af81c

File tree

1 file changed

+21
-25
lines changed

1 file changed

+21
-25
lines changed

demo/src/screens/componentScreens/RadioButtonScreen.js

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, {Component} from 'react';
2-
import {TouchableOpacity, ScrollView, Platform, StyleSheet} from 'react-native';
2+
import {TouchableOpacity, ScrollView} from 'react-native';
33
import {Assets, RadioButton, Colors, Shadows, RadioGroup, View, Text} from 'react-native-ui-lib'; //eslint-disable-line
44
const starIcon = require('../../assets/icons/star.png');
55

@@ -39,7 +39,14 @@ export default class RadioButtonScreen extends Component {
3939
renderRadioButtonWithImage(value, icon, style) {
4040
return (
4141
<View row centerV marginR-15>
42-
<RadioButton value={value} size={15} color={Colors.green30} borderRadius={0} iconSource={icon} iconStyle={style}/>
42+
<RadioButton
43+
value={value}
44+
size={15}
45+
color={Colors.green30}
46+
borderRadius={0}
47+
iconSource={icon}
48+
iconStyle={style}
49+
/>
4350
</View>
4451
);
4552
}
@@ -55,8 +62,12 @@ export default class RadioButtonScreen extends Component {
5562
render() {
5663
return (
5764
<View flex useSafeArea bg-grey80>
58-
<View flex>
59-
<ScrollView style={{padding: 20}}>
65+
<ScrollView>
66+
<View padding-page>
67+
<Text h1 marginB-s5>
68+
Radio Buttons
69+
</Text>
70+
6071
<RadioGroup initialValue={this.state.color || null} onValueChange={value => this.setState({color: value})}>
6172
<Text marginB-20 text60 grey10>
6273
Select a color{'\n'}
@@ -69,7 +80,11 @@ export default class RadioButtonScreen extends Component {
6980
<Text marginT-10>You chose: {this.state.color ? this.state.color : 'Default'}</Text>
7081
</RadioGroup>
7182

72-
<RadioGroup marginT-30 initialValue={this.state.textSide} onValueChange={value => this.setState({textSide: value})}>
83+
<RadioGroup
84+
marginT-30
85+
initialValue={this.state.textSide}
86+
onValueChange={value => this.setState({textSide: value})}
87+
>
7388
<Text marginB-20 text60 grey10>
7489
Alignments
7590
</Text>
@@ -129,28 +144,9 @@ export default class RadioButtonScreen extends Component {
129144
</View>
130145

131146
<View style={{height: 30}}/>
132-
</ScrollView>
133-
134-
<View paddingH-20 paddingV-10 style={[styles.shadow, {backgroundColor: Colors.grey80}]}>
135-
<Text text40 grey10>
136-
Radio Buttons
137-
</Text>
138147
</View>
139-
</View>
148+
</ScrollView>
140149
</View>
141150
);
142151
}
143152
}
144-
145-
const styles = StyleSheet.create({
146-
shadow: {
147-
...Platform.select({
148-
ios: {
149-
...Shadows.grey20.bottom
150-
},
151-
android: {
152-
elevation: 3
153-
}
154-
})
155-
}
156-
});

0 commit comments

Comments
 (0)