ordering-ui-react-native 0.12.28 → 0.12.29

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.12.28",
3
+ "version": "0.12.29",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -4,16 +4,15 @@ import MapView, {
4
4
  PROVIDER_GOOGLE,
5
5
  Marker
6
6
  } from 'react-native-maps';
7
- import Geocoder from 'react-native-geocoding';
8
7
  import { useLanguage, useConfig, useUtils } from 'ordering-components/native';
9
8
  import { GoogleMapsParams } from '../../types';
10
9
  import Alert from '../../providers/AlertProvider';
11
- import { OIconButton, OIcon, OFab, OText, OLink } from '../shared';
10
+ import { OIconButton, OIcon, OFab, OText, OButton } from '../shared';
12
11
  import Icon from 'react-native-vector-icons/FontAwesome5';
13
12
  import { useTheme } from 'styled-components/native';
14
13
  import { useLocation } from '../../hooks/useLocation';
15
- // import MapViewDirections from 'react-native-maps-directions';
16
14
  import { FloatingButton } from '../FloatingButton';
15
+ import { showLocation } from 'react-native-map-link';
17
16
 
18
17
  export const DriverMap = (props: GoogleMapsParams) => {
19
18
  const {
@@ -90,11 +89,11 @@ export const DriverMap = (props: GoogleMapsParams) => {
90
89
  content: !(errKey === 'ERROR_MAX_LIMIT_LOCATION_TO')
91
90
  ? [t(errKey, mapErrors[errKey])]
92
91
  : [
93
- `${t(errKey, mapErrors[errKey])} ${maxLimitLocation} ${t(
94
- 'METTERS',
95
- 'meters',
96
- )}`,
97
- ],
92
+ `${t(errKey, mapErrors[errKey])} ${maxLimitLocation} ${t(
93
+ 'METTERS',
94
+ 'meters',
95
+ )}`,
96
+ ],
98
97
  key: errKey,
99
98
  });
100
99
  };
@@ -322,6 +321,17 @@ export const DriverMap = (props: GoogleMapsParams) => {
322
321
  arrowDistance: {
323
322
  borderWidth: 0,
324
323
  },
324
+ buttonContainer: {
325
+ width: '100%',
326
+ alignItems: 'center',
327
+ justifyContent: 'center',
328
+ paddingVertical: 10,
329
+ paddingHorizontal: 80,
330
+ },
331
+ showButton: {
332
+ alignSelf: 'center',
333
+ borderRadius: 10,
334
+ }
325
335
  });
326
336
 
327
337
  return (
@@ -453,7 +463,6 @@ export const DriverMap = (props: GoogleMapsParams) => {
453
463
  </OText>
454
464
  </View>
455
465
  </View>
456
-
457
466
  <View style={styles.facDistance}>
458
467
  <View
459
468
  style={{
@@ -475,22 +484,31 @@ export const DriverMap = (props: GoogleMapsParams) => {
475
484
  size={13}
476
485
  numberOfLines={2}
477
486
  adjustsFontSizeToFit>
478
- {`${travelTime.toFixed(2)} - ${
479
- isMin ? t('MINNUTES', 'mins') : t('HOURS', 'hours')
480
- } ${distancesFromTwoPlacesKm.toFixed(2)} km`}
487
+ {`${travelTime.toFixed(2)} - ${isMin ? t('MINNUTES', 'mins') : t('HOURS', 'hours')
488
+ } ${distancesFromTwoPlacesKm.toFixed(2)} km`}
481
489
  </OText>
482
490
  </View>
483
491
  </View>
484
492
  </View>
485
- <View>
486
- <OLink
487
- PressStyle={{paddingHorizontal: 80, paddingVertical: 10,bottom: showAcceptOrReject ? 80 : 0}}
488
- hasButton
489
- url={Platform.select({
490
- ios: `maps:0,0?q=${destination.latitude},${destination.longitude}`,
491
- android: `geo:0,0?q=${destination.latitude},${destination.longitude}`,
493
+ <View style={styles.buttonContainer}>
494
+ <OButton
495
+ imgRightSrc=''
496
+ textStyle={{ color: theme.colors.white }}
497
+ style={{
498
+ ...styles.showButton,
499
+ bottom: showAcceptOrReject ? 80 : 0
500
+ }}
501
+ onClick={() => showLocation({
502
+ latitude: destination.latitude,
503
+ longitude: destination.longitude,
504
+ sourceLatitude: userLocation.latitude,
505
+ sourceLongitude: userLocation.longitude,
506
+ naverCallerName: 'com.deliveryapp',
507
+ dialogTitle: t('SHOW_IN_OTHER_MAPS', 'Show in other maps'),
508
+ dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
509
+ cancelText: t('CANCEL', 'Cancel'),
492
510
  })}
493
- shorcut={t('SHOW_IN_OTHER_MAPS', 'Show in other maps')}
511
+ text={t('SHOW_IN_OTHER_MAPS', 'Show in other maps')}
494
512
  />
495
513
  </View>
496
514
  {showAcceptOrReject && (
@@ -555,23 +555,18 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
555
555
  search={search}
556
556
  onSearch={setSearch}
557
557
  />
558
- <OrdersOptionStatus
559
- {...props}
560
- search={search}
561
- onSearch={setSearch}
562
- />
563
558
  <OrdersOptionCity
564
559
  {...props}
565
560
  search={search}
566
561
  onSearch={setSearch}
567
562
  />
568
- <OrdersOptionBusiness
569
- {...props}
570
- search={search}
571
- onSearch={setSearch}
572
- />
573
563
  {isBusinessApp && (
574
564
  <>
565
+ <OrdersOptionBusiness
566
+ {...props}
567
+ search={search}
568
+ onSearch={setSearch}
569
+ />
575
570
  <OrdersOptionDelivery
576
571
  {...props}
577
572
  search={search}
@@ -0,0 +1 @@
1
+ declare module 'react-native-map-link'