ordering-ui-react-native 0.16.86 → 0.16.87-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/BusinessInformation/index.tsx +19 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +1 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +1 -21
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptionsWebView/index.tsx +119 -120
- package/src/components/SingleProductReview/index.tsx +7 -4
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/utils/index.tsx +2 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +31 -31
- package/themes/business/src/components/DriverMap/index.tsx +22 -9
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
- package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/business/src/components/LoginForm/index.tsx +239 -80
- package/themes/business/src/components/LoginForm/styles.tsx +10 -0
- package/themes/business/src/components/MapView/index.tsx +19 -8
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
- package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -50
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +18 -17
- package/themes/business/src/components/OrdersOption/index.tsx +79 -87
- package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
- package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +447 -247
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
- package/themes/business/src/components/ReviewCustomer/index.tsx +54 -27
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- package/themes/business/src/components/shared/OLink.tsx +33 -13
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/components/shared/OText.tsx +8 -2
- package/themes/business/src/types/index.tsx +35 -3
- package/themes/business/src/utils/index.tsx +53 -0
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
- package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
- package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +1 -0
- package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
- package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
- package/themes/kiosk/src/layouts/Container.tsx +7 -1
- package/themes/kiosk/src/types/index.d.ts +13 -0
- package/themes/kiosk/src/utils/index.tsx +15 -0
- package/themes/original/index.tsx +8 -0
- package/themes/original/src/components/AddressDetails/index.tsx +10 -8
- package/themes/original/src/components/AddressForm/index.tsx +155 -139
- package/themes/original/src/components/AddressList/index.tsx +18 -18
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +118 -76
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -4
- package/themes/original/src/components/BusinessController/index.tsx +100 -47
- package/themes/original/src/components/BusinessController/styles.tsx +14 -9
- package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +9 -3
- package/themes/original/src/components/BusinessListingSearch/index.tsx +87 -34
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +6 -0
- package/themes/original/src/components/BusinessPreorder/index.tsx +96 -15
- package/themes/original/src/components/BusinessProductsList/index.tsx +10 -8
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +564 -495
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +116 -81
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
- package/themes/original/src/components/BusinessesListing/index.tsx +6 -6
- package/themes/original/src/components/Cart/index.tsx +83 -42
- package/themes/original/src/components/CartContent/index.tsx +77 -15
- package/themes/original/src/components/CartContent/styles.tsx +11 -1
- package/themes/original/src/components/Checkout/index.tsx +280 -173
- package/themes/original/src/components/Checkout/styles.tsx +4 -2
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- package/themes/original/src/components/DriverTips/index.tsx +52 -37
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/Favorite/index.tsx +7 -4
- package/themes/original/src/components/Favorite/styles.tsx +1 -1
- package/themes/original/src/components/FavoriteList/index.tsx +70 -80
- package/themes/original/src/components/FloatingButton/index.tsx +1 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +20 -19
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GoogleMap/index.tsx +10 -1
- package/themes/original/src/components/Help/index.tsx +8 -8
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
- package/themes/original/src/components/HelpGuide/index.tsx +12 -16
- package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
- package/themes/original/src/components/HelpOrder/index.tsx +12 -25
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LastOrder/index.tsx +1 -34
- package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +43 -19
- package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
- package/themes/original/src/components/MessageListing/index.tsx +7 -40
- package/themes/original/src/components/Messages/index.tsx +26 -10
- package/themes/original/src/components/MomentOption/index.tsx +195 -88
- package/themes/original/src/components/MultiCart/index.tsx +50 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
- package/themes/original/src/components/MultiCheckout/index.tsx +193 -79
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +66 -17
- package/themes/original/src/components/NavBar/index.tsx +6 -11
- package/themes/original/src/components/NetworkError/index.tsx +5 -3
- package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
- package/themes/original/src/components/Notifications/index.tsx +144 -0
- package/themes/original/src/components/Notifications/styles.tsx +20 -0
- package/themes/original/src/components/OrderDetails/index.tsx +109 -219
- package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +44 -42
- package/themes/original/src/components/OrderProgress/index.tsx +74 -104
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +52 -17
- package/themes/original/src/components/OrderTypeSelector/index.tsx +9 -3
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +29 -20
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +76 -83
- package/themes/original/src/components/PageBanner/index.tsx +146 -0
- package/themes/original/src/components/PageBanner/styles.tsx +11 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +2 -2
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +240 -256
- package/themes/original/src/components/ProductForm/styles.tsx +5 -8
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
- package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
- package/themes/original/src/components/Promotions/index.tsx +234 -220
- package/themes/original/src/components/Promotions/styles.tsx +7 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
- package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
- package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
- package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
- package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
- package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
- package/themes/original/src/components/ServiceForm/index.tsx +377 -270
- package/themes/original/src/components/Sessions/index.tsx +11 -8
- package/themes/original/src/components/Sessions/styles.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +79 -67
- package/themes/original/src/components/SingleOrderCard/index.tsx +125 -56
- package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
- package/themes/original/src/components/SingleProductCard/index.tsx +104 -45
- package/themes/original/src/components/SingleProductCard/styles.tsx +14 -13
- package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
- package/themes/original/src/components/UpsellingProducts/index.tsx +243 -218
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +8 -4
- package/themes/original/src/components/UserFormDetails/index.tsx +53 -54
- package/themes/original/src/components/UserProfile/index.tsx +58 -35
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/Wallets/index.tsx +96 -93
- package/themes/original/src/components/Wallets/styles.tsx +2 -0
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +6 -2
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +10 -1
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/types/index.tsx +37 -5
- package/themes/original/src/utils/index.tsx +321 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -23,6 +23,21 @@ export interface LoginParams {
|
|
|
23
23
|
notificationState?: any;
|
|
24
24
|
handleReCaptcha?: any;
|
|
25
25
|
enableReCaptcha?: any;
|
|
26
|
+
|
|
27
|
+
otpType?: string,
|
|
28
|
+
setOtpType: (type: string) => void,
|
|
29
|
+
generateOtpCode: (values?: any) => void,
|
|
30
|
+
useLoginOtpEmail?: boolean,
|
|
31
|
+
useLoginOtpCellphone?: boolean,
|
|
32
|
+
useLoginOtp?: boolean
|
|
33
|
+
}
|
|
34
|
+
export interface otpParams {
|
|
35
|
+
willVerifyOtpState: boolean,
|
|
36
|
+
setWillVerifyOtpState: (val: boolean) => void,
|
|
37
|
+
onSubmit: () => void,
|
|
38
|
+
handleLoginOtp: (code: string) => void,
|
|
39
|
+
setAlertState: any,
|
|
40
|
+
formState?: any
|
|
26
41
|
}
|
|
27
42
|
export interface ProfileParams {
|
|
28
43
|
navigation?: any;
|
|
@@ -256,6 +271,7 @@ export interface MessagesOptionParams {
|
|
|
256
271
|
messagesReadList?: any;
|
|
257
272
|
onNavigationRedirect?: any;
|
|
258
273
|
setSortBy?: any;
|
|
274
|
+
getOrders: any
|
|
259
275
|
}
|
|
260
276
|
export interface OrdersOptionParams {
|
|
261
277
|
orderList?: any;
|
|
@@ -296,6 +312,10 @@ export interface OrdersOptionParams {
|
|
|
296
312
|
isLogisticActivated?: boolean;
|
|
297
313
|
isAlsea?: boolean;
|
|
298
314
|
checkNotification?: boolean;
|
|
315
|
+
ordersFormatted?: any;
|
|
316
|
+
handleChangeOrderStatus?: () => void;
|
|
317
|
+
handleSendCustomerReview?: () => void;
|
|
318
|
+
orderDetailsProps?: any;
|
|
299
319
|
}
|
|
300
320
|
export interface ActiveOrdersParams {
|
|
301
321
|
orders?: any;
|
|
@@ -409,7 +429,7 @@ export interface MessagesParams {
|
|
|
409
429
|
order?: any;
|
|
410
430
|
orderId?: number;
|
|
411
431
|
messages?: any;
|
|
412
|
-
message
|
|
432
|
+
message: string;
|
|
413
433
|
image?: string;
|
|
414
434
|
messagesToShow?: any;
|
|
415
435
|
sendMessage?: any;
|
|
@@ -554,19 +574,23 @@ export interface AcceptOrRejectOrderParams {
|
|
|
554
574
|
loading?: boolean;
|
|
555
575
|
action: string;
|
|
556
576
|
orderId?: number;
|
|
557
|
-
handleUpdateOrder?: (
|
|
577
|
+
handleUpdateOrder?: (p1: any, p2: any) => {};
|
|
558
578
|
notShowCustomerPhone?: boolean | undefined;
|
|
559
|
-
actions?:
|
|
579
|
+
actions?: any;
|
|
560
580
|
titleAccept?: textTranslate;
|
|
561
581
|
titleReject?: textTranslate;
|
|
562
582
|
titleNotReady?: textTranslate;
|
|
563
583
|
appTitle?: textTranslate;
|
|
564
584
|
orderTitle?: any
|
|
585
|
+
isPage?: boolean
|
|
586
|
+
navigation?: any
|
|
587
|
+
route?: any
|
|
565
588
|
}
|
|
566
589
|
|
|
567
590
|
export interface MapViewParams {
|
|
568
591
|
onNavigationRedirect: (page: string, params?: any) => void,
|
|
569
592
|
getBusinessLocations: () => void,
|
|
593
|
+
setDriverLocation: (location: any) => void,
|
|
570
594
|
isLoadingBusinessMarkers?: boolean,
|
|
571
595
|
markerGroups: Array<any>,
|
|
572
596
|
customerMarkerGroups: Array<any>,
|
|
@@ -582,8 +606,16 @@ export interface ReviewCustomerParams {
|
|
|
582
606
|
actionState?: any,
|
|
583
607
|
handleChangeQualification?: any,
|
|
584
608
|
handleSendCustomerReview?: any,
|
|
609
|
+
handleCustomCustomerReview?: any,
|
|
585
610
|
}
|
|
586
611
|
|
|
587
612
|
export interface NoNetworkParams {
|
|
588
613
|
image?: any;
|
|
589
614
|
}
|
|
615
|
+
|
|
616
|
+
export interface OrderDetailsLogisticParams {
|
|
617
|
+
navigation: any,
|
|
618
|
+
handleClickLogisticOrder: any,
|
|
619
|
+
orderAssingId: number,
|
|
620
|
+
order: any
|
|
621
|
+
}
|
|
@@ -38,6 +38,8 @@ export const getTraduction = (key: string, t: any) => {
|
|
|
38
38
|
ERROR_PRODUCT_NOT_FOUND: 'Error with the product',
|
|
39
39
|
ERROR_USER_UPDATE_YOU_HAVE_ASSIGNED_ORDERS:
|
|
40
40
|
"You can't because you have assigned orders",
|
|
41
|
+
ERROR_INVALID_OFFER: 'The offer doesn\'t exist',
|
|
42
|
+
ERROR_AUTH_DRIVER_LOGIN_VALIDATION: 'Error auth driver login validation'
|
|
41
43
|
};
|
|
42
44
|
|
|
43
45
|
return keyList[key] ? t(key, keyList[key]) : t(key);
|
|
@@ -343,3 +345,54 @@ export const getOrderStatus = (s: string, t: any) => {
|
|
|
343
345
|
|
|
344
346
|
return objectStatus && objectStatus;
|
|
345
347
|
};
|
|
348
|
+
|
|
349
|
+
export const transformDistance = (value: number, distanceUnit?: string) => {
|
|
350
|
+
return distanceUnit === 'mi'
|
|
351
|
+
? (value / 1.609).toFixed(2)
|
|
352
|
+
: distanceUnit === 'ft'
|
|
353
|
+
? (value * 3280.84).toFixed(0)
|
|
354
|
+
: (value).toFixed(2)
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export const formatSeconds = (seconds: number) => {
|
|
358
|
+
// Hours, minutes and seconds
|
|
359
|
+
const hrs = Math.floor(seconds / 3600)
|
|
360
|
+
const mins = Math.floor((seconds % 3600) / 60)
|
|
361
|
+
const secs = Math.floor(seconds % 60)
|
|
362
|
+
|
|
363
|
+
// Output like '1:01' or '4:03:59' or '123:03:59'
|
|
364
|
+
let ret = ''
|
|
365
|
+
if (hrs > 0) {
|
|
366
|
+
ret += '' + hrs + ':' + (mins < 10 ? '0' : '')
|
|
367
|
+
}
|
|
368
|
+
ret += '' + mins + ':' + (secs < 10 ? '0' : '')
|
|
369
|
+
ret += '' + secs
|
|
370
|
+
return ret
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export const calculateDistance = (
|
|
374
|
+
pointA: { lat: number; lng: number },
|
|
375
|
+
pointB: { latitude: number; longitude: number },
|
|
376
|
+
) => {
|
|
377
|
+
const lat1 = pointA.lat;
|
|
378
|
+
const lon1 = pointA.lng;
|
|
379
|
+
|
|
380
|
+
const lat2 = pointB?.latitude;
|
|
381
|
+
const lon2 = pointB?.longitude;
|
|
382
|
+
|
|
383
|
+
const R = 6371e3;
|
|
384
|
+
const φ1 = lat1 * (Math.PI / 180);
|
|
385
|
+
const φ2 = lat2 * (Math.PI / 180);
|
|
386
|
+
const Δφ = (lat2 - lat1) * (Math.PI / 180);
|
|
387
|
+
const Δλ = (lon2 - lon1) * (Math.PI / 180);
|
|
388
|
+
|
|
389
|
+
const a =
|
|
390
|
+
Math.sin(Δφ / 2) * Math.sin(Δφ / 2) +
|
|
391
|
+
Math.cos(φ1) * Math.cos(φ2) * (Math.sin(Δλ / 2) * Math.sin(Δλ / 2));
|
|
392
|
+
|
|
393
|
+
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
394
|
+
|
|
395
|
+
const distance = R * c;
|
|
396
|
+
const distanceInKm = distance / 1000;
|
|
397
|
+
return distanceInKm;
|
|
398
|
+
};
|
|
@@ -197,7 +197,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
197
197
|
{isFarAway && (
|
|
198
198
|
<FarAwayMessage style={styles.farAwayMsg}>
|
|
199
199
|
<Ionicons name='md-warning-outline' style={styles.iconStyle} />
|
|
200
|
-
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', '
|
|
200
|
+
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
|
|
201
201
|
</FarAwayMessage>
|
|
202
202
|
)}
|
|
203
203
|
{!auth && (
|
|
@@ -410,8 +410,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
410
410
|
textInputProps={{
|
|
411
411
|
returnKeyType: 'next',
|
|
412
412
|
onSubmitEditing: () => inputRef?.current?.focus?.(),
|
|
413
|
-
style: { borderWidth: 0, fontSize: 12 }
|
|
414
|
-
maxLength: 10
|
|
413
|
+
style: { borderWidth: 0, fontSize: 12 }
|
|
415
414
|
}}
|
|
416
415
|
textWrapStyle={{ borderColor: theme.colors.clear, borderWidth: 0, height: 40, paddingStart: 0 }}
|
|
417
416
|
/>
|
|
@@ -155,7 +155,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
155
155
|
{isFarAway && (
|
|
156
156
|
<FarAwayMessage style={styles.farAwayMsg}>
|
|
157
157
|
<Ionicons name='md-warning-outline' style={styles.iconStyle} />
|
|
158
|
-
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', '
|
|
158
|
+
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
|
|
159
159
|
</FarAwayMessage>
|
|
160
160
|
)}
|
|
161
161
|
<View style={styles.wrapperOrderOptions}>
|
|
@@ -20,6 +20,7 @@ const BusinessesListingUI = (props: any) => {
|
|
|
20
20
|
const {
|
|
21
21
|
navigation,
|
|
22
22
|
businessesList,
|
|
23
|
+
paginationProps,
|
|
23
24
|
handleBusinessClick,
|
|
24
25
|
} = props;
|
|
25
26
|
|
|
@@ -78,7 +79,7 @@ const BusinessesListingUI = (props: any) => {
|
|
|
78
79
|
</CardsContainer>
|
|
79
80
|
|
|
80
81
|
|
|
81
|
-
{!businessesList.loading && businessesList.businesses.length === 0 && (
|
|
82
|
+
{!businessesList.loading && businessesList.businesses.length === 0 && paginationProps.totalPages !== null && (
|
|
82
83
|
<NotFoundSource
|
|
83
84
|
content={t(
|
|
84
85
|
'NOT_FOUND_BUSINESSES',
|
|
@@ -50,6 +50,12 @@ const CheckoutUI = (props: any) => {
|
|
|
50
50
|
}
|
|
51
51
|
}, [cart])
|
|
52
52
|
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (!cartState.loading && cart && !cart?.valid && cart?.status === 2) {
|
|
55
|
+
navigation?.canGoBack() && navigation.goBack()
|
|
56
|
+
}
|
|
57
|
+
}, [cart])
|
|
58
|
+
|
|
53
59
|
return (
|
|
54
60
|
<>
|
|
55
61
|
<PaymentOptions
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
2
|
+
import { formatSeconds } from '../../../utils'
|
|
3
|
+
import { StyleSheet, TouchableOpacity } from 'react-native';
|
|
4
|
+
import { useCountdownTimer } from '../../../../../../src/hooks/useCountdownTimer';
|
|
5
|
+
import { useLanguage } from 'ordering-components/native';
|
|
6
|
+
import { OTPContainer } from './styles';
|
|
7
|
+
import { OText, OButton } from '../../shared';
|
|
8
|
+
import OTPInputView from '@twotalltotems/react-native-otp-input'
|
|
9
|
+
import { useTheme } from 'styled-components/native';
|
|
10
|
+
import { otpParams } from '../../../types'
|
|
11
|
+
|
|
12
|
+
export const Otp = (props: otpParams) => {
|
|
13
|
+
const {
|
|
14
|
+
willVerifyOtpState,
|
|
15
|
+
setWillVerifyOtpState,
|
|
16
|
+
onSubmit,
|
|
17
|
+
handleLoginOtp,
|
|
18
|
+
setAlertState,
|
|
19
|
+
pinCount
|
|
20
|
+
} = props
|
|
21
|
+
|
|
22
|
+
const theme = useTheme();
|
|
23
|
+
const [, t] = useLanguage();
|
|
24
|
+
const [otpLeftTime, _, resetOtpLeftTime]: any = useCountdownTimer(
|
|
25
|
+
600, willVerifyOtpState)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
const handleOnSubmit = () => {
|
|
29
|
+
setAlertState({
|
|
30
|
+
open: true,
|
|
31
|
+
title: t('CODE_SENT', 'The code has been sent'),
|
|
32
|
+
})
|
|
33
|
+
resetOtpLeftTime()
|
|
34
|
+
onSubmit()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (otpLeftTime === 0) {
|
|
39
|
+
setAlertState({
|
|
40
|
+
open: true,
|
|
41
|
+
title: t('TIME_IS_UP', 'Time is up'),
|
|
42
|
+
content: t('PLEASE_RESEND_CODE', 'Please resend code again')
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
}, [otpLeftTime])
|
|
46
|
+
|
|
47
|
+
const loginStyle = StyleSheet.create({
|
|
48
|
+
underlineStyleBase: {
|
|
49
|
+
width: 45,
|
|
50
|
+
height: 60,
|
|
51
|
+
borderWidth: 1,
|
|
52
|
+
fontSize: 16
|
|
53
|
+
},
|
|
54
|
+
underlineStyleHighLighted: {
|
|
55
|
+
borderColor: theme.colors.primary,
|
|
56
|
+
color: theme.colors.primary,
|
|
57
|
+
fontSize: 16
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<>
|
|
63
|
+
<OTPContainer>
|
|
64
|
+
<OText size={24}>
|
|
65
|
+
{formatSeconds(otpLeftTime)}
|
|
66
|
+
</OText>
|
|
67
|
+
<OTPInputView
|
|
68
|
+
style={{ width: '100%', height: 150 }}
|
|
69
|
+
pinCount={pinCount || 6}
|
|
70
|
+
codeInputFieldStyle={loginStyle.underlineStyleBase}
|
|
71
|
+
codeInputHighlightStyle={loginStyle.underlineStyleHighLighted}
|
|
72
|
+
onCodeFilled={(code: string) => handleLoginOtp(code)}
|
|
73
|
+
selectionColor={theme.colors.primary}
|
|
74
|
+
editable
|
|
75
|
+
/>
|
|
76
|
+
<TouchableOpacity onPress={() => handleOnSubmit()} disabled={otpLeftTime > 520}>
|
|
77
|
+
<OText size={16} mBottom={30} color={otpLeftTime > 520 ? theme.colors.disabled : theme.colors.primary}>
|
|
78
|
+
{t('RESEND_CODE', 'Resend code')}
|
|
79
|
+
</OText>
|
|
80
|
+
</TouchableOpacity>
|
|
81
|
+
<OButton
|
|
82
|
+
onClick={() => setWillVerifyOtpState(false)}
|
|
83
|
+
bgColor={theme.colors.white}
|
|
84
|
+
borderColor={theme.colors.primary}
|
|
85
|
+
textStyle={{ color: theme.colors.primary }}
|
|
86
|
+
style={{ borderRadius: 8, width: '100%' }}
|
|
87
|
+
text={t('CANCEL', 'Cancel')}
|
|
88
|
+
/>
|
|
89
|
+
</OTPContainer>
|
|
90
|
+
</>
|
|
91
|
+
)
|
|
92
|
+
}
|