ordering-ui-react-native 0.17.76 → 0.17.77-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 +28 -25
- package/themes/business/src/components/BusinessController/index.tsx +0 -1
- package/themes/business/src/components/Chat/index.tsx +149 -118
- 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/MessagesOption/index.tsx +20 -93
- package/themes/business/src/components/NewOrderNotification/index.tsx +128 -96
- 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 +102 -40
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +70 -67
- 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 +20 -22
- 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 +17 -12
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +88 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +139 -174
- 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 +14 -15
- package/themes/business/src/components/shared/OLink.tsx +9 -2
- 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 +25 -10
- 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 +1 -1
- 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 +11 -6
- 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 +81 -68
- 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 +140 -85
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
- package/themes/original/src/components/BusinessListingSearch/index.tsx +348 -340
- 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 -559
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +1 -1
- package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +70 -39
- 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 +76 -79
- package/themes/original/src/components/CartContent/index.tsx +112 -19
- package/themes/original/src/components/CartContent/styles.tsx +16 -6
- package/themes/original/src/components/Checkout/index.tsx +294 -56
- 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 +2 -6
- package/themes/original/src/components/FavoriteList/index.tsx +1 -35
- package/themes/original/src/components/FloatingButton/index.tsx +10 -13
- package/themes/original/src/components/GPSButton/index.tsx +6 -4
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +7 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +2 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +19 -6
- 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 +2 -2
- package/themes/original/src/components/HelpGuide/index.tsx +2 -2
- package/themes/original/src/components/HelpGuide/styles.tsx +1 -0
- 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 +88 -63
- 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 +193 -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 +37 -24
- package/themes/original/src/components/NavBar/index.tsx +20 -12
- package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
- package/themes/original/src/components/Notifications/styles.tsx +1 -5
- 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 +139 -306
- 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 +33 -57
- package/themes/original/src/components/OrderSummary/index.tsx +83 -57
- 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 +61 -81
- 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 +95 -33
- package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
- package/themes/original/src/components/ProductForm/index.tsx +103 -40
- package/themes/original/src/components/ProductForm/styles.tsx +3 -3
- package/themes/original/src/components/ProductItemAccordion/index.tsx +8 -6
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +50 -21
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -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 +2 -2
- 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 +63 -20
- 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 +102 -63
- 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 +78 -9
- package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +87 -76
- package/themes/original/src/components/UserProfileForm/index.tsx +10 -3
- package/themes/original/src/components/UserProfileForm/styles.tsx +1 -1
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- 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 +56 -33
- 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 +39 -10
- package/themes/original/src/utils/index.tsx +386 -1
- 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
|
@@ -3,9 +3,18 @@ import { useLanguage } from 'ordering-components/native';
|
|
|
3
3
|
import FontAwesome from 'react-native-vector-icons/FontAwesome';
|
|
4
4
|
import { CODES } from 'ordering-components/native'
|
|
5
5
|
import { ORDER_TYPES } from '../config/constants';
|
|
6
|
+
import { useTheme } from 'styled-components/native';
|
|
7
|
+
import ReactNativeHapticFeedback from "react-native-haptic-feedback";
|
|
6
8
|
|
|
7
|
-
export const flatArray = (arr: any) => [].concat(...arr)
|
|
8
9
|
const [languageState, t] = useLanguage();
|
|
10
|
+
const theme = useTheme()
|
|
11
|
+
|
|
12
|
+
export const flatArray = (arr: any) => [].concat(...arr)
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* List of order type
|
|
16
|
+
*/
|
|
17
|
+
export const orderTypeList = ['delivery', 'pickup', 'eatin', 'curbside', 'drivethru', 'seatdelivery']
|
|
9
18
|
|
|
10
19
|
/**
|
|
11
20
|
* Function to return the traduction depending of a key 't'
|
|
@@ -263,6 +272,11 @@ export const transformCountryCode = (countryCode: number) => {
|
|
|
263
272
|
return code?.countryCode
|
|
264
273
|
}
|
|
265
274
|
|
|
275
|
+
export const findExitingCode = (countryCode: string) => {
|
|
276
|
+
const code = CODES.find((code: any) => code.countryCode === (countryCode || '').toUpperCase())
|
|
277
|
+
return code?.countryCode
|
|
278
|
+
}
|
|
279
|
+
|
|
266
280
|
/**
|
|
267
281
|
* Function to check if a number is decimal or not
|
|
268
282
|
* @param {*} value number to check if decimal or not
|
|
@@ -351,3 +365,374 @@ export const priceList = [
|
|
|
351
365
|
{ level: '4', content: '$$$$' },
|
|
352
366
|
{ level: '5', content: '$$$$$' }
|
|
353
367
|
]
|
|
368
|
+
|
|
369
|
+
export const getLogisticTag = (status: any) => {
|
|
370
|
+
const keyList: any = {
|
|
371
|
+
0: t('PENDING', 'Pending'),
|
|
372
|
+
1: t('IN_PROGRESS', 'In progress'),
|
|
373
|
+
2: t('IN_QUEUE', 'In queue'),
|
|
374
|
+
3: t('EXPIRED', 'Expired'),
|
|
375
|
+
4: t('RESOLVED', 'Resolved'),
|
|
376
|
+
}
|
|
377
|
+
return keyList[status] ? keyList[status] : t('UNKNOWN', 'Unknown')
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export const getOrderStatus = (s: string) => {
|
|
381
|
+
const status = parseInt(s);
|
|
382
|
+
const orderStatus = [
|
|
383
|
+
{
|
|
384
|
+
key: 0,
|
|
385
|
+
value: t('PENDING', 'Pending'),
|
|
386
|
+
slug: 'PENDING',
|
|
387
|
+
percentage: 0.1,
|
|
388
|
+
image: theme.images.order.status0,
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
key: 1,
|
|
392
|
+
value: t('COMPLETED', 'Completed'),
|
|
393
|
+
slug: 'COMPLETED',
|
|
394
|
+
percentage: 1,
|
|
395
|
+
image: theme.images.order.status1,
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
key: 2,
|
|
399
|
+
value: t('REJECTED', 'Rejected'),
|
|
400
|
+
slug: 'REJECTED',
|
|
401
|
+
percentage: 0,
|
|
402
|
+
image: theme.images.order.status2,
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
key: 3,
|
|
406
|
+
value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
|
|
407
|
+
slug: 'DRIVER_IN_BUSINESS',
|
|
408
|
+
percentage: 0.6,
|
|
409
|
+
image: theme.images.order.status3,
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
key: 4,
|
|
413
|
+
value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
|
|
414
|
+
slug: 'PREPARATION_COMPLETED',
|
|
415
|
+
percentage: 0.2,
|
|
416
|
+
image: theme.images.order.status4,
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
key: 5,
|
|
420
|
+
value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
|
|
421
|
+
slug: 'REJECTED_BY_BUSINESS',
|
|
422
|
+
percentage: 0,
|
|
423
|
+
image: theme.images.order.status5,
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
key: 6,
|
|
427
|
+
value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
|
|
428
|
+
slug: 'REJECTED_BY_DRIVER',
|
|
429
|
+
percentage: 0,
|
|
430
|
+
image: theme.images.order.status6,
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
key: 7,
|
|
434
|
+
value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
|
|
435
|
+
slug: 'ACCEPTED_BY_BUSINESS',
|
|
436
|
+
percentage: 0.15,
|
|
437
|
+
image: theme.images.order.status7,
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
key: 8,
|
|
441
|
+
value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
|
|
442
|
+
slug: 'ACCEPTED_BY_DRIVER',
|
|
443
|
+
percentage: 0.4,
|
|
444
|
+
image: theme.images.order.status8,
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
key: 9,
|
|
448
|
+
value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
|
|
449
|
+
slug: 'PICK_UP_COMPLETED_BY_DRIVER',
|
|
450
|
+
percentage: 0.7,
|
|
451
|
+
image: theme.images.order.status9,
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
key: 10,
|
|
455
|
+
value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
|
|
456
|
+
slug: 'PICK_UP_FAILED_BY_DRIVER',
|
|
457
|
+
percentage: 0,
|
|
458
|
+
image: theme.images.order.status10,
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
key: 11,
|
|
462
|
+
value: t(
|
|
463
|
+
'DELIVERY_COMPLETED_BY_DRIVER',
|
|
464
|
+
'Delivery completed by driver',
|
|
465
|
+
),
|
|
466
|
+
slug: 'DELIVERY_COMPLETED_BY_DRIVER',
|
|
467
|
+
percentage: 1,
|
|
468
|
+
image: theme.images.order.status11,
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
key: 12,
|
|
472
|
+
value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
|
|
473
|
+
slug: 'DELIVERY_FAILED_BY_DRIVER',
|
|
474
|
+
percentage: 0,
|
|
475
|
+
image: theme.images.order.status12,
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
key: 13,
|
|
479
|
+
value: t('PREORDER', 'PreOrder'),
|
|
480
|
+
slug: 'PREORDER',
|
|
481
|
+
percentage: 0,
|
|
482
|
+
image: theme.images.order.status13,
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
key: 14,
|
|
486
|
+
value: t('ORDER_NOT_READY', 'Order not ready'),
|
|
487
|
+
slug: 'ORDER_NOT_READY',
|
|
488
|
+
percentage: 0.15,
|
|
489
|
+
image: theme.images.order.status13,
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
key: 15,
|
|
493
|
+
value: t(
|
|
494
|
+
'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
495
|
+
'Order picked up completed by customer',
|
|
496
|
+
),
|
|
497
|
+
slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
498
|
+
percentage: 1,
|
|
499
|
+
image: theme.images.order.status1,
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
key: 16,
|
|
503
|
+
value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
|
|
504
|
+
slug: 'CANCELLED_BY_CUSTOMER',
|
|
505
|
+
percentage: 0,
|
|
506
|
+
image: theme.images.order.status2,
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
key: 17,
|
|
510
|
+
value: t(
|
|
511
|
+
'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
|
|
512
|
+
'Order not picked up by customer',
|
|
513
|
+
),
|
|
514
|
+
slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
|
|
515
|
+
percentage: 0,
|
|
516
|
+
image: theme.images.order.status2,
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
key: 18,
|
|
520
|
+
value: t(
|
|
521
|
+
'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
|
|
522
|
+
'Driver almost arrived to business',
|
|
523
|
+
),
|
|
524
|
+
slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
|
|
525
|
+
percentage: 0.5,
|
|
526
|
+
image: theme.images.order.status3,
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
key: 19,
|
|
530
|
+
value: t(
|
|
531
|
+
'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
|
|
532
|
+
'Driver almost arrived to customer',
|
|
533
|
+
),
|
|
534
|
+
slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
|
|
535
|
+
percentage: 0.9,
|
|
536
|
+
image: theme.images.order.status11,
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
key: 20,
|
|
540
|
+
value: t(
|
|
541
|
+
'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
542
|
+
'Customer almost arrived to business',
|
|
543
|
+
),
|
|
544
|
+
slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
545
|
+
percentage: 0.9,
|
|
546
|
+
image: theme.images.order.status7,
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
key: 21,
|
|
550
|
+
value: t(
|
|
551
|
+
'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
552
|
+
'Customer arrived to business',
|
|
553
|
+
),
|
|
554
|
+
slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
555
|
+
percentage: 0.9,
|
|
556
|
+
image: theme.images.order.status7,
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
key: 22,
|
|
560
|
+
value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
|
|
561
|
+
slug: 'ORDER_LOOKING_FOR_DRIVER',
|
|
562
|
+
percentage: 0.3,
|
|
563
|
+
image: theme.images.order.status8
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
key: 23,
|
|
567
|
+
value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
|
|
568
|
+
slug: 'ORDER_DRIVER_ON_WAY',
|
|
569
|
+
percentage: 0.8,
|
|
570
|
+
image: theme.images.order.status8
|
|
571
|
+
}
|
|
572
|
+
];
|
|
573
|
+
|
|
574
|
+
const objectStatus = orderStatus.find((o) => o.key === status);
|
|
575
|
+
|
|
576
|
+
return objectStatus && objectStatus;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
export const getOrderStatuPickUp = (s: any) => {
|
|
580
|
+
const status = parseInt(s);
|
|
581
|
+
const orderStatus = [
|
|
582
|
+
{
|
|
583
|
+
key: 0,
|
|
584
|
+
value: t('PENDING', 'Pending'),
|
|
585
|
+
slug: 'PENDING',
|
|
586
|
+
percentage: 0.1,
|
|
587
|
+
image: theme.images.order.status0,
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
key: 1,
|
|
591
|
+
value: t('COMPLETED', 'Completed'),
|
|
592
|
+
slug: 'COMPLETED',
|
|
593
|
+
percentage: 1,
|
|
594
|
+
image: theme.images.order.status1,
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
key: 2,
|
|
598
|
+
value: t('REJECTED', 'Rejected'),
|
|
599
|
+
slug: 'REJECTED',
|
|
600
|
+
percentage: 0,
|
|
601
|
+
image: theme.images.order.status2,
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
key: 4,
|
|
605
|
+
value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
|
|
606
|
+
slug: 'PREPARATION_COMPLETED',
|
|
607
|
+
percentage: 0.5,
|
|
608
|
+
image: theme.images.order.status4,
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
key: 5,
|
|
612
|
+
value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
|
|
613
|
+
slug: 'REJECTED_BY_BUSINESS',
|
|
614
|
+
percentage: 0,
|
|
615
|
+
image: theme.images.order.status5,
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
key: 7,
|
|
619
|
+
value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
|
|
620
|
+
slug: 'ACCEPTED_BY_BUSINESS',
|
|
621
|
+
percentage: 0.3,
|
|
622
|
+
image: theme.images.order.status7,
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
key: 13,
|
|
626
|
+
value: t('PREORDER', 'PreOrder'),
|
|
627
|
+
slug: 'PREORDER',
|
|
628
|
+
percentage: 0,
|
|
629
|
+
image: theme.images.order.status13,
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
key: 14,
|
|
633
|
+
value: t('ORDER_NOT_READY', 'Order not ready'),
|
|
634
|
+
slug: 'ORDER_NOT_READY',
|
|
635
|
+
percentage: 0.3,
|
|
636
|
+
image: theme.images.order.status13,
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
key: 15,
|
|
640
|
+
value: t(
|
|
641
|
+
'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
642
|
+
'Order picked up completed by customer',
|
|
643
|
+
),
|
|
644
|
+
slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
645
|
+
percentage: 1,
|
|
646
|
+
image: theme.images.order.status1,
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
key: 16,
|
|
650
|
+
value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
|
|
651
|
+
slug: 'CANCELLED_BY_CUSTOMER',
|
|
652
|
+
percentage: 0,
|
|
653
|
+
image: theme.images.order.status2,
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
key: 17,
|
|
657
|
+
value: t(
|
|
658
|
+
'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
|
|
659
|
+
'Order not picked up by customer',
|
|
660
|
+
),
|
|
661
|
+
slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
|
|
662
|
+
percentage: 0,
|
|
663
|
+
image: theme.images.order.status2,
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
key: 20,
|
|
667
|
+
value: t(
|
|
668
|
+
'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
669
|
+
'Customer almost arrived to business',
|
|
670
|
+
),
|
|
671
|
+
slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
672
|
+
percentage: 0.7,
|
|
673
|
+
image: theme.images.order.status7,
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
key: 21,
|
|
677
|
+
value: t(
|
|
678
|
+
'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
679
|
+
'Customer arrived to business',
|
|
680
|
+
),
|
|
681
|
+
slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
682
|
+
percentage: 0.9,
|
|
683
|
+
image: theme.images.order.status7,
|
|
684
|
+
}
|
|
685
|
+
];
|
|
686
|
+
|
|
687
|
+
const objectStatus = orderStatus.find((o) => o.key === status);
|
|
688
|
+
|
|
689
|
+
return objectStatus && objectStatus;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Function to get brightness of color.
|
|
694
|
+
*/
|
|
695
|
+
export const lightenDarkenColor = (color: any) => {
|
|
696
|
+
|
|
697
|
+
let r, g, b, hsp
|
|
698
|
+
if (!color) return
|
|
699
|
+
if (color.match(/^rgb/)) {
|
|
700
|
+
// If HEX --> store the red, green, blue values in separate variables
|
|
701
|
+
color = color.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/)
|
|
702
|
+
|
|
703
|
+
r = color[1]
|
|
704
|
+
g = color[2]
|
|
705
|
+
b = color[3]
|
|
706
|
+
} else {
|
|
707
|
+
// If RGB --> Convert it to HEX
|
|
708
|
+
color = +("0x" + color.slice(1).replace(color.length < 5 && /./g, '$&$&'))
|
|
709
|
+
|
|
710
|
+
r = color >> 16
|
|
711
|
+
g = color >> 8 & 255
|
|
712
|
+
b = color & 255
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
// HSP (Highly Sensitive Poo) equation
|
|
716
|
+
hsp = Math.sqrt(
|
|
717
|
+
0.299 * (r * r) +
|
|
718
|
+
0.587 * (g * g) +
|
|
719
|
+
0.114 * (b * b)
|
|
720
|
+
)
|
|
721
|
+
|
|
722
|
+
// Using the HSP value, determine whether the color is light or dark
|
|
723
|
+
if (hsp > 197) {
|
|
724
|
+
return true //is light color
|
|
725
|
+
} else {
|
|
726
|
+
return false
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
export const vibrateApp = (impact ?: string) => {
|
|
731
|
+
const options = {
|
|
732
|
+
enableVibrateFallback: true,
|
|
733
|
+
ignoreAndroidSystemSettings: false
|
|
734
|
+
};
|
|
735
|
+
|
|
736
|
+
ReactNativeHapticFeedback.trigger(impact || "impactLight", options);
|
|
737
|
+
|
|
738
|
+
}
|
|
@@ -144,7 +144,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
144
144
|
{isFarAway && (
|
|
145
145
|
<FarAwayMessage style={styles.farAwayMsg}>
|
|
146
146
|
<Ionicons name='md-warning-outline' style={styles.iconStyle} />
|
|
147
|
-
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', '
|
|
147
|
+
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
|
|
148
148
|
</FarAwayMessage>
|
|
149
149
|
)}
|
|
150
150
|
<View style={styles.wrapperOrderOptions}>
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { View, Platform, PlatformIOSStatic } from 'react-native'
|
|
3
|
-
import { useOrder } from 'ordering-components/native'
|
|
4
|
-
import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs'
|
|
5
|
-
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
6
|
-
import MaterialIcon from 'react-native-vector-icons/MaterialIcons'
|
|
7
|
-
import styled from 'styled-components/native'
|
|
8
|
-
|
|
9
|
-
import { OText } from '../components/shared'
|
|
10
|
-
import BusinessList from '../pages/BusinessesListing'
|
|
11
|
-
import MyOrders from '../pages/MyOrders'
|
|
12
|
-
import CartList from '../pages/CartList'
|
|
13
|
-
import Profile from '../pages/Profile'
|
|
14
|
-
import { useTheme } from 'styled-components/native'
|
|
15
|
-
|
|
16
|
-
const CartsLenght = styled.View`
|
|
17
|
-
width: 25px;
|
|
18
|
-
height: 25px;
|
|
19
|
-
background-color: ${(props: any) => props.theme.colors.primary};
|
|
20
|
-
display: flex;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
align-items: center;
|
|
23
|
-
position: absolute;
|
|
24
|
-
right: 0;
|
|
25
|
-
`
|
|
26
|
-
|
|
27
|
-
const Tab = createMaterialBottomTabNavigator();
|
|
28
|
-
|
|
29
|
-
const BottomNavigator = () => {
|
|
30
|
-
const theme = useTheme()
|
|
31
|
-
const [{ carts }] = useOrder()
|
|
32
|
-
const cartsList = (carts && Object.values(carts).filter((cart: any) => cart.products.length > 0)) || []
|
|
33
|
-
const isIos = Platform.OS === 'ios'
|
|
34
|
-
const platformIOS = Platform as PlatformIOSStatic
|
|
35
|
-
const androidStyles = isIos
|
|
36
|
-
? platformIOS.isPad
|
|
37
|
-
? { paddingBottom: 30 }
|
|
38
|
-
: {}
|
|
39
|
-
: {height: 40, position: 'relative', bottom: 15}
|
|
40
|
-
return (
|
|
41
|
-
<Tab.Navigator
|
|
42
|
-
initialRouteName="BusinessList"
|
|
43
|
-
activeColor={theme.colors.primary}
|
|
44
|
-
barStyle={{ backgroundColor: theme.colors.white, ...androidStyles }}
|
|
45
|
-
labeled={false}
|
|
46
|
-
inactiveColor={theme.colors.disabled}
|
|
47
|
-
>
|
|
48
|
-
<Tab.Screen
|
|
49
|
-
name="BusinessList"
|
|
50
|
-
component={BusinessList}
|
|
51
|
-
options={{
|
|
52
|
-
tabBarIcon:
|
|
53
|
-
({ color }: any) => (
|
|
54
|
-
<View style={{ width: 50, height: 50, justifyContent: !isIos ? 'flex-start' : 'space-evenly', position: 'relative', bottom: !isIos ? 10 : 0 }}>
|
|
55
|
-
<MaterialCommunityIcon name='home' size={46} color={color} />
|
|
56
|
-
</View>
|
|
57
|
-
)
|
|
58
|
-
}}
|
|
59
|
-
/>
|
|
60
|
-
<Tab.Screen
|
|
61
|
-
name="MyOrders"
|
|
62
|
-
component={MyOrders}
|
|
63
|
-
options={
|
|
64
|
-
{
|
|
65
|
-
tabBarIcon:
|
|
66
|
-
({ color }: any) => (
|
|
67
|
-
<View style={{ width: 50, height: 50, justifyContent: !isIos ? 'flex-start' : 'space-evenly', position: 'relative', bottom: !isIos ? 10 : 0 }}>
|
|
68
|
-
<MaterialIcon name='format-list-bulleted' size={46} color={color} />
|
|
69
|
-
</View>
|
|
70
|
-
),
|
|
71
|
-
}}
|
|
72
|
-
/>
|
|
73
|
-
<Tab.Screen
|
|
74
|
-
name="Cart"
|
|
75
|
-
component={CartList}
|
|
76
|
-
options={{
|
|
77
|
-
tabBarIcon:
|
|
78
|
-
({ color }: any) => (
|
|
79
|
-
<View style={{
|
|
80
|
-
width: 50,
|
|
81
|
-
height: 50,
|
|
82
|
-
justifyContent: !isIos ? 'flex-start' : 'space-evenly',
|
|
83
|
-
position: 'relative',
|
|
84
|
-
bottom: !isIos ? 10 : 0
|
|
85
|
-
}}
|
|
86
|
-
>
|
|
87
|
-
<MaterialIcon name='shopping-basket' size={46} color={color} />
|
|
88
|
-
{cartsList.length > 0 && (
|
|
89
|
-
<CartsLenght style={{ borderRadius: 100 / 2 }}>
|
|
90
|
-
<OText
|
|
91
|
-
color={theme.colors.white}
|
|
92
|
-
>
|
|
93
|
-
{cartsList.length}
|
|
94
|
-
</OText>
|
|
95
|
-
</CartsLenght>
|
|
96
|
-
)}
|
|
97
|
-
</View>
|
|
98
|
-
)
|
|
99
|
-
}}
|
|
100
|
-
/>
|
|
101
|
-
<Tab.Screen
|
|
102
|
-
name="Profile"
|
|
103
|
-
component={Profile}
|
|
104
|
-
options={{
|
|
105
|
-
tabBarIcon:
|
|
106
|
-
({ color }: any) => (
|
|
107
|
-
<View style={{ width: 50, height: 50, justifyContent: !isIos ? 'flex-start' : 'space-evenly', position: 'relative', bottom: !isIos ? 10 : 0 }}>
|
|
108
|
-
<MaterialIcon name='person' size={46} color={color} />
|
|
109
|
-
</View>
|
|
110
|
-
)
|
|
111
|
-
}}
|
|
112
|
-
/>
|
|
113
|
-
</Tab.Navigator>
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export default BottomNavigator
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { createStackNavigator } from "@react-navigation/stack";
|
|
3
|
-
|
|
4
|
-
import AddressList from '../pages/AddressList'
|
|
5
|
-
import AddressForm from '../pages/AddressForm'
|
|
6
|
-
import CartList from '../pages/CartList'
|
|
7
|
-
import CheckoutPage from '../pages/Checkout';
|
|
8
|
-
import BusinessProductsList from '../pages/BusinessProductsList';
|
|
9
|
-
import MultiCheckout from '../pages/MultiCheckout';
|
|
10
|
-
|
|
11
|
-
const Stack = createStackNavigator();
|
|
12
|
-
|
|
13
|
-
const CheckoutNavigator = (props: any) => {
|
|
14
|
-
const {
|
|
15
|
-
navigation,
|
|
16
|
-
route
|
|
17
|
-
} = props;
|
|
18
|
-
|
|
19
|
-
const cartUuid = route?.params?.cartUuid
|
|
20
|
-
|
|
21
|
-
const checkoutProps = {
|
|
22
|
-
navigation,
|
|
23
|
-
route,
|
|
24
|
-
cartUuid: route?.params?.cartUuid
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<Stack.Navigator>
|
|
29
|
-
{!cartUuid && (
|
|
30
|
-
<Stack.Screen
|
|
31
|
-
name="Cart"
|
|
32
|
-
component={CartList}
|
|
33
|
-
options={{ headerShown: false }}
|
|
34
|
-
/>
|
|
35
|
-
)}
|
|
36
|
-
<Stack.Screen
|
|
37
|
-
name="CheckoutPage"
|
|
38
|
-
children={() => <CheckoutPage {...checkoutProps} />}
|
|
39
|
-
options={{ headerShown: false }}
|
|
40
|
-
/>
|
|
41
|
-
<Stack.Screen
|
|
42
|
-
name="Business"
|
|
43
|
-
component={BusinessProductsList}
|
|
44
|
-
options={{ headerShown: false }}
|
|
45
|
-
/>
|
|
46
|
-
<Stack.Screen
|
|
47
|
-
name="AddressList"
|
|
48
|
-
component={AddressList}
|
|
49
|
-
options={{ headerShown: false }}
|
|
50
|
-
initialParams={{isFromCheckout: true}}
|
|
51
|
-
/>
|
|
52
|
-
<Stack.Screen
|
|
53
|
-
name="AddressForm"
|
|
54
|
-
component={AddressForm}
|
|
55
|
-
options={{ headerShown: false }}
|
|
56
|
-
/>
|
|
57
|
-
<Stack.Screen
|
|
58
|
-
name="MultiCheckout"
|
|
59
|
-
children={() => <MultiCheckout {...checkoutProps} />}
|
|
60
|
-
options={{ headerShown: false }}
|
|
61
|
-
/>
|
|
62
|
-
</Stack.Navigator>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export default CheckoutNavigator;
|