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.
- package/package.json +2 -1
- package/themes/business/index.tsx +12 -12
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +49 -43
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +4 -10
- package/themes/business/src/components/Chat/index.tsx +97 -60
- package/themes/business/src/components/DriverMap/index.tsx +196 -183
- package/themes/business/src/components/FloatingButton/index.tsx +61 -43
- package/themes/business/src/components/FloatingButton/styles.tsx +2 -5
- package/themes/business/src/components/GoogleMap/index.tsx +10 -8
- package/themes/business/src/components/Home/index.tsx +2 -5
- package/themes/business/src/components/Home/styles.tsx +1 -2
- package/themes/business/src/components/LanguageSelector/index.tsx +1 -3
- package/themes/business/src/components/MessagesOption/index.tsx +13 -18
- package/themes/business/src/components/MessagesOption/styles.tsx +3 -0
- package/themes/business/src/components/OrderDetails/Business.tsx +642 -0
- package/themes/business/src/components/OrderDetails/Delivery.tsx +436 -0
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +378 -0
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +148 -0
- package/themes/business/src/components/OrderDetails/styles.tsx +16 -74
- package/themes/business/src/components/OrderMessage/index.tsx +5 -2
- package/themes/business/src/components/OrdersOption/index.tsx +344 -302
- package/themes/business/src/components/OrdersOption/styles.tsx +4 -2
- package/themes/business/src/components/PreviousMessages/index.tsx +15 -8
- package/themes/business/src/components/PreviousOrders/index.tsx +86 -141
- package/themes/business/src/components/PreviousOrders/styles.tsx +4 -3
- package/themes/business/src/components/UserProfileForm/index.tsx +73 -6
- package/themes/business/src/components/UserProfileForm/styles.tsx +0 -2
- package/themes/business/src/components/shared/OModal.tsx +9 -7
- package/themes/business/src/components/shared/OTextarea.tsx +2 -1
- package/themes/business/src/layouts/SafeAreaContainer.tsx +2 -2
- package/themes/business/src/types/index.tsx +24 -13
- package/themes/business/src/utils/index.tsx +160 -0
- package/themes/business/src/components/OrderDetails/index.tsx +0 -1262
- package/themes/business/src/components/OrderDetailsDelivery/index.tsx +0 -1056
- 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-
|
|
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
|
-
<
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
{
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
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
|
-
<
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
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
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
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
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
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
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
:
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
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
|
-
|
|
537
|
+
color={theme.colors.unselectText}
|
|
538
|
+
size={13}
|
|
503
539
|
numberOfLines={2}
|
|
504
|
-
|
|
505
|
-
{`${
|
|
540
|
+
adjustsFontSizeToFit>
|
|
541
|
+
{`${travelTime.toFixed(2)} - ${
|
|
542
|
+
isMin ? t('MINNUTES', 'mins') : t('HOURS', 'hours')
|
|
543
|
+
} ${distancesFromTwoPlacesKm.toFixed(2)} km`}
|
|
506
544
|
</OText>
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
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
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
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
|
-
|
|
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
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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:
|
|
71
|
+
? { backgroundColor: firstColorCustom || styles.primaryBtn }
|
|
89
72
|
: color
|
|
90
|
-
? color
|
|
91
|
-
: styles.
|
|
73
|
+
? { backgroundColor: color }
|
|
74
|
+
: styles.primaryBtn,
|
|
75
|
+
,
|
|
76
|
+
{ width: widthButton },
|
|
92
77
|
]}
|
|
93
|
-
onPress={
|
|
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
|
-
|
|
103
|
-
|
|
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:
|
|
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
|
-
|
|
221
|
-
|
|
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
|
|
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
|
};
|