ordering-ui-react-native 0.16.93 → 0.16.94-release
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 +5 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/BusinessInformation/index.tsx +19 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +1 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +1 -21
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptionsWebView/index.tsx +119 -120
- package/src/components/SingleProductReview/index.tsx +7 -4
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/utils/index.tsx +2 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +2 -3
- package/themes/business/src/components/Chat/index.tsx +146 -135
- package/themes/business/src/components/DriverMap/index.tsx +22 -9
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
- package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/business/src/components/LoginForm/index.tsx +239 -80
- package/themes/business/src/components/LoginForm/styles.tsx +10 -0
- package/themes/business/src/components/MapView/index.tsx +18 -7
- package/themes/business/src/components/NewOrderNotification/index.tsx +33 -43
- package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -50
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +18 -17
- package/themes/business/src/components/OrdersOption/index.tsx +33 -75
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +1 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +16 -18
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +447 -247
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
- package/themes/business/src/components/ReviewCustomer/index.tsx +42 -25
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/shared/OLink.tsx +33 -13
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/components/shared/OText.tsx +8 -2
- package/themes/business/src/types/index.tsx +33 -2
- package/themes/business/src/utils/index.tsx +53 -0
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
- package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
- package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +1 -0
- package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
- package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
- package/themes/kiosk/src/layouts/Container.tsx +7 -1
- package/themes/kiosk/src/types/index.d.ts +13 -0
- package/themes/kiosk/src/utils/index.tsx +15 -0
- package/themes/original/index.tsx +8 -0
- package/themes/original/src/components/AddressDetails/index.tsx +10 -8
- package/themes/original/src/components/AddressForm/index.tsx +152 -116
- package/themes/original/src/components/AddressList/index.tsx +26 -21
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AnalyticsSegment/index.tsx +164 -8
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +125 -82
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -4
- package/themes/original/src/components/BusinessController/index.tsx +145 -68
- package/themes/original/src/components/BusinessController/styles.tsx +22 -9
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +4 -2
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
- package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +23 -5
- package/themes/original/src/components/BusinessListingSearch/index.tsx +52 -24
- package/themes/original/src/components/BusinessPreorder/index.tsx +96 -15
- package/themes/original/src/components/BusinessProductsList/index.tsx +20 -11
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +617 -490
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +7 -13
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -3
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +97 -77
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
- package/themes/original/src/components/BusinessesListing/index.tsx +6 -6
- package/themes/original/src/components/Cart/index.tsx +93 -43
- package/themes/original/src/components/CartContent/index.tsx +77 -15
- package/themes/original/src/components/CartContent/styles.tsx +11 -1
- package/themes/original/src/components/Checkout/index.tsx +294 -175
- package/themes/original/src/components/Checkout/styles.tsx +4 -2
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- package/themes/original/src/components/CouponControl/index.tsx +10 -3
- package/themes/original/src/components/DriverTips/index.tsx +52 -37
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/Favorite/index.tsx +7 -4
- package/themes/original/src/components/Favorite/styles.tsx +1 -1
- package/themes/original/src/components/FavoriteList/index.tsx +70 -80
- package/themes/original/src/components/FloatingButton/index.tsx +1 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GoogleMap/index.tsx +10 -1
- package/themes/original/src/components/Help/index.tsx +8 -8
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
- package/themes/original/src/components/HelpGuide/index.tsx +12 -16
- package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
- package/themes/original/src/components/HelpOrder/index.tsx +12 -25
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- package/themes/original/src/components/Home/index.tsx +13 -4
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LastOrder/index.tsx +1 -34
- package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +43 -19
- package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
- package/themes/original/src/components/MessageListing/index.tsx +16 -42
- package/themes/original/src/components/Messages/index.tsx +32 -10
- package/themes/original/src/components/MomentOption/index.tsx +195 -88
- package/themes/original/src/components/MultiCart/index.tsx +50 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
- package/themes/original/src/components/MultiCheckout/index.tsx +210 -79
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +66 -17
- package/themes/original/src/components/NavBar/index.tsx +6 -11
- package/themes/original/src/components/NotFoundSource/index.tsx +1 -1
- package/themes/original/src/components/Notifications/index.tsx +144 -0
- package/themes/original/src/components/Notifications/styles.tsx +20 -0
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +59 -0
- package/themes/original/src/components/OrderDetails/index.tsx +110 -221
- package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +47 -43
- package/themes/original/src/components/OrderProgress/index.tsx +74 -112
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +52 -17
- package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -3
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +28 -19
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +76 -83
- package/themes/original/src/components/PageBanner/index.tsx +171 -0
- package/themes/original/src/components/PageBanner/styles.tsx +11 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +2 -2
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +247 -269
- package/themes/original/src/components/ProductForm/styles.tsx +4 -7
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
- package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
- package/themes/original/src/components/Promotions/index.tsx +234 -220
- package/themes/original/src/components/Promotions/styles.tsx +10 -3
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
- package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
- package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
- package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
- package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
- package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
- package/themes/original/src/components/ServiceForm/index.tsx +377 -270
- package/themes/original/src/components/Sessions/index.tsx +11 -8
- package/themes/original/src/components/Sessions/styles.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +79 -66
- package/themes/original/src/components/SingleOrderCard/index.tsx +126 -57
- package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
- package/themes/original/src/components/SingleProductCard/index.tsx +111 -49
- package/themes/original/src/components/SingleProductCard/styles.tsx +27 -13
- package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
- package/themes/original/src/components/UpsellingProducts/index.tsx +238 -218
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +8 -4
- package/themes/original/src/components/UserFormDetails/index.tsx +53 -54
- package/themes/original/src/components/UserProfile/index.tsx +58 -35
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/Wallets/index.tsx +20 -19
- package/themes/original/src/components/Wallets/styles.tsx +2 -0
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +6 -2
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +10 -1
- package/themes/original/src/components/shared/OModal.tsx +3 -3
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/types/index.tsx +45 -7
- package/themes/original/src/utils/index.tsx +359 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -44,33 +44,6 @@ import { USER_TYPE } from '../../config/constants';
|
|
|
44
44
|
|
|
45
45
|
import SignatureScreen from 'react-native-signature-canvas';
|
|
46
46
|
|
|
47
|
-
const ORDER_STATUS: any = {
|
|
48
|
-
0: 'ORDER_STATUS_PENDING',
|
|
49
|
-
1: 'ORDERS_COMPLETED',
|
|
50
|
-
2: 'ORDER_REJECTED',
|
|
51
|
-
3: 'ORDER_STATUS_IN_BUSINESS',
|
|
52
|
-
4: 'ORDER_READY',
|
|
53
|
-
5: 'ORDER_REJECTED_RESTAURANT',
|
|
54
|
-
6: 'ORDER_STATUS_CANCELLEDBYDRIVER',
|
|
55
|
-
7: 'ORDER_STATUS_ACCEPTEDBYRESTAURANT',
|
|
56
|
-
8: 'ORDER_CONFIRMED_ACCEPTED_BY_DRIVER',
|
|
57
|
-
9: 'ORDER_PICKUP_COMPLETED_BY_DRIVER',
|
|
58
|
-
10: 'ORDER_PICKUP_FAILED_BY_DRIVER',
|
|
59
|
-
11: 'ORDER_DELIVERY_COMPLETED_BY_DRIVER',
|
|
60
|
-
12: 'ORDER_DELIVERY_FAILED_BY_DRIVER',
|
|
61
|
-
13: 'PREORDER',
|
|
62
|
-
14: 'ORDER_NOT_READY',
|
|
63
|
-
15: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
64
|
-
16: 'ORDER_STATUS_CANCELLED_BY_CUSTOMER',
|
|
65
|
-
17: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
|
|
66
|
-
18: 'ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS',
|
|
67
|
-
19: 'ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER',
|
|
68
|
-
20: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
69
|
-
21: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
70
|
-
22: 'ORDER_LOOKING_FOR_DRIVER',
|
|
71
|
-
23: 'ORDER_DRIVER_ON_WAY'
|
|
72
|
-
}
|
|
73
|
-
|
|
74
47
|
const filterSpecialStatus = ['prepared_in', 'delivered_in', 'delivery_datetime']
|
|
75
48
|
|
|
76
49
|
const ChatUI = (props: MessagesParams) => {
|
|
@@ -96,6 +69,35 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
96
69
|
const [, { showToast }] = useToast();
|
|
97
70
|
const theme = useTheme();
|
|
98
71
|
const [messageList, setMessageList] = useState<any>([])
|
|
72
|
+
const previousStatus = [1, 2, 5, 6, 10, 11, 12, 16, 17]
|
|
73
|
+
const chatDisabled = previousStatus.includes(order?.status)
|
|
74
|
+
|
|
75
|
+
const ORDER_STATUS: any = {
|
|
76
|
+
0: t('ORDER_STATUS_PENDING', 'Order status pending'),
|
|
77
|
+
1: t('ORDERS_COMPLETED', 'Order completed'),
|
|
78
|
+
2: t('ORDER_REJECTED', 'Order rejected'),
|
|
79
|
+
3: t('ORDER_STATUS_IN_BUSINESS', 'Order status in business'),
|
|
80
|
+
4: t('ORDER_READY', 'Order ready'),
|
|
81
|
+
5: t('ORDER_REJECTED_RESTAURANT', 'Order rejected by restaurant'),
|
|
82
|
+
6: t('ORDER_STATUS_CANCELLEDBYDRIVER', 'Order status cancelled by driver'),
|
|
83
|
+
7: t('ORDER_STATUS_ACCEPTEDBYRESTAURANT', 'Order status accepted by restaurant'),
|
|
84
|
+
8: t('ORDER_CONFIRMED_ACCEPTED_BY_DRIVER', 'Order confirmed accepted by driver'),
|
|
85
|
+
9: t('ORDER_PICKUP_COMPLETED_BY_DRIVER', 'Order pickup completed by driver'),
|
|
86
|
+
10: t('ORDER_PICKUP_FAILED_BY_DRIVER', 'Order pickup failed by driver'),
|
|
87
|
+
11: t('ORDER_DELIVERY_COMPLETED_BY_DRIVER', 'Order delivery completed by driver'),
|
|
88
|
+
12: t('ORDER_DELIVERY_FAILED_BY_DRIVER', 'Order delivery failed by driver'),
|
|
89
|
+
13: t('PREORDER', 'Preorder'),
|
|
90
|
+
14: t('ORDER_NOT_READY', 'Order not ready'),
|
|
91
|
+
15: t('ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', 'Order picked up completed by customer'),
|
|
92
|
+
16: t('ORDER_STATUS_CANCELLED_BY_CUSTOMER', 'Order status cancelled by customer'),
|
|
93
|
+
17: t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Order not picked up by customer'),
|
|
94
|
+
18: t('ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS', 'Order driver almost arrived to business'),
|
|
95
|
+
19: t('ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER', 'Order driver almost arrived to customer'),
|
|
96
|
+
20: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Order customer almost arrived to business'),
|
|
97
|
+
21: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Order customer arrived to business'),
|
|
98
|
+
22: t('ORDER_LOOKING_FOR_DRIVER', 'Order looking for driver'),
|
|
99
|
+
23: t('ORDER_DRIVER_ON_WAY', 'Driver on way')
|
|
100
|
+
}
|
|
99
101
|
|
|
100
102
|
const storeMessageList: any = [
|
|
101
103
|
{ key: 'store_message_1', text: t('STORE_MESSAGE_1', 'store_message_1') },
|
|
@@ -176,12 +178,8 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
176
178
|
fontSize: 12,
|
|
177
179
|
},
|
|
178
180
|
toolbarStyle: {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
paddingHorizontal: 30,
|
|
182
|
-
backgroundColor: theme.colors.white,
|
|
183
|
-
borderTopWidth: 1,
|
|
184
|
-
borderTopColor: theme.colors.tabBar,
|
|
181
|
+
padding: Platform.OS === 'ios' && isKeyboardShow ? 0 : 10,
|
|
182
|
+
flexDirection: 'column-reverse'
|
|
185
183
|
},
|
|
186
184
|
accessoryIcon: {
|
|
187
185
|
height: 32,
|
|
@@ -377,7 +375,7 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
377
375
|
?
|
|
378
376
|
`${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${filterSpecialStatus.includes(message.change.attribute) ?
|
|
379
377
|
`${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}` :
|
|
380
|
-
`${message.change.old !== null &&
|
|
378
|
+
`${message.change.old !== null && ORDER_STATUS[parseInt(message.change.old, 10)]} ${t('TO', 'to')} ${ORDER_STATUS[parseInt(message.change.new, 10)]}`
|
|
381
379
|
}`
|
|
382
380
|
: message.change.new
|
|
383
381
|
?
|
|
@@ -472,7 +470,7 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
472
470
|
const firstMessage = {
|
|
473
471
|
_id: 0,
|
|
474
472
|
text: console,
|
|
475
|
-
createdAt: order?.created_at,
|
|
473
|
+
createdAt: parseDate(order?.created_at, { outputFormat: 'YYYY-MM-DD HH:mm:ss' }),
|
|
476
474
|
system: true,
|
|
477
475
|
};
|
|
478
476
|
messages?.messages.map((message: any) => {
|
|
@@ -488,7 +486,7 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
488
486
|
newMessage = {
|
|
489
487
|
_id: message.id,
|
|
490
488
|
text: message.type === 1 ? messageConsole(message) : message.comment,
|
|
491
|
-
createdAt: message.type !== 0 && message
|
|
489
|
+
createdAt: message.type !== 0 && parseDate(message?.created_at, { outputFormat: 'YYYY-MM-DD HH:mm:ss' }),
|
|
492
490
|
image: message.source,
|
|
493
491
|
system: message.type === 1,
|
|
494
492
|
user: {
|
|
@@ -586,16 +584,12 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
586
584
|
};
|
|
587
585
|
|
|
588
586
|
const renderAccessory = () => (
|
|
587
|
+
!chatDisabled &&
|
|
589
588
|
<View>
|
|
590
589
|
<Header
|
|
591
590
|
showsVerticalScrollIndicator={false}
|
|
592
591
|
showsHorizontalScrollIndicator={false}
|
|
593
592
|
horizontal
|
|
594
|
-
// contentContainerStyle={{
|
|
595
|
-
// justifyContent:
|
|
596
|
-
// orientation === 'Landscape' ? 'center' : 'space-between',
|
|
597
|
-
// width: '100%',
|
|
598
|
-
// }}
|
|
599
593
|
nestedScrollEnabled={true}
|
|
600
594
|
>
|
|
601
595
|
{user?.level !== 2 && (
|
|
@@ -766,113 +760,130 @@ const ChatUI = (props: MessagesParams) => {
|
|
|
766
760
|
containerStyle={styles.toolbarStyle}
|
|
767
761
|
primaryStyle={{ alignItems: 'center', justifyContent: 'space-between' }}
|
|
768
762
|
accessoryStyle={{ position: 'relative', marginBottom: 45 }}
|
|
769
|
-
renderAccessory={
|
|
763
|
+
renderAccessory={() => renderAccessory()}
|
|
770
764
|
/>
|
|
771
765
|
);
|
|
772
766
|
|
|
773
767
|
const renderComposer = (props: any) => (
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
borderRadius: 7.6,
|
|
781
|
-
alignItems: 'center',
|
|
782
|
-
justifyContent: 'center',
|
|
783
|
-
paddingRight: 10,
|
|
784
|
-
}}>
|
|
785
|
-
<Composer
|
|
786
|
-
{...props}
|
|
787
|
-
textInputStyle={{
|
|
788
|
-
borderRadius: 7.6,
|
|
789
|
-
borderColor: theme.colors.transparent,
|
|
790
|
-
borderWidth: 0,
|
|
791
|
-
color: '#010300',
|
|
792
|
-
}}
|
|
793
|
-
textInputProps={{
|
|
794
|
-
value: message,
|
|
795
|
-
onSubmitEditing: onSubmit,
|
|
796
|
-
returnKeyType: message ? 'send' : 'done',
|
|
797
|
-
blurOnSubmit: true,
|
|
798
|
-
multiline: false,
|
|
799
|
-
numberOfLines: 1,
|
|
800
|
-
autoCorrect: false,
|
|
801
|
-
autoCompleteType: 'off',
|
|
802
|
-
enablesReturnKeyAutomatically: false,
|
|
803
|
-
selectionColor: theme.colors.primary,
|
|
768
|
+
chatDisabled ? (
|
|
769
|
+
<View
|
|
770
|
+
style={{
|
|
771
|
+
width: '100%',
|
|
772
|
+
flexDirection: 'column',
|
|
773
|
+
alignItems: 'center'
|
|
804
774
|
}}
|
|
805
|
-
|
|
806
|
-
placeholderTextColor={theme.colors.composerPlaceHolder}
|
|
807
|
-
/>
|
|
808
|
-
|
|
809
|
-
<TouchableOpacity
|
|
810
|
-
onPress={() => {
|
|
811
|
-
setImage && setImage(null);
|
|
812
|
-
setIsShowSignaturePad(!isShowSignaturePad);
|
|
813
|
-
}}>
|
|
775
|
+
>
|
|
814
776
|
<MaterialCommunityIcon
|
|
815
|
-
name=
|
|
816
|
-
color={
|
|
817
|
-
isShowSignaturePad ? theme.colors.primary : theme.colors.arrowColor
|
|
818
|
-
}
|
|
777
|
+
name='close-octagon-outline'
|
|
819
778
|
size={24}
|
|
820
779
|
/>
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
780
|
+
<OText size={14}>{t('NOT_SEND_MESSAGES', 'You can\'t send messages because the order has ended')}</OText>
|
|
781
|
+
</View>
|
|
782
|
+
) : (
|
|
783
|
+
<View
|
|
784
|
+
style={{
|
|
785
|
+
flexDirection: 'row',
|
|
786
|
+
height: 44,
|
|
787
|
+
width: '85%',
|
|
788
|
+
backgroundColor: theme.colors.composerView,
|
|
789
|
+
borderRadius: 7.6,
|
|
790
|
+
alignItems: 'center',
|
|
791
|
+
justifyContent: 'center',
|
|
792
|
+
paddingRight: 10,
|
|
793
|
+
}}>
|
|
794
|
+
<Composer
|
|
825
795
|
{...props}
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
/>
|
|
847
|
-
|
|
848
|
-
{image && !isShowSignaturePad && (
|
|
849
|
-
<TouchableOpacity
|
|
850
|
-
style={{
|
|
851
|
-
position: 'absolute',
|
|
852
|
-
top: -5,
|
|
853
|
-
right: -5,
|
|
854
|
-
borderColor: theme.colors.backgroundDark,
|
|
855
|
-
backgroundColor: theme.colors.white,
|
|
856
|
-
borderRadius: 25,
|
|
857
|
-
}}
|
|
858
|
-
onPress={() => removeImage()}>
|
|
859
|
-
<MaterialCommunityIcon
|
|
860
|
-
name="close-circle-outline"
|
|
861
|
-
color={theme.colors.backgroundDark}
|
|
862
|
-
size={24}
|
|
863
|
-
/>
|
|
864
|
-
</TouchableOpacity>
|
|
865
|
-
)}
|
|
866
|
-
</>
|
|
867
|
-
)}
|
|
868
|
-
</>
|
|
869
|
-
)}
|
|
796
|
+
textInputStyle={{
|
|
797
|
+
borderRadius: 7.6,
|
|
798
|
+
borderColor: theme.colors.transparent,
|
|
799
|
+
borderWidth: 0,
|
|
800
|
+
color: '#010300',
|
|
801
|
+
}}
|
|
802
|
+
textInputProps={{
|
|
803
|
+
value: message,
|
|
804
|
+
onSubmitEditing: onSubmit,
|
|
805
|
+
returnKeyType: message ? 'send' : 'done',
|
|
806
|
+
blurOnSubmit: true,
|
|
807
|
+
multiline: false,
|
|
808
|
+
numberOfLines: 1,
|
|
809
|
+
autoCorrect: false,
|
|
810
|
+
autoCompleteType: 'off',
|
|
811
|
+
enablesReturnKeyAutomatically: false,
|
|
812
|
+
selectionColor: theme.colors.primary,
|
|
813
|
+
}}
|
|
814
|
+
placeholder={t('WRITE_MESSAGE', 'Write message')}
|
|
815
|
+
placeholderTextColor={theme.colors.composerPlaceHolder}
|
|
870
816
|
/>
|
|
871
|
-
|
|
872
|
-
|
|
817
|
+
|
|
818
|
+
<TouchableOpacity
|
|
819
|
+
onPress={() => {
|
|
820
|
+
setImage && setImage(null);
|
|
821
|
+
setIsShowSignaturePad(!isShowSignaturePad);
|
|
822
|
+
}}>
|
|
823
|
+
<MaterialCommunityIcon
|
|
824
|
+
name="pen"
|
|
825
|
+
color={
|
|
826
|
+
isShowSignaturePad ? theme.colors.primary : theme.colors.arrowColor
|
|
827
|
+
}
|
|
828
|
+
size={24}
|
|
829
|
+
/>
|
|
830
|
+
</TouchableOpacity>
|
|
831
|
+
|
|
832
|
+
{!file.type && (
|
|
833
|
+
<Actions
|
|
834
|
+
{...props}
|
|
835
|
+
containerStyle={styles.containerActions}
|
|
836
|
+
optionTintColor="#222845"
|
|
837
|
+
icon={() => (
|
|
838
|
+
<>
|
|
839
|
+
{!file?.type && (
|
|
840
|
+
<>
|
|
841
|
+
<OIconButton
|
|
842
|
+
borderColor={theme.colors.transparent}
|
|
843
|
+
icon={
|
|
844
|
+
!isShowSignaturePad && image
|
|
845
|
+
? { uri: image }
|
|
846
|
+
: theme.images.general.imageChat
|
|
847
|
+
}
|
|
848
|
+
iconStyle={{
|
|
849
|
+
borderRadius: image ? 10 : 0,
|
|
850
|
+
width: image ? 32 : 28,
|
|
851
|
+
height: image ? 32 : 28,
|
|
852
|
+
}}
|
|
853
|
+
onClick={handleImagePicker}
|
|
854
|
+
iconCover
|
|
855
|
+
/>
|
|
856
|
+
|
|
857
|
+
{image && !isShowSignaturePad && (
|
|
858
|
+
<TouchableOpacity
|
|
859
|
+
style={{
|
|
860
|
+
position: 'absolute',
|
|
861
|
+
top: -5,
|
|
862
|
+
right: -5,
|
|
863
|
+
borderColor: theme.colors.backgroundDark,
|
|
864
|
+
backgroundColor: theme.colors.white,
|
|
865
|
+
borderRadius: 25,
|
|
866
|
+
}}
|
|
867
|
+
onPress={() => removeImage()}>
|
|
868
|
+
<MaterialCommunityIcon
|
|
869
|
+
name="close-circle-outline"
|
|
870
|
+
color={theme.colors.backgroundDark}
|
|
871
|
+
size={24}
|
|
872
|
+
/>
|
|
873
|
+
</TouchableOpacity>
|
|
874
|
+
)}
|
|
875
|
+
</>
|
|
876
|
+
)}
|
|
877
|
+
</>
|
|
878
|
+
)}
|
|
879
|
+
/>
|
|
880
|
+
)}
|
|
881
|
+
</View>
|
|
882
|
+
)
|
|
873
883
|
);
|
|
874
884
|
|
|
875
885
|
const renderSend = (props: any) => (
|
|
886
|
+
!chatDisabled &&
|
|
876
887
|
<Send
|
|
877
888
|
{...props}
|
|
878
889
|
disabled={
|
|
@@ -12,7 +12,8 @@ import Icon from 'react-native-vector-icons/FontAwesome5';
|
|
|
12
12
|
import { useTheme } from 'styled-components/native';
|
|
13
13
|
import { useLocation } from '../../hooks/useLocation';
|
|
14
14
|
import { FloatingButton } from '../FloatingButton';
|
|
15
|
-
import {
|
|
15
|
+
import { Popup } from 'react-native-map-link';
|
|
16
|
+
import { transformDistance } from '../../utils';
|
|
16
17
|
|
|
17
18
|
export const DriverMap = (props: GoogleMapsParams) => {
|
|
18
19
|
const {
|
|
@@ -47,6 +48,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
47
48
|
const [distancesFromTwoPlacesKm, setDistancesFromTwoPlacesKm] = useState(0);
|
|
48
49
|
const [isMin, setIsMin] = useState(false);
|
|
49
50
|
const [{ parseDate }] = useUtils();
|
|
51
|
+
const [popUp, setPopUp] = useState<boolean>(false);
|
|
50
52
|
const mapErrors: any = {
|
|
51
53
|
ERROR_NOT_FOUND_ADDRESS: "Sorry, we couldn't find an address",
|
|
52
54
|
ERROR_MAX_LIMIT_LOCATION_TO: 'Sorry, You can only set the position to',
|
|
@@ -56,6 +58,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
56
58
|
content: Array<string>;
|
|
57
59
|
key?: string | null;
|
|
58
60
|
}>({ open: false, content: [], key: null });
|
|
61
|
+
const distanceUnit = configState?.configs?.distance_unit?.value
|
|
59
62
|
|
|
60
63
|
const {
|
|
61
64
|
hasLocation,
|
|
@@ -475,9 +478,10 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
475
478
|
src={theme.images.general.arrow_distance}
|
|
476
479
|
style={styles.arrowDistance}
|
|
477
480
|
/>
|
|
478
|
-
<OText size={12} numberOfLines={3}>
|
|
479
|
-
distancesFromTwoPlacesKm
|
|
480
|
-
|
|
481
|
+
<OText size={12} numberOfLines={3}>
|
|
482
|
+
{`${transformDistance(distancesFromTwoPlacesKm, distanceUnit)} ${t(distanceUnit.toUpperCase(), distanceUnit)}`}
|
|
483
|
+
</OText>
|
|
484
|
+
|
|
481
485
|
</View>
|
|
482
486
|
<View style={{ width: '75%', paddingRight: 20 }}>
|
|
483
487
|
<OText
|
|
@@ -485,8 +489,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
485
489
|
size={13}
|
|
486
490
|
numberOfLines={2}
|
|
487
491
|
adjustsFontSizeToFit>
|
|
488
|
-
{`${travelTime.toFixed(2)} - ${isMin ? t('MINNUTES', 'mins') : t('HOURS', 'hours')
|
|
489
|
-
} ${distancesFromTwoPlacesKm.toFixed(2)} km`}
|
|
492
|
+
{`${travelTime.toFixed(2)} - ${isMin ? t('MINNUTES', 'mins') : t('HOURS', 'hours')}`}
|
|
490
493
|
</OText>
|
|
491
494
|
</View>
|
|
492
495
|
</View>
|
|
@@ -499,7 +502,18 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
499
502
|
imgRightSrc=''
|
|
500
503
|
textStyle={{ color: theme.colors.white }}
|
|
501
504
|
style={styles.showButton}
|
|
502
|
-
onClick={() =>
|
|
505
|
+
onClick={() => setPopUp(true)}
|
|
506
|
+
text={t('SHOW_IN_OTHER_MAPS', 'Show in other maps')}
|
|
507
|
+
/>
|
|
508
|
+
<Popup
|
|
509
|
+
isVisible={popUp}
|
|
510
|
+
onCancelPressed={() => setPopUp(false)}
|
|
511
|
+
onAppPressed={() => setPopUp(false)}
|
|
512
|
+
onBackButtonPressed={() => setPopUp(false)}
|
|
513
|
+
modalProps={{
|
|
514
|
+
animationIn: 'slideInUp'
|
|
515
|
+
}}
|
|
516
|
+
options={{
|
|
503
517
|
latitude: destination.latitude,
|
|
504
518
|
longitude: destination.longitude,
|
|
505
519
|
sourceLatitude: userLocation.latitude,
|
|
@@ -508,8 +522,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
508
522
|
dialogTitle: t('SHOW_IN_OTHER_MAPS', 'Show in other maps'),
|
|
509
523
|
dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
|
|
510
524
|
cancelText: t('CANCEL', 'Cancel'),
|
|
511
|
-
}
|
|
512
|
-
text={t('SHOW_IN_OTHER_MAPS', 'Show in other maps')}
|
|
525
|
+
}}
|
|
513
526
|
/>
|
|
514
527
|
</View>
|
|
515
528
|
{showAcceptOrReject && (
|
|
@@ -80,9 +80,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
80
80
|
locations.map((location: { lat: number; lng: number; level: number }) => {
|
|
81
81
|
return location.level === 4 && driverLocation?.lat
|
|
82
82
|
? {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
latitude: driverLocation?.lat,
|
|
84
|
+
longitude: driverLocation?.lng,
|
|
85
|
+
}
|
|
86
86
|
: { latitude: location.lat, longitude: location.lng };
|
|
87
87
|
});
|
|
88
88
|
|
|
@@ -107,7 +107,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
107
107
|
}
|
|
108
108
|
let data = null;
|
|
109
109
|
const details = {
|
|
110
|
-
geometry: { location: { lat: pos
|
|
110
|
+
geometry: { location: { lat: pos?.latitude, lng: pos?.longitude } },
|
|
111
111
|
};
|
|
112
112
|
if (isSetInputs) {
|
|
113
113
|
data = {
|
|
@@ -165,8 +165,8 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
165
165
|
const lat1 = pointA.lat;
|
|
166
166
|
const lon1 = pointA.lng;
|
|
167
167
|
|
|
168
|
-
const lat2 = pointB
|
|
169
|
-
const lon2 = pointB
|
|
168
|
+
const lat2 = pointB?.latitude;
|
|
169
|
+
const lon2 = pointB?.longitude;
|
|
170
170
|
|
|
171
171
|
const R = 6371e3;
|
|
172
172
|
const φ1 = lat1 * (Math.PI / 180);
|
|
@@ -201,11 +201,11 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
201
201
|
content: !(errKey === 'ERROR_MAX_LIMIT_LOCATION_TO')
|
|
202
202
|
? [t(errKey, mapErrors[errKey])]
|
|
203
203
|
: [
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
204
|
+
`${t(errKey, mapErrors[errKey])} ${maxLimitLocation} ${t(
|
|
205
|
+
'METTERS',
|
|
206
|
+
'meters',
|
|
207
|
+
)}`,
|
|
208
|
+
],
|
|
209
209
|
key: errKey,
|
|
210
210
|
});
|
|
211
211
|
};
|
|
@@ -237,9 +237,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
237
237
|
MARKERS = locations.map((location: { lat: number; lng: number; level: number }) => {
|
|
238
238
|
return location.level === 4 && driverLocation?.lat
|
|
239
239
|
? {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
latitude: driverLocation?.lat,
|
|
241
|
+
longitude: driverLocation?.lng,
|
|
242
|
+
}
|
|
243
243
|
: { latitude: location.lat, longitude: location.lng };
|
|
244
244
|
})
|
|
245
245
|
fitAllMarkers();
|
|
@@ -284,7 +284,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
284
284
|
onRegionChangeComplete={
|
|
285
285
|
!readOnly
|
|
286
286
|
? coordinates => handleChangeRegion(coordinates)
|
|
287
|
-
: () => {}
|
|
287
|
+
: () => { }
|
|
288
288
|
}
|
|
289
289
|
zoomTapEnabled
|
|
290
290
|
zoomEnabled
|
|
@@ -302,12 +302,13 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
302
302
|
i: number,
|
|
303
303
|
) => (
|
|
304
304
|
<React.Fragment key={i}>
|
|
305
|
-
<Marker
|
|
306
|
-
coordinate={location}
|
|
307
|
-
onPress={() => {
|
|
305
|
+
<Marker
|
|
306
|
+
coordinate={location}
|
|
307
|
+
onPress={() => {
|
|
308
308
|
mapRef.current?.animateCamera({
|
|
309
|
-
|
|
310
|
-
|
|
309
|
+
center: { latitude: location?.latitude, longitude: location?.longitude },
|
|
310
|
+
})
|
|
311
|
+
}}
|
|
311
312
|
>
|
|
312
313
|
<Icon
|
|
313
314
|
name="map-marker"
|
|
@@ -328,46 +329,46 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
328
329
|
<Callout
|
|
329
330
|
onPress={() => {
|
|
330
331
|
showLocation({
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
332
|
+
latitude: location?.latitude,
|
|
333
|
+
longitude: location?.longitude,
|
|
334
|
+
sourceLatitude: userLocation?.latitude,
|
|
335
|
+
sourceLongitude: userLocation.longitude,
|
|
336
|
+
naverCallerName: 'com.businessapp',
|
|
337
|
+
dialogTitle: t('SHOW_IN_OTHER_MAPS', 'Show in other maps'),
|
|
338
|
+
dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
|
|
339
|
+
cancelText: t('CANCEL', 'Cancel'),
|
|
339
340
|
})
|
|
340
341
|
}}
|
|
341
342
|
>
|
|
342
|
-
<View style={{flex: 1,width: 250, paddingRight: 10, paddingLeft: 10, justifyContent:'space-between' }}>
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
343
|
+
<View style={{ flex: 1, width: 250, paddingRight: 10, paddingLeft: 10, justifyContent: 'space-between' }}>
|
|
344
|
+
<View style={{ flex: 1, marginBottom: 20 }}>
|
|
345
|
+
<OText size={16} weight={'bold'} style={{ paddingTop: 10, marginBottom: 10 }}>{locations[i]?.title}</OText>
|
|
346
|
+
{locations[i]?.address && (
|
|
347
|
+
<>
|
|
348
|
+
<OText size={16} >{locations[i]?.address.addressName}</OText>
|
|
349
|
+
<OText size={16} >{locations[i]?.address.zipcode}</OText>
|
|
350
|
+
</>
|
|
351
|
+
)}
|
|
352
|
+
</View>
|
|
353
|
+
<OButton
|
|
354
|
+
text={t('GO_TO_THIS_LOCATION', 'Go to this location')}
|
|
355
|
+
imgRightSrc={null}
|
|
356
|
+
textStyle={{
|
|
357
|
+
color: theme.colors.white,
|
|
358
|
+
fontFamily: 'Poppins',
|
|
359
|
+
fontStyle: 'normal',
|
|
360
|
+
fontWeight: 'normal',
|
|
361
|
+
fontSize: 16
|
|
362
|
+
}}
|
|
363
|
+
style={{
|
|
364
|
+
alignContent: 'center',
|
|
365
|
+
borderRadius: 10,
|
|
366
|
+
height: 35,
|
|
367
|
+
bottom: 10
|
|
368
|
+
}}
|
|
369
|
+
bgColor={theme.colors.primary}
|
|
370
|
+
borderColor={theme.colors.primary}
|
|
371
|
+
/>
|
|
371
372
|
</View>
|
|
372
373
|
</Callout>
|
|
373
374
|
</Marker>
|