@@ -11,6 +11,7 @@ import {
11
11
Text ,
12
12
View ,
13
13
useColorModeValue ,
14
+ Button ,
14
15
IconButton ,
15
16
Box ,
16
17
} from 'native-base' ;
@@ -68,6 +69,7 @@ function AddressAutocomplete(props) {
68
69
placeholder,
69
70
onMapPickerPress,
70
71
location,
72
+ mapPickerStyle = "small" ,
71
73
...otherProps
72
74
} = props ;
73
75
@@ -376,8 +378,11 @@ function AddressAutocomplete(props) {
376
378
377
379
const renderTextInput = inputProps => (
378
380
< View style = { styles . textInputContainer } >
379
- < TouchableOpacity
380
- style = { styles . mapPickerButton }
381
+ { mapPickerStyle === 'small' && < TouchableOpacity
382
+ style = { {
383
+ backgroundColor : props . primaryColor ,
384
+ ...styles . mapPickerButton
385
+ } }
381
386
onPress = { ( ) => setShowPickerModal ( true ) }
382
387
testID = "map-picker-button"
383
388
accessibilityLabel = { t ( 'PICK_ON_MAP' ) }
@@ -388,7 +393,7 @@ function AddressAutocomplete(props) {
388
393
color = "white"
389
394
size = { 5 }
390
395
/>
391
- </ TouchableOpacity >
396
+ </ TouchableOpacity > }
392
397
< Input
393
398
{ ...inputProps }
394
399
style = { [
@@ -500,6 +505,14 @@ function AddressAutocomplete(props) {
500
505
...style ,
501
506
} }
502
507
/>
508
+ { mapPickerStyle === 'large' && < >
509
+ < Text style = { styles . orText } > Or find myself on the map</ Text >
510
+ < Button backgroundColor = { props . primaryColor }
511
+ onPress = { ( ) => setShowPickerModal ( true ) }
512
+ testID = "map-picker-button"
513
+ accessibilityLabel = { t ( 'PICK_ON_MAP' ) }
514
+ > Find me</ Button >
515
+ </ > }
503
516
</ View >
504
517
</ >
505
518
) ;
@@ -557,7 +570,6 @@ const styles = StyleSheet.create({
557
570
zIndex : 1 ,
558
571
} ,
559
572
mapPickerButton : {
560
- backgroundColor : 'red' ,
561
573
borderRadius : 4 ,
562
574
padding : 8 ,
563
575
marginLeft : 8 ,
@@ -567,6 +579,10 @@ const styles = StyleSheet.create({
567
579
height : 36 ,
568
580
width : 36 ,
569
581
} ,
582
+ orText : {
583
+ marginVertical : 16 ,
584
+ textAlign : 'center' ,
585
+ }
570
586
} ) ;
571
587
572
588
function mapStateToProps ( state ) {
0 commit comments