Skip to content

Commit 6d40e36

Browse files
committed
feat: add large style for map picker btn.
See: https://www.figma.com/design/YgY3EzgQ0MatriA4hTTrdr/Weku-Yummy-Needs
1 parent f94f92b commit 6d40e36

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

src/components/AddressAutocomplete.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
Text,
1212
View,
1313
useColorModeValue,
14+
Button,
1415
IconButton,
1516
Box,
1617
} from 'native-base';
@@ -68,6 +69,7 @@ function AddressAutocomplete(props) {
6869
placeholder,
6970
onMapPickerPress,
7071
location,
72+
mapPickerStyle = "small",
7173
...otherProps
7274
} = props;
7375

@@ -376,8 +378,11 @@ function AddressAutocomplete(props) {
376378

377379
const renderTextInput = inputProps => (
378380
<View style={styles.textInputContainer}>
379-
<TouchableOpacity
380-
style={styles.mapPickerButton}
381+
{mapPickerStyle === 'small' && <TouchableOpacity
382+
style={{
383+
backgroundColor: props.primaryColor,
384+
...styles.mapPickerButton
385+
}}
381386
onPress={() => setShowPickerModal(true)}
382387
testID="map-picker-button"
383388
accessibilityLabel={t('PICK_ON_MAP')}
@@ -388,7 +393,7 @@ function AddressAutocomplete(props) {
388393
color="white"
389394
size={5}
390395
/>
391-
</TouchableOpacity>
396+
</TouchableOpacity>}
392397
<Input
393398
{...inputProps}
394399
style={[
@@ -500,6 +505,14 @@ function AddressAutocomplete(props) {
500505
...style,
501506
}}
502507
/>
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+
</>}
503516
</View>
504517
</>
505518
);
@@ -557,7 +570,6 @@ const styles = StyleSheet.create({
557570
zIndex: 1,
558571
},
559572
mapPickerButton: {
560-
backgroundColor: 'red',
561573
borderRadius: 4,
562574
padding: 8,
563575
marginLeft: 8,
@@ -567,6 +579,10 @@ const styles = StyleSheet.create({
567579
height: 36,
568580
width: 36,
569581
},
582+
orText: {
583+
marginVertical: 16,
584+
textAlign: 'center',
585+
}
570586
});
571587

572588
function mapStateToProps(state) {

src/navigation/home/AskAddress.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const AskAddress = props => {
4545
</Box>
4646
<Box style={{ flex: 2 }} onLayout={onLayout}>
4747
<AddressAutocomplete
48+
mapPickerStyle='large'
4849
testID="askAddressAutocomplete"
4950
inputContainerStyle={{
5051
height: textInputContainerHeight,

0 commit comments

Comments
 (0)