Skip to content

Commit 1892b81

Browse files
committed
more consistent styles across platforms
1 parent 660d12c commit 1892b81

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

app/components/welcome/index.js

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ class Welcome extends Component {
145145
if (!this.props.queries){return}
146146
for (let query of this.props.queries){
147147
queries.push(
148-
<TouchableOpacity style={styles.queryContainer} onPress={() => this.props.setGeocode(query.geometry.coordinates)}>
148+
<TouchableOpacity key={query.place_name} style={styles.queryContainer} onPress={() => this.props.setGeocode(query.geometry.coordinates)}>
149149
<Text ellipsizeMode="tail" numberOfLines={1} style={[styles.listText, (this.props.geocode.latitude == query.geometry.coordinates[0]) ? styles.selectedQuery : styles.listText]}>
150150
{query.place_name}
151151
</Text>
152152
</TouchableOpacity>
153153
)
154154
}
155-
return <View style={styles.queryList}>{queries}</View>
155+
return <View style={queries.length > 1 && styles.queryList}>{queries}</View>
156156
}
157157

158158
render() {
@@ -190,14 +190,12 @@ class Welcome extends Component {
190190
</View>
191191
}
192192
{(Platform.OS === 'android') &&
193-
<View>
194-
<View title="TimePickerAndroid">
195-
<TouchableOpacity
196-
onPress={this.showPicker.bind(this, {})}>
197-
<Text style={styles.text}>{this.timeString(this.props.time)}</Text>
198-
</TouchableOpacity>
199-
</View>
200-
</View>
193+
<View>
194+
<TouchableOpacity
195+
onPress={this.showPicker.bind(this, {})}>
196+
<Text style={styles.text}>{this.timeString(this.props.time)}</Text>
197+
</TouchableOpacity>
198+
</View>
201199
}
202200
</ScrollView>
203201
<TouchableOpacity style={styles.buttonContainer} onPress={this.handleSubmit.bind(this)}>
@@ -213,7 +211,7 @@ class Welcome extends Component {
213211

214212
const styles = StyleSheet.create({
215213
title: {
216-
fontSize: 15 * PixelRatio.getFontScale(),
214+
fontSize: 12 * PixelRatio.getFontScale(),
217215
textAlign: 'center'
218216
},
219217
outerContainer: {
@@ -228,8 +226,8 @@ const styles = StyleSheet.create({
228226
},
229227
text: {
230228
fontFamily: 'HelveticaNeue-Medium',
231-
fontSize: 15 * PixelRatio.getFontScale(),
232-
height: 40,
229+
fontSize: 12 * PixelRatio.getFontScale(),
230+
paddingVertical: 10,
233231
color: colors.primary,
234232
backgroundColor: colors.background,
235233
textAlign: 'center'
@@ -245,7 +243,13 @@ const styles = StyleSheet.create({
245243
queryContainer: {
246244
},
247245
queryList: {
248-
marginHorizontal: 20
246+
marginHorizontal: 10,
247+
paddingHorizontal: 10,
248+
paddingBottom: 10,
249+
borderLeftWidth: 1,
250+
borderBottomWidth: 1,
251+
borderRightWidth: 1,
252+
borderColor: colors.primary,
249253
},
250254
textInput: {
251255
paddingHorizontal: 20,
@@ -264,7 +268,7 @@ const styles = StyleSheet.create({
264268
button: {
265269
flex: 1,
266270
marginHorizontal: 100,
267-
padding:10,
271+
paddingTop: 10,
268272
height:45,
269273
borderRadius:4,
270274
borderWidth: 2,

0 commit comments

Comments
 (0)