ordering-ui-react-native 0.10.3 → 0.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/package.json +2 -1
  2. package/themes/business/index.tsx +12 -12
  3. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +49 -43
  4. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +4 -10
  5. package/themes/business/src/components/Chat/index.tsx +97 -60
  6. package/themes/business/src/components/DriverMap/index.tsx +196 -183
  7. package/themes/business/src/components/FloatingButton/index.tsx +61 -43
  8. package/themes/business/src/components/FloatingButton/styles.tsx +2 -5
  9. package/themes/business/src/components/GoogleMap/index.tsx +10 -8
  10. package/themes/business/src/components/Home/index.tsx +2 -5
  11. package/themes/business/src/components/Home/styles.tsx +1 -2
  12. package/themes/business/src/components/LanguageSelector/index.tsx +1 -3
  13. package/themes/business/src/components/MessagesOption/index.tsx +13 -18
  14. package/themes/business/src/components/MessagesOption/styles.tsx +3 -0
  15. package/themes/business/src/components/OrderDetails/Business.tsx +642 -0
  16. package/themes/business/src/components/OrderDetails/Delivery.tsx +436 -0
  17. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +378 -0
  18. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +148 -0
  19. package/themes/business/src/components/OrderDetails/styles.tsx +16 -74
  20. package/themes/business/src/components/OrderMessage/index.tsx +5 -2
  21. package/themes/business/src/components/OrdersOption/index.tsx +344 -302
  22. package/themes/business/src/components/OrdersOption/styles.tsx +4 -2
  23. package/themes/business/src/components/PreviousMessages/index.tsx +15 -8
  24. package/themes/business/src/components/PreviousOrders/index.tsx +86 -141
  25. package/themes/business/src/components/PreviousOrders/styles.tsx +4 -3
  26. package/themes/business/src/components/UserProfileForm/index.tsx +73 -6
  27. package/themes/business/src/components/UserProfileForm/styles.tsx +0 -2
  28. package/themes/business/src/components/shared/OModal.tsx +9 -7
  29. package/themes/business/src/components/shared/OTextarea.tsx +2 -1
  30. package/themes/business/src/layouts/SafeAreaContainer.tsx +2 -2
  31. package/themes/business/src/types/index.tsx +24 -13
  32. package/themes/business/src/utils/index.tsx +160 -0
  33. package/themes/business/src/components/OrderDetails/index.tsx +0 -1262
  34. package/themes/business/src/components/OrderDetailsDelivery/index.tsx +0 -1056
  35. package/themes/business/src/components/OrderDetailsDelivery/styles.tsx +0 -142
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect, useRef } from 'react';
2
- import { Dimensions, StyleSheet, View } from 'react-native';
2
+ import { Dimensions, SafeAreaView, StyleSheet, View } from 'react-native';
3
3
  import MapView, {
4
4
  PROVIDER_GOOGLE,
5
5
  Marker,
@@ -16,7 +16,6 @@ import { useTheme } from 'styled-components/native';
16
16
  import { useLocation } from '../../hooks/useLocation';
17
17
  // import MapViewDirections from 'react-native-maps-directions';
18
18
  import { FloatingButton } from '../FloatingButton';
19
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
20
19
 
21
20
  export const DriverMap = (props: GoogleMapsParams) => {
22
21
  const {
@@ -76,7 +75,6 @@ export const DriverMap = (props: GoogleMapsParams) => {
76
75
  longitude: initialPosition.longitude,
77
76
  };
78
77
  const destination = { latitude: location.lat, longitude: location.lng };
79
- const { top } = useSafeAreaInsets();
80
78
 
81
79
  useEffect(() => {
82
80
  if (isToFollow) {
@@ -348,8 +346,9 @@ export const DriverMap = (props: GoogleMapsParams) => {
348
346
  },
349
347
  buttonBack: {
350
348
  borderWidth: 0,
349
+ maxWidth: 40,
351
350
  alignItems: 'flex-start',
352
- justifyContent: 'flex-start',
351
+ justifyContent: 'flex-end',
353
352
  },
354
353
  facContainer: {
355
354
  position: 'absolute',
@@ -357,17 +356,20 @@ export const DriverMap = (props: GoogleMapsParams) => {
357
356
  zIndex: 9999,
358
357
  width: '100%',
359
358
  backgroundColor: theme.colors.white,
359
+ paddingHorizontal: 30,
360
+ paddingTop: 30,
360
361
  },
361
362
  facOrderStatus: {
362
363
  flexDirection: 'row',
363
- paddingTop: top + 13,
364
364
  borderBottomWidth: 11,
365
+ minHeight: 70,
365
366
  borderBottomColor: theme.colors.inputChat,
367
+ paddingVertical: 5,
366
368
  },
367
369
  facDistance: {
368
370
  flexDirection: 'row',
369
- minHeight: 70,
370
371
  alignItems: 'center',
372
+ minHeight: 75,
371
373
  },
372
374
  arrowDistance: {
373
375
  borderWidth: 0,
@@ -375,194 +377,205 @@ export const DriverMap = (props: GoogleMapsParams) => {
375
377
  });
376
378
 
377
379
  return (
378
- <>
380
+ <SafeAreaView style={{ flex: 1 }}>
379
381
  <View style={{ flex: 1 }}>
380
- <MapView
381
- ref={mapRef}
382
- provider={PROVIDER_GOOGLE}
383
- initialRegion={{
384
- latitude: initialPosition.latitude,
385
- longitude: initialPosition.longitude,
386
- latitudeDelta: 0.001,
387
- longitudeDelta: 0.001 * ASPECT_RATIO,
388
- }}
389
- style={{ flex: 1 }}
390
- // showsUserLocation
391
-
392
- zoomTapEnabled
393
- // onRegionChangeComplete={
394
- // !readOnly
395
- // ? coordinates => handleChangeRegion(coordinates)
396
- // : () => {}
397
- // }
398
- zoomEnabled
399
- zoomControlEnabled
400
- cacheEnabled
401
- moveOnMarkerPress
402
- onTouchStart={() => (following.current = false)}>
403
- {location ? (
404
- <>
405
- <Polyline
406
- coordinates={[
407
- { latitude: location.lat, longitude: location.lng },
408
- {
409
- latitude: userLocation.latitude,
410
- longitude: userLocation.longitude,
411
- },
412
- ]}
413
- strokeColor="blue"
414
- strokeWidth={3}
415
- />
416
- <Marker
417
- coordinate={{ latitude: location.lat, longitude: location.lng }}
418
- title={location.title}>
419
- <Icon
420
- name="map-marker"
421
- size={50}
422
- color={theme.colors.primary}
382
+ <View style={{ flex: 1 }}>
383
+ <MapView
384
+ ref={mapRef}
385
+ provider={PROVIDER_GOOGLE}
386
+ initialRegion={{
387
+ latitude: initialPosition.latitude,
388
+ longitude: initialPosition.longitude,
389
+ latitudeDelta: 0.001,
390
+ longitudeDelta: 0.001 * ASPECT_RATIO,
391
+ }}
392
+ style={{ flex: 1 }}
393
+ // showsUserLocation
394
+
395
+ zoomTapEnabled
396
+ // onRegionChangeComplete={
397
+ // !readOnly
398
+ // ? coordinates => handleChangeRegion(coordinates)
399
+ // : () => {}
400
+ // }
401
+ zoomEnabled
402
+ zoomControlEnabled
403
+ cacheEnabled
404
+ moveOnMarkerPress
405
+ onTouchStart={() => (following.current = false)}>
406
+ {location ? (
407
+ <>
408
+ <Polyline
409
+ coordinates={[
410
+ { latitude: location.lat, longitude: location.lng },
411
+ {
412
+ latitude: userLocation.latitude,
413
+ longitude: userLocation.longitude,
414
+ },
415
+ ]}
416
+ strokeColor="blue"
417
+ strokeWidth={3}
423
418
  />
424
- <View style={styles.view}>
425
- <OIcon
426
- style={styles.image}
427
- url={location.icon}
428
- width={25}
429
- height={25}
430
- />
431
- </View>
432
- </Marker>
433
- <Marker coordinate={userLocation}>
434
- <View style={styles.driverIcon}>
435
- <OIcon
436
- style={styles.image}
437
- src={theme.images.general.driverImage}
438
- width={25}
439
- height={25}
419
+ <Marker
420
+ coordinate={{
421
+ latitude: location.lat,
422
+ longitude: location.lng,
423
+ }}
424
+ title={location.title}>
425
+ <Icon
426
+ name="map-marker"
427
+ size={50}
428
+ color={theme.colors.primary}
440
429
  />
441
- </View>
442
- </Marker>
443
- </>
444
- ) : (
445
- <Marker
446
- coordinate={{
447
- latitude: userLocation.latitude,
448
- longitude: userLocation.longitude,
449
- }}
450
- title={markerTitle || t('YOUR_LOCATION', 'Your Location')}
451
- />
452
- )}
453
- </MapView>
454
- </View>
430
+ <View style={styles.view}>
431
+ <OIcon
432
+ style={styles.image}
433
+ url={location.icon}
434
+ width={25}
435
+ height={25}
436
+ />
437
+ </View>
438
+ </Marker>
439
+ <Marker coordinate={userLocation}>
440
+ <View style={styles.driverIcon}>
441
+ <OIcon
442
+ style={styles.image}
443
+ src={theme.images.general.driverImage}
444
+ width={25}
445
+ height={25}
446
+ />
447
+ </View>
448
+ </Marker>
449
+ </>
450
+ ) : (
451
+ <Marker
452
+ coordinate={{
453
+ latitude: userLocation.latitude,
454
+ longitude: userLocation.longitude,
455
+ }}
456
+ title={markerTitle || t('YOUR_LOCATION', 'Your Location')}
457
+ />
458
+ )}
459
+ </MapView>
460
+ </View>
455
461
 
456
- <OFab
457
- iconName="globe-sharp"
458
- onPress={fitCoordinatesZoom}
459
- style={{
460
- position: 'absolute',
461
- bottom: showAcceptOrReject ? 115 : 75,
462
- right: 20,
463
- }}
464
- />
465
- <OFab
466
- iconName="car-sport-sharp"
467
- onPress={centerPosition}
468
- style={{
469
- position: 'absolute',
470
- bottom: showAcceptOrReject ? 80 : 35,
471
- right: 20,
472
- }}
473
- />
474
- <View style={styles.facContainer}>
475
- <View style={styles.facOrderStatus}>
476
- <View
477
- style={{
478
- width: '25%',
479
- justifyContent: 'center',
480
- }}>
481
- <OIconButton
482
- icon={theme.images.general.close}
483
- iconStyle={{
484
- width: 35,
485
- height: 15,
486
- }}
487
- style={styles.buttonBack}
488
- onClick={() => handleArrowBack()}
489
- />
462
+ <OFab
463
+ iconName="globe-sharp"
464
+ onPress={fitCoordinatesZoom}
465
+ style={{
466
+ position: 'absolute',
467
+ bottom: showAcceptOrReject ? 115 : 75,
468
+ right: 20,
469
+ }}
470
+ />
471
+ <OFab
472
+ iconName="car-sport-sharp"
473
+ onPress={centerPosition}
474
+ style={{
475
+ position: 'absolute',
476
+ bottom: showAcceptOrReject ? 80 : 35,
477
+ right: 20,
478
+ }}
479
+ />
480
+ <View style={styles.facContainer}>
481
+ <View style={styles.facOrderStatus}>
482
+ <View
483
+ style={{
484
+ width: '15%',
485
+ justifyContent: 'flex-start',
486
+ alignItems: 'flex-start',
487
+ paddingBottom: 10,
488
+ marginRight: 10,
489
+ }}>
490
+ <OIconButton
491
+ icon={theme.images.general.close}
492
+ iconStyle={{
493
+ width: 13,
494
+ height: 13,
495
+ }}
496
+ style={styles.buttonBack}
497
+ onClick={() => handleArrowBack()}
498
+ />
499
+ </View>
500
+ <View style={{ width: '85%', paddingRight: 10, paddingBottom: 10 }}>
501
+ <OText size={12} color={theme.colors.textGray}>
502
+ {order?.delivery_datetime_utc
503
+ ? parseDate(order?.delivery_datetime_utc)
504
+ : parseDate(order?.delivery_datetime, { utc: false })}
505
+ {` - ${order?.paymethod?.name}`}
506
+ </OText>
507
+ <OText weight="bold">
508
+ {t('INVOICE_ORDER_NO', 'Order No.')} {order?.id}
509
+ {` ${t('IS', 'is')} `}
510
+ <OText
511
+ size={16}
512
+ numberOfLines={2}
513
+ color={colors[order?.status] || theme.colors.statusOrderBlue}>
514
+ {`${orderStatus}`}
515
+ </OText>
516
+ </OText>
517
+ </View>
490
518
  </View>
491
- <View style={{ width: '75%' }}>
492
- <OText size={12} color={theme.colors.textGray}>
493
- {order?.delivery_datetime_utc
494
- ? parseDate(order?.delivery_datetime_utc)
495
- : parseDate(order?.delivery_datetime, { utc: false })}
496
- {` - ${order?.paymethod?.name}`}
497
- </OText>
498
- <OText weight="bold">
499
- {t('INVOICE_ORDER_NO', 'Order No.')} {order?.id}
500
- {` ${t('IS', 'is')} `}
519
+
520
+ <View style={styles.facDistance}>
521
+ <View
522
+ style={{
523
+ width: '15%',
524
+ alignItems: 'center',
525
+ marginRight: 10,
526
+ }}>
527
+ <OIcon
528
+ src={theme.images.general.arrow_distance}
529
+ style={styles.arrowDistance}
530
+ />
531
+ <OText size={12} numberOfLines={3}>{`${(
532
+ distancesFromTwoPlacesKm * 3280.84
533
+ ).toFixed(0)} ${t('FT', 'Ft')}`}</OText>
534
+ </View>
535
+ <View style={{ width: '75%', paddingRight: 20 }}>
501
536
  <OText
502
- size={16}
537
+ color={theme.colors.unselectText}
538
+ size={13}
503
539
  numberOfLines={2}
504
- color={colors[order?.status] || theme.colors.statusOrderBlue}>
505
- {`${orderStatus}`}
540
+ adjustsFontSizeToFit>
541
+ {`${travelTime.toFixed(2)} - ${
542
+ isMin ? t('MINNUTES', 'mins') : t('HOURS', 'hours')
543
+ } ${distancesFromTwoPlacesKm.toFixed(2)} km`}
506
544
  </OText>
507
- </OText>
508
- </View>
509
- </View>
510
-
511
- <View style={styles.facDistance}>
512
- <View
513
- style={{
514
- width: '25%',
515
- alignItems: 'center',
516
- paddingHorizontal: 20,
517
- }}>
518
- <OIcon
519
- src={theme.images.general.arrow_distance}
520
- style={styles.arrowDistance}
521
- />
522
- <OText size={12} numberOfLines={2}>{`${(
523
- distancesFromTwoPlacesKm * 3280.84
524
- ).toFixed(0)} ${t('FT', 'Ft')}`}</OText>
525
- </View>
526
- <View style={{ width: '75%' }}>
527
- <OText
528
- color={theme.colors.unselectText}
529
- size={13}
530
- numberOfLines={2}
531
- adjustsFontSizeToFit>
532
- {`${travelTime.toFixed(2)} - ${
533
- isMin ? t('MINNUTES', 'mins') : t('HOURS', 'hours')
534
- } ${distancesFromTwoPlacesKm.toFixed(2)} km`}
535
- </OText>
536
- <OText size={13} numberOfLines={3} adjustsFontSizeToFit>
537
- {infoRealTime?.formatted_address}
538
- </OText>
545
+ <OText size={13} numberOfLines={3} adjustsFontSizeToFit>
546
+ {infoRealTime?.formatted_address}
547
+ </OText>
548
+ </View>
539
549
  </View>
540
550
  </View>
541
- </View>
542
551
 
543
- {showAcceptOrReject && (
544
- <FloatingButton
545
- btnText={t('REJECT', 'Reject')}
546
- isSecondaryBtn={false}
547
- secondButtonClick={() =>
548
- handleViewActionOrder && handleViewActionOrder('accept')
549
- }
550
- firstButtonClick={() =>
551
- handleViewActionOrder && handleViewActionOrder('reject')
552
- }
553
- secondBtnText={t('ACCEPT', 'Accept')}
554
- secondButton={true}
555
- firstColorCustom={theme.colors.red}
556
- secondColorCustom={theme.colors.green}
552
+ {showAcceptOrReject && (
553
+ <FloatingButton
554
+ btnText={t('REJECT', 'Reject')}
555
+ isSecondaryBtn={false}
556
+ secondButtonClick={() =>
557
+ handleViewActionOrder && handleViewActionOrder('accept')
558
+ }
559
+ firstButtonClick={() =>
560
+ handleViewActionOrder && handleViewActionOrder('reject')
561
+ }
562
+ secondBtnText={t('ACCEPT', 'Accept')}
563
+ secondButton={true}
564
+ firstColorCustom={theme.colors.red}
565
+ secondColorCustom={theme.colors.green}
566
+ widthButton={'45%'}
567
+ isPadding
568
+ />
569
+ )}
570
+
571
+ <Alert
572
+ open={alertState.open}
573
+ onAccept={closeAlert}
574
+ onClose={closeAlert}
575
+ content={alertState.content}
576
+ title={t('ERROR', 'Error')}
557
577
  />
558
- )}
559
- <Alert
560
- open={alertState.open}
561
- onAccept={closeAlert}
562
- onClose={closeAlert}
563
- content={alertState.content}
564
- title={t('ERROR', 'Error')}
565
- />
566
- </>
578
+ </View>
579
+ </SafeAreaView>
567
580
  );
568
581
  };
@@ -3,7 +3,7 @@ import { FloatingButton as FloatingButtonController } from 'ordering-components/
3
3
  import { FloatingButtonParams } from '../../types';
4
4
  import { Container, Button } from './styles';
5
5
  import { OText } from '../shared';
6
- import { StyleSheet, Platform } from 'react-native';
6
+ import { StyleSheet, Platform, View } from 'react-native';
7
7
  import { useTheme } from 'styled-components/native';
8
8
 
9
9
  const FloatingButtonUI = (props: FloatingButtonParams) => {
@@ -23,6 +23,8 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
23
23
  color,
24
24
  isSecondaryBtn,
25
25
  secondButton,
26
+ widthButton,
27
+ isPadding,
26
28
  } = props;
27
29
 
28
30
  const theme = useTheme();
@@ -39,58 +41,41 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
39
41
  fontStyle: 'normal',
40
42
  fontWeight: 'normal',
41
43
  fontSize: 18,
44
+ paddingHorizontal: 10,
45
+ paddingVertical: 10,
42
46
  position: 'absolute',
43
47
  width: '100%',
44
- paddingBottom: 5,
45
48
  left: 0,
46
49
  textAlign: 'center',
47
50
  },
48
51
  });
49
52
 
50
53
  return (
51
- <Container isIos={Platform.OS === 'ios'}>
52
- <Button
53
- secondButton={secondButton}
54
- style={[
55
- {
56
- borderWidth: colorTxt1 ? 1 : 0,
57
- borderColor: colorTxt1 ? colorTxt1 : null,
58
- },
59
- secondButton
60
- ? { backgroundColor: firstColorCustom || styles.primaryBtn }
61
- : color
62
- ? { backgroundColor: color }
63
- : styles.primaryBtn,
64
- ]}
65
- onPress={firstButtonClick}
66
- disabled={disabled}>
67
- <OText color={theme.colors.white} size={16} mLeft={20}>
68
- {btnLeftValueShow ? btnLeftValue : ''}
69
- </OText>
70
-
71
- <OText
72
- style={styles.btnTextStyle}
73
- color={colorTxt1 ? colorTxt1 : theme.colors.white}
74
- size={16}>
75
- {btnText}
76
- </OText>
77
-
78
- <OText color={theme.colors.white} size={16} mRight={20}>
79
- {btnRightValueShow ? btnRightValue : ''}
80
- </OText>
81
- </Button>
82
-
83
- {secondButton && (
54
+ <Container
55
+ isIos={Platform.OS === 'ios'}
56
+ style={{ paddingHorizontal: props.isPadding ? 30 : 0 }}>
57
+ <View
58
+ style={{
59
+ flexDirection: 'row',
60
+ width: '100%',
61
+ justifyContent: 'space-between',
62
+ }}>
84
63
  <Button
85
64
  secondButton={secondButton}
86
65
  style={[
66
+ {
67
+ borderWidth: colorTxt1 ? 1 : 0,
68
+ borderColor: colorTxt1 ? colorTxt1 : null,
69
+ },
87
70
  secondButton
88
- ? { backgroundColor: secondColorCustom || styles.secodaryBtn }
71
+ ? { backgroundColor: firstColorCustom || styles.primaryBtn }
89
72
  : color
90
- ? color
91
- : styles.secodaryBtn,
73
+ ? { backgroundColor: color }
74
+ : styles.primaryBtn,
75
+ ,
76
+ { width: widthButton },
92
77
  ]}
93
- onPress={secondButtonClick}
78
+ onPress={firstButtonClick}
94
79
  disabled={disabled}>
95
80
  <OText color={theme.colors.white} size={16} mLeft={20}>
96
81
  {btnLeftValueShow ? btnLeftValue : ''}
@@ -98,16 +83,49 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
98
83
 
99
84
  <OText
100
85
  style={styles.btnTextStyle}
101
- color={theme.colors.white}
102
- size={16}>
103
- {secondBtnText}
86
+ color={colorTxt1 ? colorTxt1 : theme.colors.white}
87
+ numberOfLines={2}
88
+ adjustsFontSizeToFit>
89
+ {btnText}
104
90
  </OText>
105
91
 
106
92
  <OText color={theme.colors.white} size={16} mRight={20}>
107
93
  {btnRightValueShow ? btnRightValue : ''}
108
94
  </OText>
109
95
  </Button>
110
- )}
96
+
97
+ {secondButton && (
98
+ <Button
99
+ secondButton={secondButton}
100
+ style={[
101
+ secondButton
102
+ ? { backgroundColor: secondColorCustom || styles.secodaryBtn }
103
+ : color
104
+ ? color
105
+ : styles.secodaryBtn,
106
+ ,
107
+ { width: widthButton },
108
+ ]}
109
+ onPress={secondButtonClick}
110
+ disabled={disabled}>
111
+ <OText color={theme.colors.white} size={16} mLeft={20}>
112
+ {btnLeftValueShow ? btnLeftValue : ''}
113
+ </OText>
114
+
115
+ <OText
116
+ style={styles.btnTextStyle}
117
+ color={theme.colors.white}
118
+ numberOfLines={2}
119
+ adjustsFontSizeToFit>
120
+ {secondBtnText}
121
+ </OText>
122
+
123
+ <OText color={theme.colors.white} size={16} mRight={20}>
124
+ {btnRightValueShow ? btnRightValue : ''}
125
+ </OText>
126
+ </Button>
127
+ )}
128
+ </View>
111
129
  </Container>
112
130
  );
113
131
  };
@@ -6,18 +6,16 @@ export const Container = styled.View`
6
6
  flex: 1;
7
7
  bottom: 0px;
8
8
  left: 0;
9
- padding: 10px;
9
+ padding-vertical: 10px;
10
10
  width: 100%;
11
11
  display: flex;
12
- align-items: center;
13
12
  justify-content: center;
14
13
  background-color: #fff;
15
14
  z-index: 1000;
16
-
17
15
  ${(props: any) =>
18
16
  props.isIos &&
19
17
  css`
20
- padding-bottom: 20px;
18
+ padding-bottom: 5px;
21
19
  `}
22
20
  `;
23
21
 
@@ -28,7 +26,6 @@ export const Button = styled.TouchableOpacity`
28
26
  align-items: center;
29
27
  border-radius: 7px;
30
28
  height: 50px;
31
- margin-horizontal: 10px;
32
29
 
33
30
  ${(props: any) =>
34
31
  css`
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect, useRef } from 'react';
2
- import { Dimensions, StyleSheet, View } from 'react-native';
2
+ import { Dimensions, StyleSheet, View, SafeAreaView } from 'react-native';
3
3
  import MapView, { PROVIDER_GOOGLE, Marker, Region } from 'react-native-maps';
4
4
  import Geocoder from 'react-native-geocoding';
5
5
  import { useLanguage, useConfig, useUtils } from 'ordering-components/native';
@@ -37,7 +37,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
37
37
  const [{ optimizeImage }] = useUtils();
38
38
  const { width, height } = Dimensions.get('window');
39
39
  const ASPECT_RATIO = width / height;
40
- const [isMapReady, setIsMapReady] = useState(false)
40
+ const [isMapReady, setIsMapReady] = useState(false);
41
41
  const [markerPosition, setMarkerPosition] = useState({
42
42
  latitude: locations ? locations[locations.length - 1].lat : location.lat,
43
43
  longitude: locations ? locations[locations.length - 1].lng : location.lng,
@@ -217,9 +217,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
217
217
  }, [saveLocation]);
218
218
 
219
219
  useEffect(() => {
220
- if (mapRef.current && locations && isMapReady) {
221
- fitAllMarkers();
222
- }
220
+ if (mapRef.current && locations && isMapReady) {
221
+ fitAllMarkers();
222
+ }
223
223
  }, [isMapReady]);
224
224
 
225
225
  const styles = StyleSheet.create({
@@ -252,7 +252,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
252
252
  });
253
253
 
254
254
  return (
255
- <>
255
+ <SafeAreaView style={{ flex: 1 }}>
256
256
  <View style={{ flex: 1, position: 'relative' }}>
257
257
  <MapView
258
258
  provider={PROVIDER_GOOGLE}
@@ -269,7 +269,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
269
269
  cacheEnabled
270
270
  moveOnMarkerPress
271
271
  ref={mapRef}
272
- onMapReady = {() => setIsMapReady(true)}>
272
+ onMapReady={() => setIsMapReady(true)}>
273
273
  {locations ? (
274
274
  <>
275
275
  {MARKERS &&
@@ -330,6 +330,8 @@ export const GoogleMap = (props: GoogleMapsParams) => {
330
330
  secondButton={false}
331
331
  firstColorCustom={theme.colors.red}
332
332
  secondColorCustom={theme.colors.green}
333
+ widthButton={'100%'}
334
+ isPadding
333
335
  />
334
336
  )}
335
337
  <View style={styles.buttonContainer}>
@@ -340,6 +342,6 @@ export const GoogleMap = (props: GoogleMapsParams) => {
340
342
  onClick={() => handleArrowBack()}
341
343
  />
342
344
  </View>
343
- </>
345
+ </SafeAreaView>
344
346
  );
345
347
  };