ordering-ui-react-native 0.21.7 → 0.21.8-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 +6 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/PaymentOptionsWebView/index.tsx +1 -0
- package/src/components/StripeMethodForm/index.tsx +4 -4
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +3 -2
- package/src/types/index.tsx +2 -1
- package/src/utils/index.tsx +2 -2
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
- package/themes/business/src/components/BusinessController/index.tsx +19 -17
- package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
- package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
- package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
- package/themes/business/src/components/Chat/index.tsx +41 -13
- package/themes/business/src/components/DriverMap/index.tsx +4 -2
- package/themes/business/src/components/DriverSchedule/index.tsx +5 -5
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/Home/index.tsx +5 -1
- package/themes/business/src/components/MapView/index.tsx +11 -7
- package/themes/business/src/components/MessagesOption/index.tsx +22 -94
- package/themes/business/src/components/NewOrderNotification/index.tsx +161 -106
- package/themes/business/src/components/OrderDetails/Business.tsx +47 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +21 -11
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +56 -50
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +54 -23
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
- package/themes/business/src/components/OrderSummary/index.tsx +240 -76
- package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
- package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
- package/themes/business/src/components/OrdersOption/index.tsx +125 -48
- package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
- package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +27 -35
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +192 -220
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +279 -0
- package/themes/business/src/components/PrinterSettings/styles.tsx +17 -0
- package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
- package/themes/business/src/components/SearchBar/index.tsx +2 -1
- package/themes/business/src/components/Sessions/index.tsx +187 -0
- package/themes/business/src/components/Sessions/styles.tsx +20 -0
- package/themes/business/src/components/StoresList/index.tsx +5 -3
- package/themes/business/src/components/UserProfileForm/index.tsx +98 -44
- package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
- package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/business/src/components/shared/OInput.tsx +2 -0
- package/themes/business/src/hooks/useLocation.tsx +5 -4
- package/themes/business/src/types/index.tsx +21 -1
- 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/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +124 -96
- 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/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +9 -4
- package/themes/original/src/components/AddressDetails/index.tsx +20 -10
- package/themes/original/src/components/AddressForm/index.tsx +2 -2
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +4 -7
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +18 -10
- package/themes/original/src/components/BusinessController/styles.tsx +8 -7
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +56 -361
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
- package/themes/original/src/components/BusinessPreorder/index.tsx +2 -3
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +43 -20
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
- package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +30 -404
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +32 -9
- package/themes/original/src/components/CartContent/index.tsx +96 -58
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +190 -66
- package/themes/original/src/components/Checkout/styles.tsx +17 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
- package/themes/original/src/components/DatePicker/index.tsx +17 -0
- package/themes/original/src/components/DatePicker/styles.tsx +20 -0
- package/themes/original/src/components/Favorite/index.tsx +4 -9
- package/themes/original/src/components/Favorite/styles.tsx +0 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +1 -1
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
- package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
- package/themes/original/src/components/GoogleMap/index.tsx +6 -5
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +1 -1
- package/themes/original/src/components/LastOrder/index.tsx +2 -1
- package/themes/original/src/components/LastOrders/index.tsx +2 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +53 -47
- package/themes/original/src/components/LoginForm/index.tsx +6 -1
- package/themes/original/src/components/Messages/index.tsx +9 -4
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +3 -3
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCheckout/index.tsx +251 -53
- package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
- package/themes/original/src/components/MyOrders/index.tsx +24 -29
- package/themes/original/src/components/NavBar/index.tsx +3 -1
- package/themes/original/src/components/NetworkError/index.tsx +2 -3
- package/themes/original/src/components/NetworkError/styles.tsx +2 -2
- package/themes/original/src/components/Notifications/index.tsx +4 -8
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +7 -3
- package/themes/original/src/components/OrderDetails/index.tsx +716 -667
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
- package/themes/original/src/components/OrderProgress/index.tsx +28 -9
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +3 -1
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +3 -5
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +3 -0
- package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +72 -6
- package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
- package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
- package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
- package/themes/original/src/components/ProductForm/index.tsx +75 -166
- package/themes/original/src/components/ProductItemAccordion/index.tsx +13 -9
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -1
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +123 -82
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +6 -1
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +4 -4
- package/themes/original/src/components/Promotions/styles.tsx +0 -2
- package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- package/themes/original/src/components/ServiceForm/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
- package/themes/original/src/components/SingleOrderCard/index.tsx +5 -4
- package/themes/original/src/components/SingleProductCard/index.tsx +2 -2
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +17 -36
- package/themes/original/src/components/StripeElementsForm/index.tsx +9 -4
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
- package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
- package/themes/original/src/components/UserFormDetails/index.tsx +53 -7
- package/themes/original/src/components/UserProfile/index.tsx +3 -2
- package/themes/original/src/components/UserProfileForm/index.tsx +30 -36
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +8 -9
- package/themes/original/src/components/Wallets/styles.tsx +1 -1
- package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
- package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +5 -5
- package/themes/original/src/components/shared/OInput.tsx +1 -4
- package/themes/original/src/components/shared/OModal.tsx +12 -14
- package/themes/original/src/layouts/Container.tsx +5 -3
- package/themes/original/src/types/index.tsx +6 -1
- package/themes/original/src/utils/index.tsx +124 -0
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/navigators/BottomNavigator.tsx +0 -117
- package/src/navigators/CheckoutNavigator.tsx +0 -66
- package/src/navigators/HomeNavigator.tsx +0 -202
- package/src/navigators/NavigationRef.tsx +0 -7
- package/src/navigators/RootNavigator.tsx +0 -269
- package/src/pages/Account.tsx +0 -34
- package/src/pages/AddressForm.tsx +0 -62
- package/src/pages/AddressList.tsx +0 -24
- package/src/pages/BusinessProductsList.tsx +0 -81
- package/src/pages/BusinessesListing.tsx +0 -43
- package/src/pages/CartList.tsx +0 -49
- package/src/pages/Checkout.tsx +0 -101
- package/src/pages/ForgotPassword.tsx +0 -24
- package/src/pages/Help.tsx +0 -23
- package/src/pages/HelpAccountAndPayment.tsx +0 -23
- package/src/pages/HelpGuide.tsx +0 -23
- package/src/pages/HelpOrder.tsx +0 -23
- package/src/pages/Home.tsx +0 -36
- package/src/pages/IntroductoryTutorial.tsx +0 -170
- package/src/pages/Login.tsx +0 -47
- package/src/pages/MomentOption.tsx +0 -30
- package/src/pages/MultiCheckout.tsx +0 -31
- package/src/pages/MultiOrdersDetails.tsx +0 -27
- package/src/pages/MyOrders.tsx +0 -40
- package/src/pages/NetworkError.tsx +0 -24
- package/src/pages/NotFound.tsx +0 -22
- package/src/pages/OrderDetails.tsx +0 -25
- package/src/pages/ProductDetails.tsx +0 -55
- package/src/pages/Profile.tsx +0 -36
- package/src/pages/ReviewDriver.tsx +0 -30
- package/src/pages/ReviewOrder.tsx +0 -32
- package/src/pages/ReviewProducts.tsx +0 -30
- package/src/pages/Sessions.tsx +0 -22
- package/src/pages/Signup.tsx +0 -53
- package/src/pages/SpinnerLoader.tsx +0 -10
- package/src/pages/Splash.tsx +0 -21
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { Platform, PlatformIOSStatic,
|
|
2
|
+
import { Platform, PlatformIOSStatic, Pressable, StyleSheet, View } from 'react-native';
|
|
3
3
|
import DeviceInfo from 'react-native-device-info';
|
|
4
4
|
import { useTheme } from 'styled-components/native';
|
|
5
5
|
import { useLanguage, useUtils, useConfig } from 'ordering-components/native';
|
|
@@ -21,7 +21,13 @@ import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrienta
|
|
|
21
21
|
|
|
22
22
|
const { useDeviceOrientation, PORTRAIT } = DeviceOrientationMethods
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
function OrderItemPropsAreEqual(prevProps: any, nextProps: any) {
|
|
25
|
+
return JSON.stringify(prevProps.order) === JSON.stringify(nextProps.order) &&
|
|
26
|
+
JSON.stringify(prevProps._order) === JSON.stringify(nextProps._order) &&
|
|
27
|
+
prevProps.currentTabSelected === nextProps.currentTabSelected
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const OrderItem = React.memo((props: any) => {
|
|
25
31
|
const {
|
|
26
32
|
order,
|
|
27
33
|
_order,
|
|
@@ -94,12 +100,13 @@ export const OrderItem = (props: any) => {
|
|
|
94
100
|
});
|
|
95
101
|
|
|
96
102
|
const getDelayMinutes = (order: any) => {
|
|
97
|
-
const
|
|
103
|
+
const offset = 300
|
|
104
|
+
const cdtToutc = moment(order?.delivery_datetime).add(offset, 'minutes').format('YYYY-MM-DD HH:mm:ss')
|
|
98
105
|
const _delivery = order?.delivery_datetime_utc
|
|
99
|
-
? parseDate(order?.delivery_datetime_utc, { outputFormat: 'YYYY-MM-DD
|
|
100
|
-
: parseDate(cdtToutc, { outputFormat: 'YYYY-MM-DD
|
|
106
|
+
? parseDate(order?.delivery_datetime_utc, { outputFormat: 'YYYY-MM-DD HH:mm:ss' })
|
|
107
|
+
: parseDate(cdtToutc, { outputFormat: 'YYYY-MM-DD HH:mm:ss' })
|
|
101
108
|
const _eta = order?.eta_time
|
|
102
|
-
const diffTimeAsSeconds = moment(_delivery
|
|
109
|
+
const diffTimeAsSeconds = moment(_delivery).add(_eta, 'minutes').diff(moment().utc(), 'seconds')
|
|
103
110
|
return Math.ceil(diffTimeAsSeconds / 60)
|
|
104
111
|
}
|
|
105
112
|
|
|
@@ -121,12 +128,6 @@ export const OrderItem = (props: any) => {
|
|
|
121
128
|
return finalTaget
|
|
122
129
|
}
|
|
123
130
|
|
|
124
|
-
const getStatusClassName = (minutes: number) => {
|
|
125
|
-
if (isNaN(Number(minutes))) return 'in_time'
|
|
126
|
-
const delayTime = configState?.configs?.order_deadlines_delayed_time?.value
|
|
127
|
-
return minutes > 0 ? 'in_time' : Math.abs(minutes) <= delayTime ? 'at_risk' : 'delayed'
|
|
128
|
-
}
|
|
129
|
-
|
|
130
131
|
useEffect(() => {
|
|
131
132
|
const slaSettings = configState?.configs?.order_deadlines_enabled?.value === '1'
|
|
132
133
|
setAllowColumns({
|
|
@@ -137,8 +138,7 @@ export const OrderItem = (props: any) => {
|
|
|
137
138
|
}, [configState.loading])
|
|
138
139
|
|
|
139
140
|
return (
|
|
140
|
-
<
|
|
141
|
-
activeOpacity={1}
|
|
141
|
+
<Pressable
|
|
142
142
|
disabled={order?.locked && isLogisticOrder}
|
|
143
143
|
style={styles.cardButton}
|
|
144
144
|
onPress={() => handlePressOrder({ ...order, logistic_order_id: _order?.id })}
|
|
@@ -146,24 +146,16 @@ export const OrderItem = (props: any) => {
|
|
|
146
146
|
<Card key={order.id}>
|
|
147
147
|
{!!allowColumns?.slaBar && (
|
|
148
148
|
<Timestatus
|
|
149
|
-
|
|
150
|
-
backgroundColor: getStatusClassName(getDelayMinutes(order)) === 'in_time'
|
|
151
|
-
? '#00D27A'
|
|
152
|
-
: getStatusClassName(getDelayMinutes(order)) === 'at_risk'
|
|
153
|
-
? '#FFC700'
|
|
154
|
-
: getStatusClassName(getDelayMinutes(order)) === 'delayed'
|
|
155
|
-
? '#E63757'
|
|
156
|
-
: ''
|
|
157
|
-
}}
|
|
149
|
+
timeState={order?.time_status}
|
|
158
150
|
/>
|
|
159
151
|
)}
|
|
160
152
|
<Logo style={styles.logo}>
|
|
161
153
|
<FastImage
|
|
162
154
|
style={styles.icon}
|
|
163
|
-
source={order.business?.logo ? {
|
|
164
|
-
uri:
|
|
155
|
+
source={order.business?.logo?.includes('https') ? {
|
|
156
|
+
uri: order.business?.logo,
|
|
165
157
|
priority: FastImage.priority.normal,
|
|
166
|
-
} : theme?.images?.dummies?.businessLogo}
|
|
158
|
+
} : order.business?.logo ?? theme?.images?.dummies?.businessLogo}
|
|
167
159
|
resizeMode={FastImage.resizeMode.cover}
|
|
168
160
|
/>
|
|
169
161
|
</Logo>
|
|
@@ -195,11 +187,11 @@ export const OrderItem = (props: any) => {
|
|
|
195
187
|
adjustsFontSizeToFit
|
|
196
188
|
>
|
|
197
189
|
{(!!order?.order_group_id && order?.order_group && isLogisticOrder
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
190
|
+
? `${order?.order_group?.orders?.length} ${t('ORDERS', 'Orders')}`
|
|
191
|
+
: (t('NO', 'Order No.') + order.id)
|
|
192
|
+
) + ' · '}
|
|
201
193
|
{order?.delivery_datetime_utc
|
|
202
|
-
? parseDate(order?.delivery_datetime_utc
|
|
194
|
+
? parseDate(order?.delivery_datetime_utc)
|
|
203
195
|
: parseDate(order?.delivery_datetime, { utc: false })}
|
|
204
196
|
</OText>
|
|
205
197
|
{((currentTabSelected === 'pending' || currentTabSelected === 'inProgress') && allowColumns?.timer) && (
|
|
@@ -208,11 +200,11 @@ export const OrderItem = (props: any) => {
|
|
|
208
200
|
<OText
|
|
209
201
|
style={styles.date}
|
|
210
202
|
color={
|
|
211
|
-
|
|
203
|
+
order?.time_status === 'in_time'
|
|
212
204
|
? '#00D27A'
|
|
213
|
-
:
|
|
205
|
+
: order?.time_status === 'at_risk'
|
|
214
206
|
? '#FFC700'
|
|
215
|
-
:
|
|
207
|
+
: order?.time_status === 'delayed'
|
|
216
208
|
? '#E63757'
|
|
217
209
|
: ''}
|
|
218
210
|
>
|
|
@@ -244,6 +236,6 @@ export const OrderItem = (props: any) => {
|
|
|
244
236
|
)}
|
|
245
237
|
</Information>
|
|
246
238
|
</Card>
|
|
247
|
-
</
|
|
239
|
+
</Pressable>
|
|
248
240
|
)
|
|
249
|
-
}
|
|
241
|
+
}, OrderItemPropsAreEqual)
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View } from 'react-native'
|
|
3
|
+
import { useTheme } from 'styled-components/native'
|
|
4
|
+
import { OButton } from '../shared';
|
|
5
|
+
import { useLanguage, useConfig } from 'ordering-components/native'
|
|
6
|
+
import { OrderItem } from './OrderItem';
|
|
7
|
+
import { AcceptOrRejectOrder as AcceptOrRejectOrderStyle } from './styles';
|
|
8
|
+
|
|
9
|
+
function OrderListPropsAreEqual(prevProps: any, nextProps: any) {
|
|
10
|
+
return JSON.stringify(prevProps.order) === JSON.stringify(nextProps.order) &&
|
|
11
|
+
JSON.stringify(prevProps._order) === JSON.stringify(nextProps._order) &&
|
|
12
|
+
JSON.stringify(prevProps.currentOrdenSelected) === JSON.stringify(nextProps.currentOrdenSelected) &&
|
|
13
|
+
prevProps.currentTabSelected === nextProps.currentTabSelected
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const OrdersList = React.memo((props: any) => {
|
|
17
|
+
const {
|
|
18
|
+
order,
|
|
19
|
+
_order,
|
|
20
|
+
hideBtns,
|
|
21
|
+
currentOrdenSelected,
|
|
22
|
+
isLogisticOrder,
|
|
23
|
+
handlePressOrder,
|
|
24
|
+
currentTabSelected,
|
|
25
|
+
getOrderStatus,
|
|
26
|
+
handleClickLogisticOrder
|
|
27
|
+
} = props
|
|
28
|
+
|
|
29
|
+
const theme = useTheme()
|
|
30
|
+
const [, t] = useLanguage()
|
|
31
|
+
const [{ configs }] = useConfig();
|
|
32
|
+
|
|
33
|
+
const isHideRejectButtons = configs?.reject_orders_enabled && configs?.reject_orders_enabled?.value !== '1'
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<View
|
|
37
|
+
style={{
|
|
38
|
+
backgroundColor: currentOrdenSelected === order?.id ? theme.colors.gray100 : order?.locked && isLogisticOrder ? '#ccc' : '#fff',
|
|
39
|
+
marginBottom: isLogisticOrder ? 10 : 0
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
<OrderItem
|
|
43
|
+
order={order}
|
|
44
|
+
_order={_order}
|
|
45
|
+
isLogisticOrder={isLogisticOrder}
|
|
46
|
+
handlePressOrder={handlePressOrder}
|
|
47
|
+
currentTabSelected={currentTabSelected}
|
|
48
|
+
getOrderStatus={getOrderStatus}
|
|
49
|
+
/>
|
|
50
|
+
{isLogisticOrder && !hideBtns && (
|
|
51
|
+
<AcceptOrRejectOrderStyle>
|
|
52
|
+
{!!order?.order_group_id && !!order?.order_group ? (
|
|
53
|
+
<OButton
|
|
54
|
+
text={t('VIEW_ORDER', 'View order')}
|
|
55
|
+
onClick={() => handlePressOrder({ ...order, logistic_order_id: _order?.id })}
|
|
56
|
+
bgColor={theme.colors.blueLight}
|
|
57
|
+
borderColor={theme.colors.blueLight}
|
|
58
|
+
imgRightSrc={null}
|
|
59
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
60
|
+
parentStyle={{ width: '100%' }}
|
|
61
|
+
textStyle={{ color: theme?.colors?.white }}
|
|
62
|
+
/>
|
|
63
|
+
) : (
|
|
64
|
+
<>
|
|
65
|
+
{!isHideRejectButtons && (
|
|
66
|
+
<OButton
|
|
67
|
+
text={t('REJECT', 'Reject')}
|
|
68
|
+
onClick={() => handleClickLogisticOrder(2, _order?.id)}
|
|
69
|
+
bgColor={theme.colors.red}
|
|
70
|
+
borderColor={theme.colors.red}
|
|
71
|
+
imgRightSrc={null}
|
|
72
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
73
|
+
parentStyle={{ width: '45%' }}
|
|
74
|
+
textStyle={{ color: theme.colors.white }}
|
|
75
|
+
/>
|
|
76
|
+
)}
|
|
77
|
+
<OButton
|
|
78
|
+
text={t('ACCEPT', 'Accept')}
|
|
79
|
+
onClick={() => handleClickLogisticOrder(1, _order?.id)}
|
|
80
|
+
bgColor={theme.colors.green}
|
|
81
|
+
borderColor={theme.colors.green}
|
|
82
|
+
imgRightSrc={null}
|
|
83
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
84
|
+
parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
|
|
85
|
+
textStyle={{ color: theme.colors.white }}
|
|
86
|
+
/>
|
|
87
|
+
</>
|
|
88
|
+
)}
|
|
89
|
+
</AcceptOrRejectOrderStyle>
|
|
90
|
+
)}
|
|
91
|
+
</View>
|
|
92
|
+
)
|
|
93
|
+
}, OrderListPropsAreEqual)
|
|
@@ -88,7 +88,7 @@ export const OrdersGroupedItem = (props: any) => {
|
|
|
88
88
|
adjustsFontSizeToFit
|
|
89
89
|
>
|
|
90
90
|
{orders[0]?.delivery_datetime_utc
|
|
91
|
-
? parseDate(orders[0]?.delivery_datetime_utc
|
|
91
|
+
? parseDate(orders[0]?.delivery_datetime_utc)
|
|
92
92
|
: parseDate(orders[0]?.delivery_datetime, { utc: false })}
|
|
93
93
|
</OText>
|
|
94
94
|
</View>
|