ordering-ui-react-native 0.22.21 → 0.22.22-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 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +40 -39
- package/src/components/StripeMethodForm/index.tsx +4 -2
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/context/OfflineActions/index.tsx +236 -0
- package/src/types/index.tsx +2 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -6
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
- package/themes/business/src/components/BusinessController/index.tsx +8 -3
- package/themes/business/src/components/BusinessProductList/index.tsx +3 -2
- package/themes/business/src/components/Chat/index.tsx +15 -3
- package/themes/business/src/components/DriverMap/index.tsx +49 -26
- package/themes/business/src/components/FloatingButton/index.tsx +3 -2
- package/themes/business/src/components/GoogleMap/index.tsx +15 -8
- package/themes/business/src/components/LanguageSelector/index.tsx +2 -3
- package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/MapView/index.tsx +36 -17
- package/themes/business/src/components/NewOrderNotification/index.tsx +38 -19
- package/themes/business/src/components/OrderDetails/Business.tsx +47 -27
- package/themes/business/src/components/OrderDetails/Delivery.tsx +134 -53
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +128 -41
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +45 -18
- package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +17 -16
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +3 -2
- package/themes/business/src/components/OrderSummary/index.tsx +6 -4
- package/themes/business/src/components/OrdersListManager/index.tsx +13 -1
- package/themes/business/src/components/OrdersOption/index.tsx +217 -156
- package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
- package/themes/business/src/components/PreviousMessages/index.tsx +26 -3
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +39 -16
- package/themes/business/src/components/PreviousOrders/index.tsx +74 -66
- package/themes/business/src/components/PrinterEdition/MessageAlert.tsx +33 -0
- package/themes/business/src/components/PrinterEdition/index.tsx +431 -0
- package/themes/business/src/components/PrinterEdition/printerList.tsx +23 -0
- package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +162 -174
- package/themes/business/src/components/PrinterSettings/styles.tsx +14 -1
- package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +55 -22
- package/themes/business/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
- package/themes/business/src/components/shared/OTextarea.tsx +8 -9
- package/themes/business/src/config/currency.tsx +1010 -0
- package/themes/business/src/hooks/useLocation.tsx +16 -12
- package/themes/business/src/layouts/SafeAreaContainer.tsx +35 -19
- package/themes/business/src/types/index.tsx +16 -4
- package/themes/business/src/utils/index.tsx +33 -3
- 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/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 +11 -0
- package/themes/original/src/components/AddressForm/index.tsx +32 -17
- package/themes/original/src/components/AddressList/index.tsx +8 -7
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +5 -8
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +13 -5
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +103 -92
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +8 -6
- package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
- package/themes/original/src/components/BusinessPreorder/index.tsx +46 -28
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +73 -70
- package/themes/original/src/components/BusinessProductsList/index.tsx +6 -7
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +10 -6
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
- 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 +46 -14
- package/themes/original/src/components/CartContent/index.tsx +2 -4
- package/themes/original/src/components/Checkout/index.tsx +127 -77
- package/themes/original/src/components/CitiesControl/index.tsx +0 -3
- package/themes/original/src/components/CouponControl/index.tsx +1 -3
- package/themes/original/src/components/DriverTips/index.tsx +1 -3
- package/themes/original/src/components/Favorite/index.tsx +1 -5
- package/themes/original/src/components/FavoriteList/index.tsx +0 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +11 -12
- package/themes/original/src/components/GoogleMap/index.tsx +39 -18
- package/themes/original/src/components/Help/index.tsx +2 -0
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +3 -11
- package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
- package/themes/original/src/components/LoginForm/index.tsx +12 -9
- package/themes/original/src/components/MessageListing/index.tsx +2 -1
- package/themes/original/src/components/Messages/index.tsx +27 -19
- package/themes/original/src/components/MomentOption/TimeListItem.tsx +56 -0
- package/themes/original/src/components/MomentOption/index.tsx +80 -51
- package/themes/original/src/components/MomentSelector/index.tsx +5 -2
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
- package/themes/original/src/components/MultiCheckout/index.tsx +55 -27
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -0
- package/themes/original/src/components/MyOrders/index.tsx +2 -2
- package/themes/original/src/components/NavBar/index.tsx +7 -4
- package/themes/original/src/components/NetworkError/index.tsx +0 -5
- package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +4 -3
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +16 -11
- package/themes/original/src/components/OrderDetails/index.tsx +44 -21
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderProgress/index.tsx +4 -3
- package/themes/original/src/components/OrderSummary/index.tsx +29 -10
- package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
- package/themes/original/src/components/OrdersOption/index.tsx +3 -6
- package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +4 -3
- package/themes/original/src/components/PhoneInputNumber/index.tsx +92 -7
- package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
- package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
- package/themes/original/src/components/ProductForm/ActionButton.tsx +17 -20
- package/themes/original/src/components/ProductForm/index.tsx +107 -102
- package/themes/original/src/components/ProductItemAccordion/index.tsx +50 -43
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +0 -3
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
- package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
- package/themes/original/src/components/Promotions/index.tsx +6 -9
- package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/index.tsx +52 -54
- package/themes/original/src/components/Sessions/index.tsx +3 -3
- package/themes/original/src/components/SignupForm/index.tsx +102 -88
- package/themes/original/src/components/SingleOrderCard/index.tsx +6 -4
- package/themes/original/src/components/SingleProductCard/index.tsx +5 -5
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +16 -3
- package/themes/original/src/components/StripeElementsForm/index.tsx +76 -62
- package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
- package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
- package/themes/original/src/components/TaxInformation/index.tsx +3 -2
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
- package/themes/original/src/components/UserDetails/index.tsx +17 -16
- package/themes/original/src/components/UserFormDetails/index.tsx +164 -135
- package/themes/original/src/components/UserProfile/index.tsx +9 -1
- package/themes/original/src/components/UserVerification/index.tsx +15 -4
- package/themes/original/src/components/Wallets/index.tsx +6 -3
- package/themes/original/src/components/WebsocketStatus/index.tsx +1 -4
- package/themes/original/src/components/shared/OAlert.tsx +2 -1
- package/themes/original/src/components/shared/OButton.tsx +5 -4
- package/themes/original/src/components/shared/OInput.tsx +4 -8
- package/themes/original/src/components/shared/OModal.tsx +7 -2
- package/themes/original/src/types/index.tsx +10 -3
- package/themes/original/src/utils/index.tsx +30 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -47,6 +47,7 @@ export const OrderItem = React.memo((props: any) => {
|
|
|
47
47
|
timer: configState?.configs?.order_deadlines_enabled?.value === '1',
|
|
48
48
|
slaBar: configState?.configs?.order_deadlines_enabled?.value === '1',
|
|
49
49
|
})
|
|
50
|
+
const showExternalId = configState?.configs?.change_order_id?.value === '1'
|
|
50
51
|
|
|
51
52
|
const IS_PORTRAIT = orientationState.orientation === PORTRAIT
|
|
52
53
|
const platformIOS = Platform as PlatformIOSStatic
|
|
@@ -57,9 +58,14 @@ export const OrderItem = React.memo((props: any) => {
|
|
|
57
58
|
const styles = StyleSheet.create({
|
|
58
59
|
cardButton: {
|
|
59
60
|
flex: 1,
|
|
60
|
-
paddingVertical: (isIpad || isTablet) ? 20 :
|
|
61
|
-
marginBottom: IS_PORTRAIT ?
|
|
61
|
+
paddingVertical: (isIpad || isTablet) ? 20 : 15,
|
|
62
|
+
marginBottom: IS_PORTRAIT ? 15 : 0,
|
|
62
63
|
marginLeft: 3,
|
|
64
|
+
backgroundColor: order?.time_status === 'delayed'
|
|
65
|
+
? theme.colors.danger100
|
|
66
|
+
: order?.time_status === 'at_risk'
|
|
67
|
+
? theme.colors.warning100
|
|
68
|
+
: '#fff'
|
|
63
69
|
},
|
|
64
70
|
icon: {
|
|
65
71
|
borderRadius: 7.6,
|
|
@@ -76,7 +82,6 @@ export const OrderItem = React.memo((props: any) => {
|
|
|
76
82
|
marginLeft: 3,
|
|
77
83
|
},
|
|
78
84
|
title: {
|
|
79
|
-
marginBottom: 6,
|
|
80
85
|
fontFamily: 'Poppins',
|
|
81
86
|
fontStyle: 'normal',
|
|
82
87
|
fontWeight: '600',
|
|
@@ -84,7 +89,6 @@ export const OrderItem = React.memo((props: any) => {
|
|
|
84
89
|
color: theme.colors.textGray,
|
|
85
90
|
},
|
|
86
91
|
date: {
|
|
87
|
-
marginBottom: 6,
|
|
88
92
|
fontFamily: 'Poppins',
|
|
89
93
|
fontStyle: 'normal',
|
|
90
94
|
fontWeight: 'normal',
|
|
@@ -120,7 +124,7 @@ export const OrderItem = React.memo((props: any) => {
|
|
|
120
124
|
let restHours: string | number = Math.floor(restMinOfTargetedMin / 60)
|
|
121
125
|
let restMins: string | number = restMinOfTargetedMin - 60 * restHours
|
|
122
126
|
// make standard time format
|
|
123
|
-
day = day === 0 ? '' : day + 'day
|
|
127
|
+
day = day === 0 ? '' : `${day + ' ' + t('DAY', 'day') + ' '}`
|
|
124
128
|
restHours = restHours < 10 ? '0' + restHours : restHours
|
|
125
129
|
restMins = restMins < 10 ? '0' + restMins : restMins
|
|
126
130
|
|
|
@@ -154,7 +158,8 @@ export const OrderItem = React.memo((props: any) => {
|
|
|
154
158
|
style={styles.icon}
|
|
155
159
|
source={order.business?.logo?.includes('https') ? {
|
|
156
160
|
uri: order.business?.logo,
|
|
157
|
-
priority: FastImage.priority.
|
|
161
|
+
priority: FastImage.priority.high,
|
|
162
|
+
cache: FastImage.cacheControl.immutable
|
|
158
163
|
} : order.business?.logo ?? theme?.images?.dummies?.businessLogo}
|
|
159
164
|
resizeMode={FastImage.resizeMode.cover}
|
|
160
165
|
/>
|
|
@@ -179,24 +184,36 @@ export const OrderItem = React.memo((props: any) => {
|
|
|
179
184
|
/>
|
|
180
185
|
</NotificationIcon>
|
|
181
186
|
)}
|
|
182
|
-
<View
|
|
183
|
-
|
|
187
|
+
<View>
|
|
188
|
+
{!order?.order_group_id && showExternalId && !order?.order_group && (
|
|
189
|
+
<OText
|
|
190
|
+
style={styles.date}
|
|
191
|
+
color={theme.colors.unselectText}
|
|
192
|
+
numberOfLines={1}
|
|
193
|
+
adjustsFontSizeToFit
|
|
194
|
+
>
|
|
195
|
+
{`${order?.external_id ?? t('NO_EXTERNAL_ID', 'No external Id ') + t('NO', 'Order No.') + order?.id}` + ' · ' + `${order?.delivery_datetime_utc
|
|
196
|
+
? parseDate(order?.delivery_datetime_utc)
|
|
197
|
+
: parseDate(order?.delivery_datetime, { utc: false })
|
|
198
|
+
}`}
|
|
199
|
+
</OText>
|
|
200
|
+
)}
|
|
201
|
+
{!showExternalId && (<OText
|
|
184
202
|
style={styles.date}
|
|
185
203
|
color={theme.colors.unselectText}
|
|
186
204
|
numberOfLines={1}
|
|
187
205
|
adjustsFontSizeToFit
|
|
188
206
|
>
|
|
189
|
-
{(!!order?.order_group_id && order?.order_group && isLogisticOrder
|
|
207
|
+
{((!!order?.order_group_id && order?.order_group && isLogisticOrder
|
|
190
208
|
? `${order?.order_group?.orders?.length} ${t('ORDERS', 'Orders')}`
|
|
191
|
-
: (t('NO', 'Order No.') + order
|
|
192
|
-
) + ' · '
|
|
193
|
-
{order?.delivery_datetime_utc
|
|
209
|
+
: (t('NO', 'Order No.') + order?.id)
|
|
210
|
+
) + ' · ' + `${order?.delivery_datetime_utc
|
|
194
211
|
? parseDate(order?.delivery_datetime_utc)
|
|
195
|
-
: parseDate(order?.delivery_datetime, { utc: false })}
|
|
212
|
+
: parseDate(order?.delivery_datetime, { utc: false })}`)}
|
|
196
213
|
</OText>
|
|
197
|
-
|
|
214
|
+
)}
|
|
215
|
+
{((currentTabSelected === 'pending' || currentTabSelected === 'inProgress' || currentTabSelected === 'active') && allowColumns?.timer) && (
|
|
198
216
|
<>
|
|
199
|
-
<OText> · </OText>
|
|
200
217
|
<OText
|
|
201
218
|
style={styles.date}
|
|
202
219
|
color={
|
|
@@ -229,7 +246,13 @@ export const OrderItem = React.memo((props: any) => {
|
|
|
229
246
|
? t('EAT_IN', 'Eat in')
|
|
230
247
|
: order.delivery_type === 4
|
|
231
248
|
? t('CURBSIDE', 'Curbside')
|
|
232
|
-
:
|
|
249
|
+
: order.delivery_type === 5
|
|
250
|
+
? t('DRIVER_THRU', 'Driver thru')
|
|
251
|
+
: order.delivery_type === 7
|
|
252
|
+
? t('CATERING_DELIVERY', 'Catering delivery')
|
|
253
|
+
: order.delivery_type === 8
|
|
254
|
+
? t('CATERING_PICKUP', 'Catering pickup')
|
|
255
|
+
: t('DELIVERY', 'Delivery')}
|
|
233
256
|
{` · ${getOrderStatus(order.status)}`}
|
|
234
257
|
</OText>
|
|
235
258
|
</MyOrderOptions>
|
|
@@ -11,6 +11,7 @@ import { OrdersList } from './OrderList';
|
|
|
11
11
|
import { AcceptOrRejectOrder } from '../AcceptOrRejectOrder';
|
|
12
12
|
import { ReviewCustomer } from '../ReviewCustomer';
|
|
13
13
|
import { GoogleMap } from '../GoogleMap';
|
|
14
|
+
import { useOfflineActions } from '../../../../../src/context/OfflineActions';
|
|
14
15
|
|
|
15
16
|
export const PreviousOrders = (props: any) => {
|
|
16
17
|
const {
|
|
@@ -32,7 +33,7 @@ export const PreviousOrders = (props: any) => {
|
|
|
32
33
|
const [, t] = useLanguage();
|
|
33
34
|
const theme = useTheme();
|
|
34
35
|
const [{ configs }] = useConfig();
|
|
35
|
-
|
|
36
|
+
const [{ isNetConnected, canSaveChangesOffline }] = useOfflineActions()
|
|
36
37
|
|
|
37
38
|
// const [, setCurrentTime] = useState()
|
|
38
39
|
const [openModal, setOpenModal] = useState(false)
|
|
@@ -41,12 +42,14 @@ export const PreviousOrders = (props: any) => {
|
|
|
41
42
|
const [orderUpdateStatus, setOrderUpdateStatus] = useState<any>({ action: '', ids: [], body: {}, order: {} })
|
|
42
43
|
|
|
43
44
|
const pastOrderStatuses = [1, 2, 5, 6, 10, 11, 12, 16, 17]
|
|
44
|
-
const viewMapStatus = [9, 18, 19, 23]
|
|
45
|
+
const viewMapStatus = [9, 18, 19, 23, 26]
|
|
46
|
+
const deliveryTypes = [1, 7]
|
|
45
47
|
const deliveryPickupBtn = props.appTitle?.text?.includes('Delivery') && [3, 8, 18]
|
|
46
|
-
const deliveryStatusCompleteBtn = props.appTitle?.text?.includes('Delivery') && [9, 19, 23]
|
|
48
|
+
const deliveryStatusCompleteBtn = props.appTitle?.text?.includes('Delivery') && [9, 19, 23, 26]
|
|
47
49
|
const isHideRejectButtons = configs?.reject_orders_enabled && configs?.reject_orders_enabled?.value !== '1' && !isBusinessApp
|
|
48
50
|
const isEnabledOrderNotReady = configs?.order_not_ready_enabled?.value === '1'
|
|
49
51
|
const isEnabledFailedPickupDriver = configs?.failed_pickup_by_driver_enabled?.value === '1'
|
|
52
|
+
const disabledActionsByInternet = !isNetConnected && canSaveChangesOffline === false
|
|
50
53
|
|
|
51
54
|
const handlePressOrder = (order: any) => {
|
|
52
55
|
if (order?.locked && isLogisticOrder) return
|
|
@@ -172,7 +175,7 @@ export const PreviousOrders = (props: any) => {
|
|
|
172
175
|
}
|
|
173
176
|
)
|
|
174
177
|
}
|
|
175
|
-
{_ordersGrouped[k][0]?.status === 0 && (
|
|
178
|
+
{_ordersGrouped[k][0]?.status === 0 && !disabledActionsByInternet && (
|
|
176
179
|
<AcceptOrRejectOrderStyle>
|
|
177
180
|
{!isHideRejectButtons && (
|
|
178
181
|
<OButton
|
|
@@ -208,7 +211,7 @@ export const PreviousOrders = (props: any) => {
|
|
|
208
211
|
/>
|
|
209
212
|
</AcceptOrRejectOrderStyle>
|
|
210
213
|
)}
|
|
211
|
-
{_ordersGrouped[k][0]?.status === 7 && (
|
|
214
|
+
{_ordersGrouped[k][0]?.status === 7 && !disabledActionsByInternet && (
|
|
212
215
|
<View>
|
|
213
216
|
<OButton
|
|
214
217
|
text={t('READY_FOR_PICKUP', 'Ready for pickup')}
|
|
@@ -226,7 +229,7 @@ export const PreviousOrders = (props: any) => {
|
|
|
226
229
|
</View>
|
|
227
230
|
)}
|
|
228
231
|
{(_ordersGrouped[k][0]?.status === 8 || _ordersGrouped[k][0]?.status === 18) &&
|
|
229
|
-
_ordersGrouped[k][0]?.delivery_type
|
|
232
|
+
deliveryTypes?.includes(_ordersGrouped[k][0]?.delivery_type) && !disabledActionsByInternet &&
|
|
230
233
|
(
|
|
231
234
|
<AcceptOrRejectOrderStyle>
|
|
232
235
|
<OButton
|
|
@@ -244,7 +247,8 @@ export const PreviousOrders = (props: any) => {
|
|
|
244
247
|
/>
|
|
245
248
|
</AcceptOrRejectOrderStyle>
|
|
246
249
|
)}
|
|
247
|
-
{_ordersGrouped[k][0]?.status === 3 && _ordersGrouped[k][0]?.delivery_type
|
|
250
|
+
{_ordersGrouped[k][0]?.status === 3 && deliveryTypes?.includes(_ordersGrouped[k][0]?.delivery_type) && !isHideRejectButtons && isEnabledOrderNotReady &&
|
|
251
|
+
!disabledActionsByInternet &&
|
|
248
252
|
(
|
|
249
253
|
<AcceptOrRejectOrderStyle>
|
|
250
254
|
<OButton
|
|
@@ -282,6 +286,7 @@ export const PreviousOrders = (props: any) => {
|
|
|
282
286
|
)}
|
|
283
287
|
{_ordersGrouped[k][0]?.status === 4 &&
|
|
284
288
|
![1].includes(_ordersGrouped[k][0]?.delivery_type) &&
|
|
289
|
+
!disabledActionsByInternet &&
|
|
285
290
|
(
|
|
286
291
|
<AcceptOrRejectOrderStyle>
|
|
287
292
|
{!isHideRejectButtons && (
|
|
@@ -316,6 +321,7 @@ export const PreviousOrders = (props: any) => {
|
|
|
316
321
|
)}
|
|
317
322
|
{!_ordersGrouped[k][0]?.user_review &&
|
|
318
323
|
pastOrderStatuses.includes(_ordersGrouped[k][0]?.status) &&
|
|
324
|
+
!disabledActionsByInternet &&
|
|
319
325
|
(
|
|
320
326
|
<OButton
|
|
321
327
|
text={t('REVIEW_CUSTOMER', 'Review customer')}
|
|
@@ -332,74 +338,76 @@ export const PreviousOrders = (props: any) => {
|
|
|
332
338
|
})}
|
|
333
339
|
/>
|
|
334
340
|
)}
|
|
335
|
-
{!!deliveryPickupBtn && deliveryPickupBtn?.includes(_ordersGrouped[k][0]?.status) && isEnabledFailedPickupDriver &&
|
|
336
|
-
|
|
337
|
-
|
|
341
|
+
{!!deliveryPickupBtn && deliveryPickupBtn?.includes(_ordersGrouped[k][0]?.status) && isEnabledFailedPickupDriver &&
|
|
342
|
+
!disabledActionsByInternet && (
|
|
343
|
+
<AcceptOrRejectOrderStyle>
|
|
344
|
+
{!isHideRejectButtons && isEnabledOrderNotReady && (
|
|
345
|
+
<OButton
|
|
346
|
+
text={t('PICKUP_FAILED', 'Pickup failed')}
|
|
347
|
+
bgColor={theme.colors.danger100}
|
|
348
|
+
borderColor={theme.colors.danger100}
|
|
349
|
+
imgRightSrc={null}
|
|
350
|
+
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
351
|
+
parentStyle={{ width: '45%' }}
|
|
352
|
+
textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
|
|
353
|
+
onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
|
|
354
|
+
action: 'pickupFailed',
|
|
355
|
+
order: _ordersGrouped[k][0],
|
|
356
|
+
ids: _ordersGrouped[k].map((o: any) => o.id),
|
|
357
|
+
handleChangeOrderStatus
|
|
358
|
+
})}
|
|
359
|
+
/>
|
|
360
|
+
)}
|
|
338
361
|
<OButton
|
|
339
|
-
text={t('
|
|
340
|
-
bgColor={theme.colors.
|
|
341
|
-
borderColor={theme.colors.
|
|
362
|
+
text={t('PICKUP_COMPLETE', 'Pickup complete')}
|
|
363
|
+
bgColor={theme.colors.success100}
|
|
364
|
+
borderColor={theme.colors.success100}
|
|
342
365
|
imgRightSrc={null}
|
|
343
366
|
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
344
|
-
parentStyle={{ width: '45%' }}
|
|
345
|
-
textStyle={{ color: theme.colors.
|
|
346
|
-
onClick={() =>
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
handleChangeOrderStatus
|
|
351
|
-
})}
|
|
367
|
+
parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
|
|
368
|
+
textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
|
|
369
|
+
onClick={() => handleChangeOrderStatus(
|
|
370
|
+
9,
|
|
371
|
+
_ordersGrouped[k].map((o: any) => o.id),
|
|
372
|
+
)}
|
|
352
373
|
/>
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
374
|
+
</AcceptOrRejectOrderStyle>
|
|
375
|
+
)}
|
|
376
|
+
{!!deliveryStatusCompleteBtn && deliveryStatusCompleteBtn.includes(_ordersGrouped[k][0]?.status) &&
|
|
377
|
+
!disabledActionsByInternet && (
|
|
378
|
+
<AcceptOrRejectOrderStyle>
|
|
379
|
+
{!isHideRejectButtons && (
|
|
380
|
+
<OButton
|
|
381
|
+
text={t('DELIVERY_FAILED', 'Delivery Failed')}
|
|
382
|
+
bgColor={theme.colors.danger100}
|
|
383
|
+
borderColor={theme.colors.danger100}
|
|
384
|
+
imgRightSrc={null}
|
|
385
|
+
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
386
|
+
parentStyle={{ width: '45%' }}
|
|
387
|
+
textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
|
|
388
|
+
onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
|
|
389
|
+
action: 'deliveryFailed',
|
|
390
|
+
order: _ordersGrouped[k][0],
|
|
391
|
+
ids: _ordersGrouped[k].map((o: any) => o.id),
|
|
392
|
+
handleChangeOrderStatus
|
|
393
|
+
})}
|
|
394
|
+
/>
|
|
365
395
|
)}
|
|
366
|
-
/>
|
|
367
|
-
</AcceptOrRejectOrderStyle>
|
|
368
|
-
)}
|
|
369
|
-
{!!deliveryStatusCompleteBtn && deliveryStatusCompleteBtn.includes(_ordersGrouped[k][0]?.status) && (
|
|
370
|
-
<AcceptOrRejectOrderStyle>
|
|
371
|
-
{!isHideRejectButtons && (
|
|
372
396
|
<OButton
|
|
373
|
-
text={t('
|
|
374
|
-
bgColor={theme.colors.
|
|
375
|
-
borderColor={theme.colors.
|
|
397
|
+
text={t('DELIVERY_COMPLETE', 'Delivery complete')}
|
|
398
|
+
bgColor={theme.colors.success100}
|
|
399
|
+
borderColor={theme.colors.success100}
|
|
376
400
|
imgRightSrc={null}
|
|
377
401
|
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
378
|
-
parentStyle={{ width: '45%' }}
|
|
379
|
-
textStyle={{ color: theme.colors.
|
|
380
|
-
onClick={() =>
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
handleChangeOrderStatus
|
|
385
|
-
})}
|
|
402
|
+
parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
|
|
403
|
+
textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
|
|
404
|
+
onClick={() => handleChangeOrderStatus(
|
|
405
|
+
11,
|
|
406
|
+
_ordersGrouped[k].map((o: any) => o.id),
|
|
407
|
+
)}
|
|
386
408
|
/>
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
text={t('DELIVERY_COMPLETE', 'Delivery complete')}
|
|
390
|
-
bgColor={theme.colors.success100}
|
|
391
|
-
borderColor={theme.colors.success100}
|
|
392
|
-
imgRightSrc={null}
|
|
393
|
-
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
394
|
-
parentStyle={{ width: isHideRejectButtons ? '100%' : '45%' }}
|
|
395
|
-
textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
|
|
396
|
-
onClick={() => handleChangeOrderStatus(
|
|
397
|
-
11,
|
|
398
|
-
_ordersGrouped[k].map((o: any) => o.id),
|
|
399
|
-
)}
|
|
400
|
-
/>
|
|
401
|
-
</AcceptOrRejectOrderStyle>
|
|
402
|
-
)}
|
|
409
|
+
</AcceptOrRejectOrderStyle>
|
|
410
|
+
)}
|
|
403
411
|
</OrdersGroupedItem>
|
|
404
412
|
))}
|
|
405
413
|
</View>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useTheme } from 'styled-components/native'
|
|
3
|
+
import { OText } from '../shared'
|
|
4
|
+
|
|
5
|
+
export const MessageAlert = ({ message, resetMsg }: any) => {
|
|
6
|
+
const theme = useTheme()
|
|
7
|
+
|
|
8
|
+
const [text, setText] = useState(message)
|
|
9
|
+
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
setText(message)
|
|
12
|
+
}, [message])
|
|
13
|
+
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (text) {
|
|
16
|
+
setTimeout(() => {
|
|
17
|
+
setText(null)
|
|
18
|
+
resetMsg()
|
|
19
|
+
}, 2000);
|
|
20
|
+
}
|
|
21
|
+
}, [text])
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
text ? (
|
|
25
|
+
<OText
|
|
26
|
+
size={14}
|
|
27
|
+
color={theme.colors.danger500}
|
|
28
|
+
>
|
|
29
|
+
{text}
|
|
30
|
+
</OText>
|
|
31
|
+
) : null
|
|
32
|
+
)
|
|
33
|
+
}
|