@@ -7,6 +7,7 @@ import { updateLocation, updateTime, submitForm, togglePicker } from '../../redu
7
7
import { fetchGeocode , fetchDistance , updateCurrentLocation , setGeocode } from '../../redux/location/action-creators' ;
8
8
import { colors } from '../../lib/colors' ;
9
9
import { travelTimePlusFive , toTimeString } from '../../lib/time' ;
10
+ import Button from 'apsl-react-native-button' ;
10
11
import { Text ,
11
12
View ,
12
13
ScrollView ,
@@ -18,6 +19,7 @@ import {Text,
18
19
Platform ,
19
20
TextInput ,
20
21
Image ,
22
+ Dimensions ,
21
23
DatePickerIOS } from 'react-native' ;
22
24
var PushNotification = require ( 'react-native-push-notification' ) ;
23
25
@@ -135,7 +137,7 @@ class Welcome extends Component {
135
137
if ( ! this . props . queries ) { return }
136
138
for ( let query of this . props . queries ) {
137
139
queries . push (
138
- < TouchableOpacity key = { query . place_name } style = { styles . queryContainer } onPress = { ( ) => this . props . setGeocode ( query . geometry . coordinates ) } >
140
+ < TouchableOpacity key = { query . place_name } onPress = { ( ) => this . props . setGeocode ( query . geometry . coordinates ) } >
139
141
< Text ellipsizeMode = "tail" numberOfLines = { 1 } style = { [ styles . listText , ( this . props . geocode . latitude == query . geometry . coordinates [ 0 ] ) ? styles . selectedQuery : styles . listText ] } >
140
142
{ query . place_name }
141
143
</ Text >
@@ -148,12 +150,12 @@ class Welcome extends Component {
148
150
render ( ) {
149
151
return (
150
152
< Image source = { require ( '../../../images/followme.jpg' ) } style = { styles . outerContainer } >
151
- < ScrollView style = { styles . innerContainer } >
153
+ < ScrollView automaticallyAdjustContentInsets = { false } style = { styles . innerContainer } >
152
154
< Text style = { [ styles . text , styles . title ] } > i want to arrive at</ Text >
153
155
< View style = { styles . separator } />
154
156
< View style = { styles . textInput } >
155
157
< TextInput
156
- style = { [ styles . text , styles . height ] }
158
+ style = { [ styles . text , styles . textInputText ] }
157
159
autoCorrect = { true }
158
160
selectTextOnFocus = { true }
159
161
numberOfLines = { 1 }
@@ -163,7 +165,9 @@ class Welcome extends Component {
163
165
defaultValue = { "Current Location" }
164
166
/>
165
167
</ View >
168
+ < View style = { styles . queryContainer } >
166
169
{ this . renderQueries ( ) }
170
+ </ View >
167
171
< View style = { styles . separator } />
168
172
{ ( Platform . OS === 'ios' ) &&
169
173
< View >
@@ -189,11 +193,11 @@ class Welcome extends Component {
189
193
</ View >
190
194
}
191
195
</ ScrollView >
192
- < TouchableOpacity style = { styles . buttonContainer } onPress = { this . handleSubmit . bind ( this ) } >
193
- < View style = { styles . button } >
196
+ < View style = { styles . buttonContainer } >
197
+ < Button style = { styles . button } onPress = { this . handleSubmit . bind ( this ) } >
194
198
< Text style = { styles . buttonText } > Wander!</ Text >
195
- </ View >
196
- </ TouchableOpacity >
199
+ </ Button >
200
+ </ View >
197
201
</ Image >
198
202
) ;
199
203
}
@@ -206,17 +210,19 @@ const styles = StyleSheet.create({
206
210
textAlign : 'center'
207
211
} ,
208
212
outerContainer : {
209
- paddingTop : 80 ,
213
+ marginTop : 20 ,
210
214
flex : 1 ,
215
+ flexDirection : 'column' ,
211
216
justifyContent : 'center' ,
212
217
alignItems : 'center' ,
213
218
width : null ,
214
219
height : null ,
215
220
backgroundColor : colors . transparent ,
216
221
} ,
217
222
innerContainer : {
223
+ flexDirection : 'row' ,
224
+ flex : 1 ,
218
225
marginTop : 20 ,
219
- marginBottom : 100 ,
220
226
backgroundColor : colors . transparent ,
221
227
} ,
222
228
text : {
@@ -227,8 +233,9 @@ const styles = StyleSheet.create({
227
233
backgroundColor : colors . transparent ,
228
234
textAlign : 'center'
229
235
} ,
230
- height : {
236
+ textInputText : {
231
237
height : 45 ,
238
+ width : Dimensions . get ( 'window' ) . width - 20 ,
232
239
} ,
233
240
listText : {
234
241
fontFamily : 'HelveticaNeue-Medium' ,
@@ -239,8 +246,11 @@ const styles = StyleSheet.create({
239
246
color : colors . CTA
240
247
} ,
241
248
queryContainer : {
249
+ width : Dimensions . get ( 'window' ) . width - 10 ,
242
250
} ,
243
251
queryList : {
252
+ alignSelf : 'center' ,
253
+ justifyContent : 'center' ,
244
254
marginHorizontal : 10 ,
245
255
paddingHorizontal : 10 ,
246
256
paddingBottom : 10 ,
@@ -249,26 +259,18 @@ const styles = StyleSheet.create({
249
259
borderRightWidth : 1 ,
250
260
borderColor : colors . primary ,
251
261
} ,
252
- textInput : {
253
- paddingHorizontal : 20 ,
254
- } ,
255
262
separator : {
256
263
marginTop : 30
257
264
} ,
258
265
buttonContainer : {
259
- position : 'absolute' ,
260
266
alignItems : 'center' ,
261
267
justifyContent : 'center' ,
262
268
flexDirection : 'row' ,
263
- flex : 1 ,
269
+ flex : 0. 1,
264
270
bottom : 50 ,
265
271
} ,
266
272
button : {
267
- flex : 1 ,
268
- marginHorizontal : 100 ,
269
- paddingTop : 10 ,
270
- height :45 ,
271
- borderRadius :4 ,
273
+ paddingHorizontal : 14 ,
272
274
borderWidth : 2 ,
273
275
borderColor : colors . CTA ,
274
276
backgroundColor : colors . transparent
0 commit comments