ordering-ui-react-native 0.16.33 → 0.16.34-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 +7 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/index.tsx +61 -63
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/BusinessBasicInformation/index.tsx +11 -19
- package/src/components/BusinessInformation/index.tsx +33 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +10 -10
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +2 -1
- package/src/components/LanguageSelector/index.tsx +21 -16
- package/src/components/LoginForm/index.tsx +15 -0
- package/src/components/Messages/index.tsx +2 -2
- package/src/components/NotificationSetting/index.tsx +85 -0
- package/src/components/OrderDetails/index.tsx +2 -20
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +335 -365
- package/src/components/PaymentOptionsWebView/index.tsx +120 -121
- package/src/components/ReviewDriver/index.tsx +1 -1
- package/src/components/ReviewOrder/index.tsx +2 -1
- package/src/components/ReviewProducts/index.tsx +11 -0
- package/src/components/SignupForm/index.tsx +15 -0
- package/src/components/SingleProductReview/index.tsx +8 -5
- package/src/components/StripeElementsForm/index.tsx +25 -16
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OBottomPopup.tsx +6 -2
- package/src/index.tsx +2 -0
- package/src/pages/BusinessesListing.tsx +7 -6
- package/src/pages/OrderDetails.tsx +1 -1
- package/src/pages/ReviewDriver.tsx +2 -2
- package/src/pages/ReviewOrder.tsx +2 -2
- package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
- package/src/utils/index.tsx +2 -1
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +38 -30
- package/themes/business/src/components/DriverMap/index.tsx +7 -5
- package/themes/business/src/components/DriverSchedule/index.tsx +71 -0
- package/themes/business/src/components/DriverSchedule/styles.tsx +6 -0
- package/themes/business/src/components/LoginForm/index.tsx +111 -74
- package/themes/business/src/components/MapView/index.tsx +12 -1
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +25 -19
- package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
- package/themes/business/src/components/OrdersOption/index.tsx +65 -21
- 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/index.tsx +21 -23
- package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +27 -13
- package/themes/business/src/components/ScheduleBlocked/index.tsx +53 -0
- package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +28 -4
- 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/OModal.tsx +40 -37
- package/themes/business/src/types/index.tsx +15 -9
- package/themes/business/src/utils/index.tsx +10 -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/index.tsx +121 -10
- package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +4 -0
- package/themes/original/src/components/AddressDetails/index.tsx +2 -2
- package/themes/original/src/components/AddressForm/index.tsx +151 -140
- package/themes/original/src/components/AddressList/index.tsx +1 -1
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +311 -161
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
- package/themes/original/src/components/BusinessController/index.tsx +190 -113
- package/themes/original/src/components/BusinessController/styles.tsx +0 -7
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +4 -4
- package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +80 -128
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +49 -52
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +173 -104
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +18 -11
- package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +37 -25
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -4
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +278 -104
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +47 -10
- package/themes/original/src/components/BusinessesListing/index.tsx +95 -7
- package/themes/original/src/components/Cart/index.tsx +44 -12
- package/themes/original/src/components/Cart/styles.tsx +4 -0
- package/themes/original/src/components/CartContent/index.tsx +22 -16
- package/themes/original/src/components/Checkout/index.tsx +101 -61
- package/themes/original/src/components/Checkout/styles.tsx +0 -1
- package/themes/original/src/components/DriverTips/index.tsx +4 -4
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/Favorite/index.tsx +1 -0
- package/themes/original/src/components/FavoriteList/index.tsx +32 -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/GoogleMap/index.tsx +20 -12
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
- package/themes/original/src/components/HelpGuide/index.tsx +9 -8
- package/themes/original/src/components/HelpOrder/index.tsx +9 -8
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LoginForm/Otp/index.tsx +95 -72
- package/themes/original/src/components/LoginForm/index.tsx +90 -46
- package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
- package/themes/original/src/components/Messages/index.tsx +17 -17
- package/themes/original/src/components/MomentOption/index.tsx +8 -6
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -92
- package/themes/original/src/components/MultiCheckout/index.tsx +6 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -16
- package/themes/original/src/components/MyOrders/index.tsx +70 -6
- package/themes/original/src/components/NavBar/index.tsx +15 -9
- 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 +148 -0
- package/themes/original/src/components/Notifications/styles.tsx +17 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
- package/themes/original/src/components/OrderDetails/index.tsx +200 -37
- package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
- package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
- package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
- package/themes/original/src/components/OrderProgress/index.tsx +77 -66
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +3 -36
- package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
- package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +97 -106
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +71 -55
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +41 -23
- package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
- package/themes/original/src/components/PlaceSpot/index.tsx +243 -47
- package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +635 -664
- package/themes/original/src/components/ProductForm/styles.tsx +9 -8
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOption/index.tsx +1 -1
- package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
- package/themes/original/src/components/ProfessionalProfile/index.tsx +26 -14
- package/themes/original/src/components/ReviewDriver/index.tsx +7 -7
- package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
- package/themes/original/src/components/ReviewProducts/index.tsx +2 -2
- package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
- package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
- package/themes/original/src/components/SearchBar/index.tsx +5 -3
- package/themes/original/src/components/ServiceForm/index.tsx +410 -258
- package/themes/original/src/components/SignupForm/index.tsx +350 -206
- package/themes/original/src/components/SingleOrderCard/index.tsx +229 -181
- package/themes/original/src/components/SingleOrderCard/styles.tsx +0 -7
- package/themes/original/src/components/SingleProductCard/index.tsx +200 -110
- package/themes/original/src/components/SingleProductCard/styles.tsx +2 -10
- 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/StripeElementsForm/index.tsx +18 -7
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
- package/themes/original/src/components/UserDetails/index.tsx +31 -17
- package/themes/original/src/components/UserFormDetails/index.tsx +74 -81
- package/themes/original/src/components/UserProfile/index.tsx +54 -29
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +15 -10
- package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
- package/themes/original/src/components/Wallets/index.tsx +176 -164
- package/themes/original/src/components/Wallets/styles.tsx +12 -8
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/OBottomPopup.tsx +48 -15
- package/themes/original/src/components/shared/OButton.tsx +10 -3
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +13 -3
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
- package/themes/original/src/types/index.tsx +91 -30
- package/themes/original/src/utils/index.tsx +121 -10
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useLanguage } from 'ordering-components/native';
|
|
3
3
|
import FontAwesome from 'react-native-vector-icons/FontAwesome';
|
|
4
|
-
import {CODES} from 'ordering-components/native'
|
|
4
|
+
import { CODES } from 'ordering-components/native'
|
|
5
5
|
import { ORDER_TYPES } from '../config/constants';
|
|
6
6
|
|
|
7
7
|
export const flatArray = (arr: any) => [].concat(...arr)
|
|
8
|
+
const [languageState, t] = useLanguage();
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Function to return the traduction depending of a key 't'
|
|
@@ -40,6 +41,116 @@ export const getTraduction = (key: string) => {
|
|
|
40
41
|
return keyList[key] ? t(key, keyList[key]) : t(key)
|
|
41
42
|
}
|
|
42
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Change local moment variables
|
|
46
|
+
*/
|
|
47
|
+
export const setLocalMoment = (moment: any, t: any) => {
|
|
48
|
+
moment.locale('custom', {
|
|
49
|
+
months: [
|
|
50
|
+
t('MONTH1', 'January'),
|
|
51
|
+
t('MONTH2', 'February'),
|
|
52
|
+
t('MONTH3', 'March'),
|
|
53
|
+
t('MONTH4', 'April'),
|
|
54
|
+
t('MONTH5', 'May'),
|
|
55
|
+
t('MONTH6', 'June'),
|
|
56
|
+
t('MONTH7', 'July'),
|
|
57
|
+
t('MONTH8', 'August'),
|
|
58
|
+
t('MONTH9', 'September'),
|
|
59
|
+
t('MONTH10', 'October'),
|
|
60
|
+
t('MONTH11', 'November'),
|
|
61
|
+
t('MONTH12', 'December')
|
|
62
|
+
],
|
|
63
|
+
monthsShort: [
|
|
64
|
+
t('MONTHSHORT1', 'Jan'),
|
|
65
|
+
t('MONTHSHORT2', 'Feb'),
|
|
66
|
+
t('MONTHSHORT3', 'Mar'),
|
|
67
|
+
t('MONTHSHORT4', 'Apr'),
|
|
68
|
+
t('MONTHSHORT5', 'May'),
|
|
69
|
+
t('MONTHSHORT6', 'Jun'),
|
|
70
|
+
t('MONTHSHORT7', 'Jul'),
|
|
71
|
+
t('MONTHSHORT8', 'Aug'),
|
|
72
|
+
t('MONTHSHORT9', 'Sep'),
|
|
73
|
+
t('MONTHSHORT10', 'Oct'),
|
|
74
|
+
t('MONTHSHORT11', 'Nov'),
|
|
75
|
+
t('MONTHSHORT12', 'Dec')
|
|
76
|
+
],
|
|
77
|
+
weekdays: [
|
|
78
|
+
t('DAY7', 'Sunday'),
|
|
79
|
+
t('DAY1', 'Monday'),
|
|
80
|
+
t('DAY2', 'Tuesday'),
|
|
81
|
+
t('DAY3', 'Wednesday'),
|
|
82
|
+
t('DAY4', 'Thursday'),
|
|
83
|
+
t('DAY5', 'Friday'),
|
|
84
|
+
t('DAY6', 'Saturday')
|
|
85
|
+
],
|
|
86
|
+
weekdaysShort: [
|
|
87
|
+
t('DAYSHORT7', 'Sun'),
|
|
88
|
+
t('DAYSHORT1', 'Mon'),
|
|
89
|
+
t('DAYSHORT2', 'Tue'),
|
|
90
|
+
t('DAYSHORT3', 'Wed'),
|
|
91
|
+
t('DAYSHORT4', 'Thu'),
|
|
92
|
+
t('DAYSHORT5', 'Fri'),
|
|
93
|
+
t('DAYSHORT6', 'Sat')
|
|
94
|
+
],
|
|
95
|
+
weekdaysMin: [
|
|
96
|
+
t('DAYMIN7', 'Su'),
|
|
97
|
+
t('DAYMIN1', 'Mo'),
|
|
98
|
+
t('DAYMIN2', 'Tu'),
|
|
99
|
+
t('DAYMIN3', 'We'),
|
|
100
|
+
t('DAYMIN4', 'Th'),
|
|
101
|
+
t('DAYMIN5', 'Fr'),
|
|
102
|
+
t('DAYMIN6', 'Sa')
|
|
103
|
+
],
|
|
104
|
+
meridiem: function (hours: any) {
|
|
105
|
+
return hours < 12 ? t('AM', 'AM') : t('PM', 'PM');
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export const monthsEnum: any = {
|
|
111
|
+
Jan: 'MONTHSHORT1',
|
|
112
|
+
Feb: 'MONTHSHORT2',
|
|
113
|
+
Mar: 'MONTHSHORT3',
|
|
114
|
+
Apr: 'MONTHSHORT4',
|
|
115
|
+
May: 'MONTHSHORT5',
|
|
116
|
+
Jun: 'MONTHSHORT6',
|
|
117
|
+
Jul: 'MONTHSHORT7',
|
|
118
|
+
Aug: 'MONTHSHORT8',
|
|
119
|
+
Sep: 'MONTHSHORT9',
|
|
120
|
+
Oct: 'MONTHSHORT10',
|
|
121
|
+
Nov: 'MONTHSHORT11',
|
|
122
|
+
Dec: 'MONTHSHORT12',
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export const locale = {
|
|
126
|
+
name: languageState?.language?.code?.slice(0, 2),
|
|
127
|
+
config: {
|
|
128
|
+
months: [
|
|
129
|
+
t('MONTH1', 'January'),
|
|
130
|
+
t('MONTH2', 'February'),
|
|
131
|
+
t('MONTH3', 'March'),
|
|
132
|
+
t('MONTH4', 'April'),
|
|
133
|
+
t('MONTH5', 'May'),
|
|
134
|
+
t('MONTH6', 'June'),
|
|
135
|
+
t('MONTH7', 'July'),
|
|
136
|
+
t('MONTH8', 'August'),
|
|
137
|
+
t('MONTH9', 'September'),
|
|
138
|
+
t('MONTH10', 'October'),
|
|
139
|
+
t('MONTH11', 'November'),
|
|
140
|
+
t('MONTH12', 'December')
|
|
141
|
+
],
|
|
142
|
+
weekdaysShort: [
|
|
143
|
+
t('DAYSHORT7', 'Sun'),
|
|
144
|
+
t('DAYSHORT1', 'Mon'),
|
|
145
|
+
t('DAYSHORT2', 'Tue'),
|
|
146
|
+
t('DAYSHORT3', 'Wed'),
|
|
147
|
+
t('DAYSHORT4', 'Thu'),
|
|
148
|
+
t('DAYSHORT5', 'Fri'),
|
|
149
|
+
t('DAYSHORT6', 'Sat')
|
|
150
|
+
],
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
|
|
43
154
|
/**
|
|
44
155
|
* Function to convert delivery time in minutes
|
|
45
156
|
* @param {string} time business delivery time
|
|
@@ -116,7 +227,7 @@ export const getIconCard = (brand: string, size: number) => {
|
|
|
116
227
|
* Function to return a static google maps image based in location
|
|
117
228
|
* @param {object} param object with latitude and logitude
|
|
118
229
|
*/
|
|
119
|
-
|
|
230
|
+
export const getGoogleMapImage = ({ lat, lng }: any, apiKey: string) => {
|
|
120
231
|
return `https://maps.googleapis.com/maps/api/staticmap?size=500x190¢er=${lat},${lng}&zoom=17&scale=2&maptype=roadmap&&markers=icon:https://res.cloudinary.com/ditpjbrmz/image/upload/f_auto,q_auto,w_45,q_auto:best,q_auto:best/v1564675872/marker-customer_kvxric.png%7Ccolor:white%7C${lat},${lng}&key=${apiKey}`
|
|
121
232
|
}
|
|
122
233
|
/**
|
|
@@ -147,8 +258,8 @@ export const sortInputFields = ({ fields, values }: any) => {
|
|
|
147
258
|
return fieldsSorted;
|
|
148
259
|
}
|
|
149
260
|
|
|
150
|
-
export const transformCountryCode = (countryCode
|
|
151
|
-
const code = CODES.find((code
|
|
261
|
+
export const transformCountryCode = (countryCode: number) => {
|
|
262
|
+
const code = CODES.find((code: any) => code.phoneCode === countryCode)
|
|
152
263
|
return code?.countryCode
|
|
153
264
|
}
|
|
154
265
|
|
|
@@ -158,7 +269,7 @@ export const transformCountryCode = (countryCode : number) => {
|
|
|
158
269
|
* @param {*} parser function fallback when is decimal
|
|
159
270
|
* @returns string
|
|
160
271
|
*/
|
|
161
|
-
|
|
272
|
+
export const verifyDecimals = (value: number, parser: any) => {
|
|
162
273
|
if (value % 1 === 0) {
|
|
163
274
|
return value
|
|
164
275
|
} else {
|
|
@@ -174,7 +285,7 @@ export const getTypesText = (value: number) => {
|
|
|
174
285
|
/**
|
|
175
286
|
* List shape for ribbon
|
|
176
287
|
*/
|
|
177
|
-
|
|
288
|
+
export const shape = {
|
|
178
289
|
rectangle: 'rectangle',
|
|
179
290
|
rectangleRound: 'rectangle_round',
|
|
180
291
|
capsuleShape: 'capsule_shape'
|
|
@@ -185,7 +296,7 @@ export const getTypesText = (value: number) => {
|
|
|
185
296
|
* @param {number} value for transform
|
|
186
297
|
*
|
|
187
298
|
*/
|
|
188
|
-
|
|
299
|
+
export const convertToRadian = (value: number) => {
|
|
189
300
|
return value * Math.PI / 180
|
|
190
301
|
}
|
|
191
302
|
|
|
@@ -207,14 +318,14 @@ export const getDistance = (lat1: any, lon1: any, lat2: any, lon2: any) => {
|
|
|
207
318
|
return R * c
|
|
208
319
|
}
|
|
209
320
|
|
|
210
|
-
export const formatUrlVideo = (url
|
|
321
|
+
export const formatUrlVideo = (url: string) => {
|
|
211
322
|
const regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/
|
|
212
323
|
const match = url.match(regExp)
|
|
213
324
|
const id = (match && match[7].length === 11) ? match[7] : false
|
|
214
325
|
return `https://www.youtube-nocookie.com/embed/${id}`
|
|
215
326
|
}
|
|
216
327
|
|
|
217
|
-
export const formatSeconds = (seconds
|
|
328
|
+
export const formatSeconds = (seconds: number) => {
|
|
218
329
|
// Hours, minutes and seconds
|
|
219
330
|
var hrs = ~~(seconds / 3600)
|
|
220
331
|
var mins = ~~((seconds % 3600) / 60)
|
|
@@ -233,7 +344,7 @@ export const formatSeconds = (seconds : number) => {
|
|
|
233
344
|
/**
|
|
234
345
|
* List of price to filter businesses
|
|
235
346
|
*/
|
|
236
|
-
|
|
347
|
+
export const priceList = [
|
|
237
348
|
{ level: '1', content: '$' },
|
|
238
349
|
{ level: '2', content: '$$' },
|
|
239
350
|
{ level: '3', content: '$$$' },
|
|
@@ -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}>
|