ordering-ui-react-native 0.17.68 → 0.17.69-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 +8 -7
- 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/OrderCreating/index.tsx +1 -21
- package/src/components/PaymentOptionsWebView/index.tsx +29 -8
- package/src/components/PhoneInputNumber/index.tsx +6 -2
- package/src/components/StripeMethodForm/index.tsx +136 -102
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +3 -2
- package/src/types/index.tsx +5 -0
- package/src/utils/index.tsx +5 -0
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +270 -245
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +0 -1
- package/themes/business/src/components/Chat/index.tsx +123 -111
- package/themes/business/src/components/DriverMap/index.tsx +17 -6
- package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +31 -3
- package/themes/business/src/components/LoginForm/index.tsx +15 -22
- package/themes/business/src/components/MapView/index.tsx +10 -10
- package/themes/business/src/components/NewOrderNotification/index.tsx +35 -21
- package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +191 -6
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +103 -39
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +61 -60
- 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 +19 -18
- package/themes/business/src/components/OrderSummary/index.tsx +114 -123
- package/themes/business/src/components/OrdersOption/index.tsx +21 -20
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +6 -7
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +2 -2
- package/themes/business/src/components/PreviousOrders/index.tsx +266 -154
- package/themes/business/src/components/PreviousOrders/styles.tsx +1 -1
- package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
- package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
- package/themes/business/src/components/StoresList/index.tsx +3 -4
- package/themes/business/src/components/UserProfileForm/index.tsx +11 -13
- package/themes/business/src/components/shared/OLink.tsx +11 -3
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/components/shared/OText.tsx +6 -1
- package/themes/business/src/types/index.tsx +24 -13
- package/themes/business/src/utils/index.tsx +29 -2
- 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/Intro/index.tsx +16 -1
- package/themes/kiosk/src/components/LoginForm/index.tsx +7 -9
- 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 +2 -2
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +2 -0
- package/themes/original/src/components/AddressDetails/index.tsx +19 -3
- package/themes/original/src/components/AddressForm/index.tsx +61 -39
- package/themes/original/src/components/AddressList/index.tsx +27 -22
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +153 -96
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
- package/themes/original/src/components/BusinessController/index.tsx +80 -66
- package/themes/original/src/components/BusinessController/styles.tsx +12 -5
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
- package/themes/original/src/components/BusinessInformation/index.tsx +139 -85
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
- package/themes/original/src/components/BusinessListingSearch/index.tsx +349 -339
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
- package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
- package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +684 -556
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
- package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +69 -38
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +0 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +77 -79
- package/themes/original/src/components/CartContent/index.tsx +117 -20
- package/themes/original/src/components/CartContent/styles.tsx +17 -7
- package/themes/original/src/components/Checkout/index.tsx +356 -124
- package/themes/original/src/components/CitiesControl/index.tsx +1 -1
- package/themes/original/src/components/CouponControl/index.tsx +10 -3
- package/themes/original/src/components/DriverTips/index.tsx +52 -34
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- package/themes/original/src/components/Favorite/index.tsx +8 -9
- package/themes/original/src/components/Favorite/styles.tsx +1 -1
- package/themes/original/src/components/FavoriteList/index.tsx +1 -35
- package/themes/original/src/components/FloatingButton/index.tsx +11 -14
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +6 -4
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
- package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +60 -5
- package/themes/original/src/components/Help/index.tsx +8 -8
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
- package/themes/original/src/components/HelpGuide/index.tsx +6 -6
- package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
- package/themes/original/src/components/HelpOrder/index.tsx +6 -15
- 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/LastOrder/index.tsx +1 -34
- package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
- package/themes/original/src/components/LoginForm/index.tsx +64 -34
- package/themes/original/src/components/LottieAnimation/index.tsx +89 -55
- package/themes/original/src/components/MessageListing/index.tsx +16 -42
- package/themes/original/src/components/Messages/index.tsx +14 -7
- package/themes/original/src/components/MomentOption/index.tsx +195 -90
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCart/index.tsx +41 -54
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +162 -50
- package/themes/original/src/components/MultiCheckout/index.tsx +329 -100
- package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +54 -21
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +40 -29
- package/themes/original/src/components/NavBar/index.tsx +20 -17
- package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
- package/themes/original/src/components/Notifications/index.tsx +46 -50
- package/themes/original/src/components/Notifications/styles.tsx +6 -3
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
- package/themes/original/src/components/OrderDetails/index.tsx +191 -363
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +30 -56
- package/themes/original/src/components/OrderSummary/index.tsx +88 -59
- package/themes/original/src/components/OrderTypeSelector/index.tsx +2 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
- package/themes/original/src/components/OrdersOption/index.tsx +68 -87
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +98 -38
- package/themes/original/src/components/PageBanner/styles.tsx +0 -10
- package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -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 +78 -35
- package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
- package/themes/original/src/components/ProductForm/index.tsx +105 -30
- package/themes/original/src/components/ProductForm/styles.tsx +5 -5
- package/themes/original/src/components/ProductItemAccordion/index.tsx +14 -11
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +20 -18
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +5 -9
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
- package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
- package/themes/original/src/components/Promotions/index.tsx +5 -4
- package/themes/original/src/components/Promotions/styles.tsx +3 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
- package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
- package/themes/original/src/components/ServiceForm/index.tsx +66 -17
- 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 +43 -27
- package/themes/original/src/components/SingleOrderCard/index.tsx +101 -62
- package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +72 -31
- package/themes/original/src/components/SingleProductCard/styles.tsx +20 -4
- package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
- package/themes/original/src/components/StripeCardsList/index.tsx +49 -5
- package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
- package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
- package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +3 -1
- package/themes/original/src/components/UserFormDetails/index.tsx +76 -7
- package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +88 -79
- package/themes/original/src/components/UserProfileForm/index.tsx +27 -29
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/UserVerification/index.tsx +52 -49
- package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
- package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
- package/themes/original/src/components/Wallets/index.tsx +66 -30
- package/themes/original/src/components/Wallets/styles.tsx +3 -4
- package/themes/original/src/components/shared/OButton.tsx +6 -2
- package/themes/original/src/components/shared/OInput.tsx +6 -1
- package/themes/original/src/components/shared/OModal.tsx +3 -3
- package/themes/original/src/types/index.tsx +41 -11
- package/themes/original/src/utils/index.tsx +273 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -15,7 +15,6 @@ import { GoogleMap } from '../GoogleMap';
|
|
|
15
15
|
export const PreviousOrders = (props: any) => {
|
|
16
16
|
const {
|
|
17
17
|
orders,
|
|
18
|
-
ordersGrouped,
|
|
19
18
|
onNavigationRedirect,
|
|
20
19
|
getOrderStatus,
|
|
21
20
|
handleClickOrder,
|
|
@@ -40,6 +39,8 @@ export const PreviousOrders = (props: any) => {
|
|
|
40
39
|
|
|
41
40
|
const pastOrderStatuses = [1, 2, 5, 6, 10, 11, 12, 16, 17]
|
|
42
41
|
const viewMapStatus = [9, 18, 19, 23]
|
|
42
|
+
const deliveryPickupBtn = props.appTitle?.text?.includes('Delivery') && [3, 8, 18]
|
|
43
|
+
const deliveryStatusCompleteBtn = props.appTitle?.text?.includes('Delivery') && [9, 19, 23]
|
|
43
44
|
|
|
44
45
|
const handlePressOrder = (order: any) => {
|
|
45
46
|
if (order?.locked && isLogisticOrder) return
|
|
@@ -47,8 +48,13 @@ export const PreviousOrders = (props: any) => {
|
|
|
47
48
|
if (props.handleClickEvent) {
|
|
48
49
|
props.handleClickEvent({ ...order, isLogistic: isLogisticOrder })
|
|
49
50
|
} else {
|
|
50
|
-
|
|
51
|
-
onNavigationRedirect
|
|
51
|
+
if (isLogisticOrder){
|
|
52
|
+
onNavigationRedirect &&
|
|
53
|
+
onNavigationRedirect('OrderDetailsLogistic', { order: { ...order, isLogistic: isLogisticOrder }, handleClickLogisticOrder });
|
|
54
|
+
} else {
|
|
55
|
+
onNavigationRedirect &&
|
|
56
|
+
onNavigationRedirect('OrderDetails', { order });
|
|
57
|
+
}
|
|
52
58
|
}
|
|
53
59
|
};
|
|
54
60
|
|
|
@@ -80,29 +86,29 @@ export const PreviousOrders = (props: any) => {
|
|
|
80
86
|
imgRightSrc={null}
|
|
81
87
|
style={{ borderRadius: 7, height: 40 }}
|
|
82
88
|
parentStyle={{ width: '100%' }}
|
|
83
|
-
textStyle={{ color: theme
|
|
89
|
+
textStyle={{ color: theme?.colors?.white }}
|
|
84
90
|
/>
|
|
85
91
|
) : (
|
|
86
92
|
<>
|
|
87
93
|
<OButton
|
|
88
94
|
text={t('REJECT', 'Reject')}
|
|
89
95
|
onClick={() => handleClickLogisticOrder(2, _order?.id)}
|
|
90
|
-
bgColor={theme.colors.
|
|
91
|
-
borderColor={theme.colors.
|
|
96
|
+
bgColor={theme.colors.red}
|
|
97
|
+
borderColor={theme.colors.red}
|
|
92
98
|
imgRightSrc={null}
|
|
93
99
|
style={{ borderRadius: 7, height: 40 }}
|
|
94
100
|
parentStyle={{ width: '45%' }}
|
|
95
|
-
textStyle={{ color: theme.colors.
|
|
101
|
+
textStyle={{ color: theme.colors.white }}
|
|
96
102
|
/>
|
|
97
103
|
<OButton
|
|
98
104
|
text={t('ACCEPT', 'Accept')}
|
|
99
105
|
onClick={() => handleClickLogisticOrder(1, _order?.id)}
|
|
100
|
-
bgColor={theme.colors.
|
|
101
|
-
borderColor={theme.colors.
|
|
106
|
+
bgColor={theme.colors.green}
|
|
107
|
+
borderColor={theme.colors.green}
|
|
102
108
|
imgRightSrc={null}
|
|
103
109
|
style={{ borderRadius: 7, height: 40 }}
|
|
104
110
|
parentStyle={{ width: '45%' }}
|
|
105
|
-
textStyle={{ color: theme.colors.
|
|
111
|
+
textStyle={{ color: theme.colors.white }}
|
|
106
112
|
/>
|
|
107
113
|
</>
|
|
108
114
|
)}
|
|
@@ -186,153 +192,259 @@ export const PreviousOrders = (props: any) => {
|
|
|
186
192
|
|
|
187
193
|
return (
|
|
188
194
|
<>
|
|
189
|
-
{
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
195
|
+
{orders && orders?.length > 0 && orders.map((_order: any) => {
|
|
196
|
+
const order = !Array.isArray(_order) && (_order?.isLogistic && !_order?.order_group && isLogisticOrder ? _order?.order : _order)
|
|
197
|
+
const _ordersGrouped = Array.isArray(_order) && Object.fromEntries(_order)
|
|
198
|
+
return (
|
|
199
|
+
_ordersGrouped ? (
|
|
200
|
+
<View key={_order[0]} style={{ marginBottom: 10 }}>
|
|
201
|
+
{Object.keys(_ordersGrouped).map((k, idx) => (
|
|
202
|
+
<OrdersGroupedItem
|
|
203
|
+
key={`${k}_${idx}`}
|
|
204
|
+
groupId={k}
|
|
205
|
+
orders={_ordersGrouped[k]}
|
|
206
|
+
>
|
|
207
|
+
{_ordersGrouped[k]?.length > 0 &&
|
|
208
|
+
_ordersGrouped[k]
|
|
209
|
+
?.filter((order: any) => hash[order?.id] ? false : (hash[order?.id] = true))
|
|
210
|
+
?.map((_order: any) => {
|
|
211
|
+
const order_ = _order?.isLogistic && !_order?.order_group && isLogisticOrder ? _order?.order : _order
|
|
212
|
+
return (
|
|
213
|
+
<OrdersList key={order_.id} order={order_} _order={_order} hideBtns />
|
|
214
|
+
)
|
|
215
|
+
}
|
|
204
216
|
)
|
|
205
217
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
218
|
+
{_ordersGrouped[k][0]?.status === 0 && (
|
|
219
|
+
<AcceptOrRejectOrderStyle>
|
|
220
|
+
<OButton
|
|
221
|
+
text={t('REJECT_ALL', 'Reject all')}
|
|
222
|
+
bgColor={theme.colors.danger100}
|
|
223
|
+
borderColor={theme.colors.danger100}
|
|
224
|
+
imgRightSrc={null}
|
|
225
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
226
|
+
parentStyle={{ width: '45%' }}
|
|
227
|
+
textStyle={{ color: theme.colors.danger500, fontSize: 12 }}
|
|
228
|
+
onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
|
|
229
|
+
action: 'reject',
|
|
230
|
+
order: _ordersGrouped[k][0],
|
|
231
|
+
ids: _ordersGrouped[k].map((o: any) => o.id),
|
|
232
|
+
handleChangeOrderStatus
|
|
233
|
+
})}
|
|
234
|
+
/>
|
|
235
|
+
<OButton
|
|
236
|
+
text={t('ACCEPT_ALL', 'Accept all')}
|
|
237
|
+
bgColor={theme.colors.success100}
|
|
238
|
+
borderColor={theme.colors.success100}
|
|
239
|
+
imgRightSrc={null}
|
|
240
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
241
|
+
parentStyle={{ width: '45%' }}
|
|
242
|
+
textStyle={{ color: theme.colors.success500, fontSize: 12 }}
|
|
243
|
+
onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
|
|
244
|
+
action: 'accept',
|
|
245
|
+
order: _ordersGrouped[k][0],
|
|
246
|
+
ids: _ordersGrouped[k].map((o: any) => o.id),
|
|
247
|
+
handleChangeOrderStatus
|
|
248
|
+
})}
|
|
249
|
+
/>
|
|
250
|
+
</AcceptOrRejectOrderStyle>
|
|
251
|
+
)}
|
|
252
|
+
{_ordersGrouped[k][0]?.status === 7 && (
|
|
253
|
+
<View>
|
|
254
|
+
<OButton
|
|
255
|
+
text={t('READY_FOR_PICKUP', 'Ready for pickup')}
|
|
256
|
+
bgColor={theme.colors.primaryLight}
|
|
257
|
+
borderColor={theme.colors.primaryLight}
|
|
258
|
+
imgRightSrc={null}
|
|
259
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
260
|
+
parentStyle={{ width: '100%' }}
|
|
261
|
+
textStyle={{ color: theme.colors.primary, fontSize: 12 }}
|
|
262
|
+
onClick={() => handleChangeOrderStatus(
|
|
263
|
+
4,
|
|
264
|
+
_ordersGrouped[k].map((o: any) => o.id),
|
|
265
|
+
)}
|
|
266
|
+
/>
|
|
267
|
+
</View>
|
|
268
|
+
)}
|
|
269
|
+
{(_ordersGrouped[k][0]?.status === 8 || _ordersGrouped[k][0]?.status === 18) &&
|
|
270
|
+
_ordersGrouped[k][0]?.delivery_type === 1 &&
|
|
271
|
+
(
|
|
272
|
+
<AcceptOrRejectOrderStyle>
|
|
273
|
+
<OButton
|
|
274
|
+
text={t('ARRIVED_TO_BUSINESS', 'Arrived to bussiness')}
|
|
275
|
+
bgColor={theme.colors.btnBGWhite}
|
|
276
|
+
borderColor={theme.colors.btnBGWhite}
|
|
277
|
+
imgRightSrc={null}
|
|
278
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
279
|
+
parentStyle={{ width: '100%' }}
|
|
280
|
+
textStyle={{ color: theme.colors.primary, fontSize: 12 }}
|
|
281
|
+
onClick={() => handleChangeOrderStatus(
|
|
282
|
+
3,
|
|
283
|
+
_ordersGrouped[k].map((o: any) => o.id),
|
|
284
|
+
)}
|
|
285
|
+
/>
|
|
286
|
+
</AcceptOrRejectOrderStyle>
|
|
287
|
+
)}
|
|
288
|
+
{_ordersGrouped[k][0]?.status === 3 && _ordersGrouped[k][0]?.delivery_type === 1 &&
|
|
289
|
+
(
|
|
290
|
+
<AcceptOrRejectOrderStyle>
|
|
291
|
+
<OButton
|
|
292
|
+
text={t('ORDER_NOT_READY', 'Order not ready')}
|
|
293
|
+
bgColor={theme.colors.red}
|
|
294
|
+
borderColor={theme.colors.red}
|
|
295
|
+
imgRightSrc={null}
|
|
296
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
297
|
+
parentStyle={{ width: '100%' }}
|
|
298
|
+
textStyle={{ color: theme.colors.white, fontSize: 12 }}
|
|
299
|
+
onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
|
|
300
|
+
action: 'notReady',
|
|
301
|
+
order: _ordersGrouped[k][0],
|
|
302
|
+
ids: _ordersGrouped[k].map((o: any) => o.id),
|
|
303
|
+
handleChangeOrderStatus
|
|
304
|
+
})}
|
|
305
|
+
/>
|
|
306
|
+
</AcceptOrRejectOrderStyle>
|
|
307
|
+
)}
|
|
308
|
+
{viewMapStatus.includes(_ordersGrouped[k][0]?.status) &&
|
|
309
|
+
props.appTitle?.text?.includes('Business') &&
|
|
310
|
+
(
|
|
311
|
+
<View>
|
|
312
|
+
<OButton
|
|
313
|
+
text={t('TRACK_REAL_TIME_POSITION', 'Track real time position')}
|
|
314
|
+
bgColor={theme.colors.primaryLight}
|
|
315
|
+
borderColor={theme.colors.primaryLight}
|
|
316
|
+
imgRightSrc={null}
|
|
317
|
+
style={{ borderRadius: 7, height: 40 }}
|
|
318
|
+
parentStyle={{ width: '100%' }}
|
|
319
|
+
textStyle={{ color: theme.colors.primary, fontSize: 12 }}
|
|
320
|
+
onClick={() => handleOpenMapView({ orders: _ordersGrouped[k] })}
|
|
321
|
+
/>
|
|
322
|
+
</View>
|
|
323
|
+
)}
|
|
324
|
+
{_ordersGrouped[k][0]?.status === 4 &&
|
|
325
|
+
![1].includes(_ordersGrouped[k][0]?.delivery_type) &&
|
|
326
|
+
(
|
|
327
|
+
<AcceptOrRejectOrderStyle>
|
|
328
|
+
<OButton
|
|
329
|
+
text={t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Order not picked up by customer')}
|
|
330
|
+
bgColor={theme.colors.danger100}
|
|
331
|
+
borderColor={theme.colors.danger100}
|
|
332
|
+
imgRightSrc={null}
|
|
333
|
+
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
334
|
+
parentStyle={{ width: '45%' }}
|
|
335
|
+
textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
|
|
336
|
+
onClick={() => handleChangeOrderStatus(
|
|
337
|
+
17,
|
|
338
|
+
_ordersGrouped[k].map((o: any) => o.id),
|
|
339
|
+
)}
|
|
340
|
+
/>
|
|
341
|
+
<OButton
|
|
342
|
+
text={t('PICKUP_COMPLETED_BY_CUSTOMER', 'Pickup completed by customer')}
|
|
343
|
+
bgColor={theme.colors.success100}
|
|
344
|
+
borderColor={theme.colors.success100}
|
|
345
|
+
imgRightSrc={null}
|
|
346
|
+
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
347
|
+
parentStyle={{ width: '45%' }}
|
|
348
|
+
textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
|
|
349
|
+
onClick={() => handleChangeOrderStatus(
|
|
350
|
+
15,
|
|
351
|
+
_ordersGrouped[k].map((o: any) => o.id),
|
|
352
|
+
)}
|
|
353
|
+
/>
|
|
354
|
+
</AcceptOrRejectOrderStyle>
|
|
355
|
+
)}
|
|
356
|
+
{!_ordersGrouped[k][0]?.user_review &&
|
|
357
|
+
pastOrderStatuses.includes(_ordersGrouped[k][0]?.status) &&
|
|
358
|
+
(
|
|
359
|
+
<OButton
|
|
360
|
+
text={t('REVIEW_CUSTOMER', 'Review customer')}
|
|
361
|
+
bgColor={theme.colors.primary}
|
|
362
|
+
borderColor={theme.colors.primary}
|
|
363
|
+
imgRightSrc={null}
|
|
364
|
+
style={{ borderRadius: 8, height: 40 }}
|
|
365
|
+
parentStyle={{ width: '100%' }}
|
|
366
|
+
textStyle={{ color: theme.colors.white }}
|
|
367
|
+
onClick={() => setOpenReviewModal({
|
|
368
|
+
order: _ordersGrouped[k][0],
|
|
369
|
+
customerId: _ordersGrouped[k][0]?.customer_id,
|
|
370
|
+
ids: _ordersGrouped[k].map((o: any) => o.id)
|
|
371
|
+
})}
|
|
372
|
+
/>
|
|
373
|
+
)}
|
|
374
|
+
{!!deliveryPickupBtn && deliveryPickupBtn?.includes(_ordersGrouped[k][0]?.status) && (
|
|
375
|
+
<AcceptOrRejectOrderStyle>
|
|
376
|
+
<OButton
|
|
377
|
+
text={t('PICKUP_FAILED', 'Pickup failed')}
|
|
378
|
+
bgColor={theme.colors.danger100}
|
|
379
|
+
borderColor={theme.colors.danger100}
|
|
380
|
+
imgRightSrc={null}
|
|
381
|
+
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
382
|
+
parentStyle={{ width: '45%' }}
|
|
383
|
+
textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
|
|
384
|
+
onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
|
|
385
|
+
action: 'pickupFailed',
|
|
386
|
+
order: _ordersGrouped[k][0],
|
|
387
|
+
ids: _ordersGrouped[k].map((o: any) => o.id),
|
|
388
|
+
handleChangeOrderStatus
|
|
389
|
+
})}
|
|
390
|
+
/>
|
|
391
|
+
<OButton
|
|
392
|
+
text={t('PICKUP_COMPLETE', 'Pickup complete')}
|
|
393
|
+
bgColor={theme.colors.success100}
|
|
394
|
+
borderColor={theme.colors.success100}
|
|
395
|
+
imgRightSrc={null}
|
|
396
|
+
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
397
|
+
parentStyle={{ width: '45%' }}
|
|
398
|
+
textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
|
|
399
|
+
onClick={() => handleChangeOrderStatus(
|
|
400
|
+
9,
|
|
401
|
+
_ordersGrouped[k].map((o: any) => o.id),
|
|
402
|
+
)}
|
|
403
|
+
/>
|
|
404
|
+
</AcceptOrRejectOrderStyle>
|
|
405
|
+
)}
|
|
406
|
+
{!!deliveryStatusCompleteBtn && deliveryStatusCompleteBtn.includes(_ordersGrouped[k][0]?.status) && (
|
|
407
|
+
<AcceptOrRejectOrderStyle>
|
|
408
|
+
<OButton
|
|
409
|
+
text={t('DELIVERY_FAILED', 'Delivery Failed')}
|
|
410
|
+
bgColor={theme.colors.danger100}
|
|
411
|
+
borderColor={theme.colors.danger100}
|
|
412
|
+
imgRightSrc={null}
|
|
413
|
+
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
414
|
+
parentStyle={{ width: '45%' }}
|
|
415
|
+
textStyle={{ color: theme.colors.danger500, fontSize: 12, textAlign: 'center' }}
|
|
416
|
+
onClick={() => onNavigationRedirect('AcceptOrRejectOrder', {
|
|
417
|
+
action: 'deliveryFailed',
|
|
418
|
+
order: _ordersGrouped[k][0],
|
|
419
|
+
ids: _ordersGrouped[k].map((o: any) => o.id),
|
|
420
|
+
handleChangeOrderStatus
|
|
421
|
+
})}
|
|
422
|
+
/>
|
|
423
|
+
<OButton
|
|
424
|
+
text={t('DELIVERY_COMPLETE', 'Delivery complete')}
|
|
425
|
+
bgColor={theme.colors.success100}
|
|
426
|
+
borderColor={theme.colors.success100}
|
|
427
|
+
imgRightSrc={null}
|
|
428
|
+
style={{ borderRadius: 7, height: 40, paddingLeft: 10, paddingRight: 10 }}
|
|
429
|
+
parentStyle={{ width: '45%' }}
|
|
430
|
+
textStyle={{ color: theme.colors.success500, fontSize: 12, textAlign: 'center' }}
|
|
431
|
+
onClick={() => handleChangeOrderStatus(
|
|
432
|
+
11,
|
|
433
|
+
_ordersGrouped[k].map((o: any) => o.id),
|
|
434
|
+
)}
|
|
435
|
+
/>
|
|
436
|
+
</AcceptOrRejectOrderStyle>
|
|
437
|
+
)}
|
|
438
|
+
</OrdersGroupedItem>
|
|
439
|
+
))}
|
|
440
|
+
</View>
|
|
441
|
+
) : (
|
|
442
|
+
<View key={order.id}>
|
|
443
|
+
<OrdersList order={order} _order={_order} />
|
|
444
|
+
</View>
|
|
445
|
+
)
|
|
334
446
|
)
|
|
335
|
-
}
|
|
447
|
+
})}
|
|
336
448
|
|
|
337
449
|
<OModal
|
|
338
450
|
open={openModal}
|
|
@@ -33,7 +33,7 @@ export const NotificationIcon = styled.View`
|
|
|
33
33
|
export const AcceptOrRejectOrder = styled.View`
|
|
34
34
|
flex-direction: row;
|
|
35
35
|
justify-content: space-between;
|
|
36
|
-
margin:
|
|
36
|
+
margin: ${(props: any) => props.m ?? 10}px;
|
|
37
37
|
`
|
|
38
38
|
export const Timestatus = styled.View`
|
|
39
39
|
position: relative;;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { View, Animated } from 'react-native';
|
|
1
|
+
import React, { useEffect, useState, useCallback } from 'react';
|
|
2
|
+
import { View, Animated, TouchableOpacity } from 'react-native';
|
|
3
3
|
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
4
4
|
import { useUtils, useLanguage } from 'ordering-components/native';
|
|
5
5
|
import { useTheme } from 'styled-components/native';
|
|
6
|
+
import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
|
|
7
|
+
|
|
8
|
+
const { useDeviceOrientation } = DeviceOrientationMethods
|
|
9
|
+
|
|
6
10
|
import {
|
|
7
11
|
Accordion,
|
|
8
12
|
AccordionSection,
|
|
@@ -34,8 +38,12 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
34
38
|
const [, t] = useLanguage();
|
|
35
39
|
const theme = useTheme();
|
|
36
40
|
const [{ parsePrice }] = useUtils();
|
|
41
|
+
const [orientationState] = useDeviceOrientation();
|
|
42
|
+
const WIDTH_SCREEN = orientationState?.dimensions?.width
|
|
37
43
|
|
|
38
44
|
const [isActive, setActiveState] = useState(false);
|
|
45
|
+
const [isReadMore, setIsReadMore] = useState(false);
|
|
46
|
+
const [lengthMore, setLengthMore] = useState(false);
|
|
39
47
|
|
|
40
48
|
const productInfo = () => {
|
|
41
49
|
if (isCartProduct) {
|
|
@@ -108,6 +116,10 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
108
116
|
}
|
|
109
117
|
}, []);
|
|
110
118
|
|
|
119
|
+
const onTextLayout = useCallback((e: any) => {
|
|
120
|
+
setLengthMore((e.nativeEvent.lines.length == 2 && e.nativeEvent.lines[1].width > WIDTH_SCREEN * .76) || e.nativeEvent.lines.length > 2); //to check the text is more than 2 lines or not
|
|
121
|
+
},[]);
|
|
122
|
+
|
|
111
123
|
return (
|
|
112
124
|
<AccordionSection>
|
|
113
125
|
<Accordion
|
|
@@ -288,9 +300,21 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
288
300
|
color={theme.colors.unselectText}>
|
|
289
301
|
{t('COMMENT', 'Comment')}
|
|
290
302
|
</OText>
|
|
291
|
-
<OText
|
|
303
|
+
<OText
|
|
304
|
+
size={12}
|
|
305
|
+
style={{ width: '100%', paddingLeft: 10 }}
|
|
306
|
+
color={theme.colors.unselectText}
|
|
307
|
+
onTextLayout={onTextLayout}
|
|
308
|
+
numberOfLines={isReadMore ? 15 : 2}
|
|
309
|
+
ellipsizeMode="tail"
|
|
310
|
+
>
|
|
292
311
|
{product.comment}
|
|
293
312
|
</OText>
|
|
313
|
+
{lengthMore && (
|
|
314
|
+
<TouchableOpacity onPress={() => setIsReadMore(!isReadMore)} style={{ marginLeft: 10 }}>
|
|
315
|
+
<OText size={10} color={theme.colors.statusOrderBlue}>{isReadMore ? t('SHOW_LESS', 'Show less') : t('READ_MORE', 'Read more')}</OText>
|
|
316
|
+
</TouchableOpacity>
|
|
317
|
+
)}
|
|
294
318
|
</ProductComment>
|
|
295
319
|
)}
|
|
296
320
|
</AccordionContent>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
1
3
|
import React, { useState, useEffect, useRef } from 'react'
|
|
2
4
|
import {
|
|
3
5
|
useLanguage,
|
|
@@ -86,6 +88,18 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
|
|
|
86
88
|
marginBottom: 10,
|
|
87
89
|
backgroundColor: theme.colors.lightGray
|
|
88
90
|
},
|
|
91
|
+
btnBackArrow: {
|
|
92
|
+
borderWidth: 0,
|
|
93
|
+
width: 32,
|
|
94
|
+
height: 32,
|
|
95
|
+
tintColor: theme.colors.textGray,
|
|
96
|
+
backgroundColor: theme.colors.clear,
|
|
97
|
+
borderColor: theme.colors.clear,
|
|
98
|
+
shadowColor: theme.colors.clear,
|
|
99
|
+
paddingLeft: 0,
|
|
100
|
+
paddingRight: 0,
|
|
101
|
+
marginBottom: 20
|
|
102
|
+
},
|
|
89
103
|
inputTextArea: {
|
|
90
104
|
borderColor: theme.colors.lightGray,
|
|
91
105
|
borderRadius: 8,
|
|
@@ -147,7 +161,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
|
|
|
147
161
|
useEffect(() => {
|
|
148
162
|
if (scrollref?.current) {
|
|
149
163
|
Keyboard.addListener('keyboardDidShow', () => {
|
|
150
|
-
scrollref.current.scrollToEnd()
|
|
164
|
+
scrollref?.current?.scrollToEnd && scrollref.current.scrollToEnd()
|
|
151
165
|
})
|
|
152
166
|
}
|
|
153
167
|
}, [scrollref?.current])
|
|
@@ -177,18 +191,9 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
|
|
|
177
191
|
}}
|
|
178
192
|
>
|
|
179
193
|
<View>
|
|
180
|
-
<
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
iconStyle={{ width: 20, height: 16 }}
|
|
184
|
-
style={{
|
|
185
|
-
maxWidth: 40,
|
|
186
|
-
height: 20,
|
|
187
|
-
justifyContent: 'flex-end',
|
|
188
|
-
marginBottom: 20,
|
|
189
|
-
}}
|
|
190
|
-
onClick={() => closeModal()}
|
|
191
|
-
/>
|
|
194
|
+
<TouchableOpacity onPress={() => closeModal()} style={styles.btnBackArrow}>
|
|
195
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
|
|
196
|
+
</TouchableOpacity>
|
|
192
197
|
<OText
|
|
193
198
|
size={20}
|
|
194
199
|
weight="600"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { View, StyleSheet, Dimensions, Linking } from 'react-native';
|
|
3
|
-
import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler';
|
|
2
|
+
import { View, StyleSheet, Dimensions, Linking, ScrollView, TouchableOpacity } from 'react-native';
|
|
4
3
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
5
4
|
import NetInfo from '@react-native-community/netinfo';
|
|
6
5
|
import { useTheme } from 'styled-components/native';
|
|
@@ -149,10 +148,10 @@ const StoresListUI = (props: BusinessesListingParams) => {
|
|
|
149
148
|
width={12}
|
|
150
149
|
height={12}
|
|
151
150
|
color={theme.colors.skyBlue}
|
|
152
|
-
style={{ marginRight: 5
|
|
151
|
+
style={{ marginRight: 5 }}
|
|
153
152
|
/>
|
|
154
153
|
<OText size={12}>
|
|
155
|
-
{t('MORE_SETTINGS_GO_TO', 'For more settings go to')}
|
|
154
|
+
{t('MORE_SETTINGS_GO_TO', 'For more settings go to ')}
|
|
156
155
|
</OText>
|
|
157
156
|
<TouchableOpacity onPress={() => { Linking.openURL(t('LINK_MORE_SETTINGS_GO_TO', 'https://app.ordering.co')) }}>
|
|
158
157
|
<OText size={12} color={theme.colors.skyBlue}>
|