ordering-ui-react-native 0.21.78 → 0.21.79-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/PaymentOptionsWebView/index.tsx +1 -0
- package/src/components/StripeMethodForm/index.tsx +6 -4
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/types/index.tsx +3 -1
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -6
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
- package/themes/business/src/components/BusinessProductList/index.tsx +2 -1
- package/themes/business/src/components/Chat/index.tsx +3 -1
- package/themes/business/src/components/DriverMap/index.tsx +44 -27
- package/themes/business/src/components/GoogleMap/index.tsx +15 -8
- package/themes/business/src/components/Home/index.tsx +5 -1
- package/themes/business/src/components/LanguageSelector/index.tsx +2 -3
- package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/MapView/index.tsx +36 -17
- package/themes/business/src/components/NewOrderNotification/index.tsx +74 -24
- package/themes/business/src/components/OrderDetails/Business.tsx +65 -7
- package/themes/business/src/components/OrderDetails/Delivery.tsx +35 -20
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +110 -40
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +61 -35
- package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
- package/themes/business/src/components/OrderSummary/index.tsx +222 -72
- package/themes/business/src/components/OrdersListManager/index.tsx +9 -1
- package/themes/business/src/components/OrdersOption/index.tsx +247 -159
- package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
- package/themes/business/src/components/PreviousMessages/index.tsx +12 -0
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +25 -15
- package/themes/business/src/components/PreviousOrders/index.tsx +5 -3
- package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
- package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
- package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
- package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
- package/themes/business/src/components/Sessions/index.tsx +187 -0
- package/themes/business/src/components/Sessions/styles.tsx +20 -0
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
- package/themes/business/src/components/UserProfileForm/index.tsx +84 -47
- package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
- package/themes/business/src/components/shared/OInput.tsx +2 -0
- package/themes/business/src/components/shared/OTextarea.tsx +8 -9
- package/themes/business/src/hooks/useLocation.tsx +5 -4
- package/themes/business/src/types/index.tsx +23 -5
- package/themes/business/src/utils/index.tsx +19 -1
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +13 -1
- package/themes/original/src/components/AddressDetails/index.tsx +20 -10
- package/themes/original/src/components/AddressForm/index.tsx +32 -17
- package/themes/original/src/components/AddressList/index.tsx +8 -7
- package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +6 -9
- package/themes/original/src/components/BusinessController/index.tsx +12 -7
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +13 -5
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +2 -3
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +1 -3
- package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
- package/themes/original/src/components/BusinessPreorder/index.tsx +20 -15
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +5 -5
- package/themes/original/src/components/BusinessProductsList/index.tsx +2 -2
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +18 -6
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +38 -11
- package/themes/original/src/components/CartContent/index.tsx +21 -8
- package/themes/original/src/components/Checkout/index.tsx +108 -60
- package/themes/original/src/components/CitiesControl/index.tsx +0 -3
- package/themes/original/src/components/CouponControl/index.tsx +1 -3
- package/themes/original/src/components/DriverTips/index.tsx +1 -3
- package/themes/original/src/components/Favorite/index.tsx +1 -5
- package/themes/original/src/components/FavoriteList/index.tsx +0 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
- package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
- package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +82 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
- package/themes/original/src/components/GoogleMap/index.tsx +39 -18
- package/themes/original/src/components/Help/index.tsx +2 -0
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +2 -10
- package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
- package/themes/original/src/components/LoginForm/index.tsx +4 -7
- package/themes/original/src/components/MessageListing/index.tsx +1 -0
- package/themes/original/src/components/Messages/index.tsx +8 -7
- package/themes/original/src/components/MomentOption/index.tsx +13 -2
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
- package/themes/original/src/components/MultiCheckout/index.tsx +139 -87
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +2 -1
- package/themes/original/src/components/MyOrders/index.tsx +21 -26
- package/themes/original/src/components/NavBar/index.tsx +4 -2
- package/themes/original/src/components/NetworkError/index.tsx +0 -5
- package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +1 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +5 -7
- package/themes/original/src/components/OrderDetails/index.tsx +27 -10
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderProgress/index.tsx +22 -3
- package/themes/original/src/components/OrderSummary/index.tsx +28 -9
- package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
- package/themes/original/src/components/OrdersOption/index.tsx +2 -4
- package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +17 -9
- package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
- package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
- package/themes/original/src/components/ProductForm/ActionButton.tsx +17 -20
- package/themes/original/src/components/ProductForm/index.tsx +107 -102
- package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -49
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +8 -1
- package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
- package/themes/original/src/components/Promotions/index.tsx +6 -9
- package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/index.tsx +52 -54
- package/themes/original/src/components/Sessions/index.tsx +3 -3
- package/themes/original/src/components/SignupForm/index.tsx +86 -78
- package/themes/original/src/components/SingleOrderCard/index.tsx +1 -2
- package/themes/original/src/components/SingleProductCard/index.tsx +3 -4
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +10 -3
- package/themes/original/src/components/StripeElementsForm/index.tsx +77 -60
- package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
- package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
- package/themes/original/src/components/TaxInformation/index.tsx +3 -2
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
- package/themes/original/src/components/UserDetails/index.tsx +3 -2
- package/themes/original/src/components/UserFormDetails/index.tsx +155 -131
- package/themes/original/src/components/UserProfile/index.tsx +11 -2
- package/themes/original/src/components/Wallets/index.tsx +6 -3
- package/themes/original/src/components/WebsocketStatus/index.tsx +169 -0
- package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/original/src/components/shared/OAlert.tsx +2 -1
- package/themes/original/src/components/shared/OButton.tsx +5 -4
- package/themes/original/src/components/shared/OInput.tsx +4 -8
- package/themes/original/src/types/index.tsx +5 -1
- package/themes/original/src/utils/index.tsx +12 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -8,7 +8,6 @@ import Alert from '../../../../../src/providers/AlertProvider'
|
|
|
8
8
|
import { OIcon } from '../shared';
|
|
9
9
|
|
|
10
10
|
export const GoogleMap = (props: GoogleMapsParams) => {
|
|
11
|
-
|
|
12
11
|
const {
|
|
13
12
|
location,
|
|
14
13
|
handleChangeAddressMap,
|
|
@@ -21,7 +20,10 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
21
20
|
locations,
|
|
22
21
|
isIntGeoCoder,
|
|
23
22
|
businessZones,
|
|
24
|
-
delta
|
|
23
|
+
delta,
|
|
24
|
+
autoCompleteAddress,
|
|
25
|
+
setAutoCompleteAddress,
|
|
26
|
+
manualZoom
|
|
25
27
|
} = props
|
|
26
28
|
|
|
27
29
|
const [, t] = useLanguage()
|
|
@@ -59,7 +61,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
59
61
|
strokeWidth: 2
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
const geocodePosition = (pos: { latitude: number, longitude: number }, isMovingRegion
|
|
64
|
+
const geocodePosition = (pos: { latitude: number, longitude: number }, isMovingRegion?: boolean) => {
|
|
63
65
|
Geocoder.from({
|
|
64
66
|
latitude: pos.latitude,
|
|
65
67
|
longitude: pos.longitude
|
|
@@ -84,7 +86,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
84
86
|
}
|
|
85
87
|
handleChangeAddressMap && handleChangeAddressMap(address, details)
|
|
86
88
|
setSaveLocation && setSaveLocation(false)
|
|
87
|
-
if(!isMovingRegion){
|
|
89
|
+
if (!isMovingRegion) {
|
|
88
90
|
handleToggleMap && handleToggleMap()
|
|
89
91
|
}
|
|
90
92
|
} else {
|
|
@@ -95,7 +97,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
95
97
|
})
|
|
96
98
|
}
|
|
97
99
|
|
|
98
|
-
const validateResult = (curPos:
|
|
100
|
+
const validateResult = (curPos: any) => {
|
|
99
101
|
const loc1 = center
|
|
100
102
|
const loc2 = curPos
|
|
101
103
|
const distance = calculateDistance(loc1, loc2)
|
|
@@ -103,25 +105,33 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
103
105
|
if (!maxLimitLocation) {
|
|
104
106
|
geocodePosition(curPos)
|
|
105
107
|
setMarkerPosition(curPos)
|
|
106
|
-
|
|
108
|
+
if (!autoCompleteAddress) {
|
|
109
|
+
setRegion({ longitude: curPos?.longitude || 0, latitude: curPos?.latitude || 0, latitudeDelta: curPos?.latitudeDelta || 0.0010, longitudeDelta: curPos?.longitudeDelta || (delta ?? 0.0010) * ASPECT_RATIO })
|
|
110
|
+
} else {
|
|
111
|
+
setRegion({ longitude: curPos?.longitude, latitude: curPos?.latitude, latitudeDelta: delta ?? 0.0010, longitudeDelta: (delta ?? 0.0010) * ASPECT_RATIO })
|
|
112
|
+
}
|
|
107
113
|
return
|
|
108
114
|
}
|
|
109
115
|
|
|
110
116
|
const _maxLimitLocation = typeof maxLimitLocation === 'string' ? parseInt(maxLimitLocation, 10) : maxLimitLocation
|
|
111
117
|
|
|
112
118
|
if (distance <= _maxLimitLocation) {
|
|
113
|
-
if (!aproxEqual(curPos
|
|
119
|
+
if (!aproxEqual(curPos?.latitude, center.lat) || !aproxEqual(curPos?.longitude, center.lng)) {
|
|
114
120
|
geocodePosition(curPos, true)
|
|
115
121
|
}
|
|
116
122
|
setMarkerPosition(curPos)
|
|
117
|
-
|
|
123
|
+
if (!autoCompleteAddress) {
|
|
124
|
+
setRegion({ longitude: curPos?.longitude || 0, latitude: curPos?.latitude || 0, latitudeDelta: curPos?.latitudeDelta || 0.0010, longitudeDelta: curPos?.longitudeDelta || (delta ?? 0.0010) * ASPECT_RATIO })
|
|
125
|
+
} else {
|
|
126
|
+
setRegion({ longitude: curPos?.longitude, latitude: curPos?.latitude, latitudeDelta: delta ?? 0.0010, longitudeDelta: (delta ?? 0.0010) * ASPECT_RATIO })
|
|
127
|
+
}
|
|
118
128
|
} else {
|
|
119
129
|
setMapErrors && setMapErrors('ERROR_MAX_LIMIT_LOCATION')
|
|
120
130
|
setMarkerPosition({ latitude: center.lat, longitude: center.lng })
|
|
121
131
|
}
|
|
122
132
|
}
|
|
123
133
|
|
|
124
|
-
const aproxEqual = (n1
|
|
134
|
+
const aproxEqual = (n1: number, n2: number, epsilon = 0.000001) => {
|
|
125
135
|
return Math.abs(n1 - n2) < epsilon
|
|
126
136
|
}
|
|
127
137
|
|
|
@@ -182,11 +192,21 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
182
192
|
}, [isIntGeoCoder])
|
|
183
193
|
|
|
184
194
|
useEffect(() => {
|
|
185
|
-
|
|
186
|
-
...region,
|
|
195
|
+
const regionConfig = {
|
|
187
196
|
latitude: location?.lat,
|
|
188
197
|
longitude: location?.lng,
|
|
189
|
-
|
|
198
|
+
latitudeDelta: region?.latitudeDelta ?? delta ?? 0.0010,
|
|
199
|
+
longitudeDelta: region?.longitudeDelta ?? (delta ?? 0.0010) * ASPECT_RATIO
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
mapRef.current.animateToRegion(autoCompleteAddress
|
|
203
|
+
? regionConfig
|
|
204
|
+
: { ...region, ...regionConfig }
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
if (autoCompleteAddress) {
|
|
208
|
+
setAutoCompleteAddress && setAutoCompleteAddress(false)
|
|
209
|
+
}
|
|
190
210
|
}, [location])
|
|
191
211
|
|
|
192
212
|
useEffect(() => {
|
|
@@ -197,11 +217,12 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
197
217
|
|
|
198
218
|
useEffect(() => {
|
|
199
219
|
const interval = setInterval(() => {
|
|
200
|
-
if (mapRef.current && locations) {
|
|
220
|
+
if (mapRef.current && locations && !manualZoom) {
|
|
201
221
|
fitAllMarkers()
|
|
202
222
|
}
|
|
203
223
|
}, 1000)
|
|
204
224
|
if (locations) {
|
|
225
|
+
fitAllMarkers()
|
|
205
226
|
SETMARKERS(locations)
|
|
206
227
|
}
|
|
207
228
|
return () => clearInterval(interval)
|
|
@@ -213,7 +234,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
213
234
|
provider={PROVIDER_GOOGLE}
|
|
214
235
|
initialRegion={region}
|
|
215
236
|
style={styles.map}
|
|
216
|
-
onRegionChangeComplete={!readOnly ? (coordinates) => handleChangeRegion(coordinates) : () => { }}
|
|
237
|
+
onRegionChangeComplete={!readOnly ? (coordinates) => { handleChangeRegion(coordinates) } : () => { }}
|
|
217
238
|
zoomTapEnabled
|
|
218
239
|
zoomEnabled
|
|
219
240
|
zoomControlEnabled
|
|
@@ -249,7 +270,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
249
270
|
<React.Fragment key={i}>
|
|
250
271
|
{businessZone?.type === 2 && Array.isArray(businessZone?.data) && (
|
|
251
272
|
<Polygon
|
|
252
|
-
coordinates={businessZone?.data.map((item: any) => ({ latitude: item.lat, longitude: item.lng}))}
|
|
273
|
+
coordinates={businessZone?.data.map((item: any) => ({ latitude: item.lat, longitude: item.lng }))}
|
|
253
274
|
fillColor={fillStyles.fillColor}
|
|
254
275
|
strokeColor={fillStyles.strokeColor}
|
|
255
276
|
strokeWidth={fillStyles.strokeWidth}
|
|
@@ -257,7 +278,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
257
278
|
)}
|
|
258
279
|
{(businessZone.type === 1 && businessZone?.data?.center && businessZone?.data?.radio) && (
|
|
259
280
|
<Circle
|
|
260
|
-
center={{ latitude: businessZone?.data?.center.lat, longitude: businessZone?.data?.center.lng}}
|
|
281
|
+
center={{ latitude: businessZone?.data?.center.lat, longitude: businessZone?.data?.center.lng }}
|
|
261
282
|
radius={businessZone?.data.radio * 1000}
|
|
262
283
|
fillColor={fillStyles.fillColor}
|
|
263
284
|
strokeColor={fillStyles.strokeColor}
|
|
@@ -266,7 +287,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
266
287
|
)}
|
|
267
288
|
{(businessZone.type === 5 && businessZone?.data?.distance) && (
|
|
268
289
|
<Circle
|
|
269
|
-
center={{ latitude: center.lat, longitude: center.lng}}
|
|
290
|
+
center={{ latitude: center.lat, longitude: center.lng }}
|
|
270
291
|
radius={businessZone?.data.distance * units[businessZone?.data?.unit]}
|
|
271
292
|
fillColor={fillStyles.fillColor}
|
|
272
293
|
strokeColor={fillStyles.strokeColor}
|
|
@@ -275,7 +296,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
275
296
|
)}
|
|
276
297
|
</React.Fragment>
|
|
277
298
|
))}
|
|
278
|
-
</MapView>
|
|
299
|
+
</MapView >
|
|
279
300
|
<Alert
|
|
280
301
|
open={alertState.open}
|
|
281
302
|
onAccept={closeAlert}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
+
import { useTheme } from 'styled-components/native';
|
|
2
3
|
import { Platform, RefreshControl } from 'react-native'
|
|
3
4
|
import { HelpParams } from '../../types'
|
|
4
5
|
import { useLanguage } from 'ordering-components/native'
|
|
@@ -17,6 +18,7 @@ export const Help = (props: HelpParams) => {
|
|
|
17
18
|
navigation
|
|
18
19
|
} = props
|
|
19
20
|
const [, t] = useLanguage()
|
|
21
|
+
const theme = useTheme()
|
|
20
22
|
const [refreshing] = useState(false);
|
|
21
23
|
const [refresh, setRefresh] = useState(false)
|
|
22
24
|
|
|
@@ -18,12 +18,6 @@ export const Home = (props: any) => {
|
|
|
18
18
|
const unaddressedTypes = configs?.unaddressed_order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
|
|
19
19
|
const isAllowUnaddressOrderType = unaddressedTypes.includes(orderState?.options?.type)
|
|
20
20
|
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (isAllowUnaddressOrderType) {
|
|
23
|
-
onNavigationRedirect(!!businessSlug ? 'Business' : 'BusinessList')
|
|
24
|
-
}
|
|
25
|
-
}, [isAllowUnaddressOrderType])
|
|
26
|
-
|
|
27
21
|
return (
|
|
28
22
|
<View style={styles.container}>
|
|
29
23
|
<View>
|
|
@@ -49,11 +43,8 @@ export const Home = (props: any) => {
|
|
|
49
43
|
</OText>
|
|
50
44
|
<OButton
|
|
51
45
|
text={t('LOGIN_NOW', 'Login now')}
|
|
52
|
-
bgColor={theme.colors.primary}
|
|
53
|
-
borderColor={theme.colors.primary}
|
|
54
46
|
style={styles.buttons}
|
|
55
47
|
isCircle={false}
|
|
56
|
-
textStyle={{ color: 'white' }}
|
|
57
48
|
onClick={() => onNavigationRedirect('Login')}
|
|
58
49
|
imgRightSrc={null}
|
|
59
50
|
/>
|
|
@@ -62,13 +53,14 @@ export const Home = (props: any) => {
|
|
|
62
53
|
bgColor={theme.colors.primaryContrast}
|
|
63
54
|
borderColor={theme.colors.primaryContrast}
|
|
64
55
|
style={styles.buttons}
|
|
56
|
+
textStyle={{ color: 'black' }}
|
|
65
57
|
onClick={() => onNavigationRedirect('Signup')}
|
|
66
58
|
imgRightSrc={null}
|
|
67
59
|
/>
|
|
68
60
|
<TouchableOpacity
|
|
69
61
|
style={{ ...styles.textLink, marginTop: 12 }}
|
|
70
62
|
onPress={() =>
|
|
71
|
-
orderState?.options?.address?.address
|
|
63
|
+
orderState?.options?.address?.address || isAllowUnaddressOrderType
|
|
72
64
|
? onNavigationRedirect(!!businessSlug ? 'Business' : 'BusinessList', { isGuestUser: true })
|
|
73
65
|
: onNavigationRedirect('AddressForm', { isGuestUser: true })
|
|
74
66
|
}>
|
|
@@ -145,9 +145,6 @@ export const Otp = (props: otpParams) => {
|
|
|
145
145
|
</TouchableOpacity>
|
|
146
146
|
<OButton
|
|
147
147
|
onClick={() => handleCloseOtp()}
|
|
148
|
-
bgColor={theme.colors.white}
|
|
149
|
-
borderColor={theme.colors.primary}
|
|
150
|
-
textStyle={{ color: theme.colors.primary }}
|
|
151
148
|
style={{ borderRadius: 8, width: '100%' }}
|
|
152
149
|
text={t('CANCEL', 'Cancel')}
|
|
153
150
|
/>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState, useRef } from 'react';
|
|
2
|
-
import { StyleSheet, View, Keyboard, Modal } from 'react-native';
|
|
2
|
+
import { StyleSheet, View, Keyboard, Modal, Platform } from 'react-native';
|
|
3
3
|
import Spinner from 'react-native-loading-spinner-overlay';
|
|
4
4
|
import { useForm, Controller } from 'react-hook-form';
|
|
5
5
|
import { PhoneInputNumber } from '../PhoneInputNumber';
|
|
@@ -108,7 +108,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
108
108
|
|
|
109
109
|
const googleLoginEnabled = configs?.google_login_enabled?.value === '1' || !configs?.google_login_enabled?.enabled
|
|
110
110
|
const facebookLoginEnabled = configs?.facebook_login_enabled?.value === '1' || !configs?.facebook_login_enabled?.enabled
|
|
111
|
-
const appleLoginEnabled = configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled
|
|
111
|
+
const appleLoginEnabled = Platform.OS === 'ios' && (configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled)
|
|
112
112
|
|
|
113
113
|
const loginStyle = StyleSheet.create({
|
|
114
114
|
btnOutline: {
|
|
@@ -630,6 +630,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
630
630
|
/>
|
|
631
631
|
)
|
|
632
632
|
}
|
|
633
|
+
autoCapitalize='none'
|
|
633
634
|
value={value}
|
|
634
635
|
forwardRef={passwordRef}
|
|
635
636
|
onChange={(val: any) => onChange(val)}
|
|
@@ -706,9 +707,6 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
706
707
|
<OButton
|
|
707
708
|
onClick={handleSubmit(onSubmit)}
|
|
708
709
|
text={loginTab !== 'otp' ? loginButtonText : t('GET_VERIFY_CODE', 'Get verify code')}
|
|
709
|
-
bgColor={theme.colors.primary}
|
|
710
|
-
borderColor={theme.colors.primary}
|
|
711
|
-
textStyle={{ color: 'white' }}
|
|
712
710
|
imgRightSrc={null}
|
|
713
711
|
isLoading={formState.loading}
|
|
714
712
|
style={{ borderRadius: 7.6, marginTop: 10, marginBottom: 25 }}
|
|
@@ -747,7 +745,6 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
747
745
|
<OButton
|
|
748
746
|
onClick={handleVerifyCodeClick}
|
|
749
747
|
text={t('GET_VERIFY_CODE', 'Get Verify Code')}
|
|
750
|
-
borderColor={theme.colors.primary}
|
|
751
748
|
style={loginStyle.btnOutline}
|
|
752
749
|
imgRightSrc={null}
|
|
753
750
|
isLoading={isLoadingVerifyModal}
|
|
@@ -802,7 +799,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
802
799
|
handleSuccessGoogleLogin={handleSuccessFacebook}
|
|
803
800
|
/>
|
|
804
801
|
)}
|
|
805
|
-
{(configs?.apple_login_client_id?.value !== '' && configs?.
|
|
802
|
+
{(configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && appleLoginEnabled && (
|
|
806
803
|
<AppleLogin
|
|
807
804
|
notificationState={notificationState}
|
|
808
805
|
handleErrors={(err: any) => { showToast(ToastType.Error, err), vibrateApp() }}
|
|
@@ -237,6 +237,7 @@ export const MessageListing = (props: MessageListingParams) => {
|
|
|
237
237
|
const [seletedOrder, setSeletedOrder] = useState<any>()
|
|
238
238
|
const [openMessages, setOpenMessges] = useState(false)
|
|
239
239
|
const [, t] = useLanguage()
|
|
240
|
+
const theme = useTheme()
|
|
240
241
|
|
|
241
242
|
const goToBack = () => {
|
|
242
243
|
navigation?.canGoBack() && navigation.goBack()
|
|
@@ -127,12 +127,12 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
127
127
|
return message.change?.attribute !== 'driver_id'
|
|
128
128
|
?
|
|
129
129
|
`${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${filterSpecialStatus.includes(message.change.attribute)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
130
|
+
? `${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}`
|
|
131
|
+
: `${message.change?.attribute !== 'logistic_status'
|
|
132
|
+
? message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)])
|
|
133
|
+
: message.change.old !== null && getLogisticTag(message.change.old)} ${t('TO', 'to')} ${message.change?.attribute !== 'logistic_status'
|
|
134
|
+
? t(ORDER_STATUS[parseInt(message.change.new, 10)])
|
|
135
|
+
: getLogisticTag(message.change.new)}`
|
|
136
136
|
}`
|
|
137
137
|
: message.change.new
|
|
138
138
|
?
|
|
@@ -461,7 +461,7 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
461
461
|
active={business}
|
|
462
462
|
>
|
|
463
463
|
<OIcon
|
|
464
|
-
url={order?.business?.logo
|
|
464
|
+
url={order?.business?.logo}
|
|
465
465
|
width={32}
|
|
466
466
|
height={32}
|
|
467
467
|
style={{ borderRadius: 32 }}
|
|
@@ -503,6 +503,7 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
503
503
|
scrollToBottom
|
|
504
504
|
renderAvatarOnTop
|
|
505
505
|
renderUsernameOnMessage
|
|
506
|
+
renderAvatar={() => null}
|
|
506
507
|
renderInputToolbar={renderInputToolbar}
|
|
507
508
|
renderComposer={renderComposer}
|
|
508
509
|
renderSend={renderSend}
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
TimeItem
|
|
30
30
|
} from './styles';
|
|
31
31
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
32
|
-
import {
|
|
32
|
+
import { monthsEnum, setLocalMoment } from '../../utils';
|
|
33
33
|
|
|
34
34
|
const MomentOptionUI = (props: MomentOptionParams) => {
|
|
35
35
|
const {
|
|
@@ -323,6 +323,10 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
323
323
|
}
|
|
324
324
|
}, [dateSelected, JSON.stringify(hoursList), JSON.stringify(datesWhitelist), cateringPreorder, JSON.stringify(business)])
|
|
325
325
|
|
|
326
|
+
useEffect(() => {
|
|
327
|
+
setLocalMoment(moment, t)
|
|
328
|
+
}, [])
|
|
329
|
+
|
|
326
330
|
return (
|
|
327
331
|
<>
|
|
328
332
|
<Container
|
|
@@ -468,7 +472,14 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
468
472
|
</Container>
|
|
469
473
|
{!isCart && !cateringPreorder && (
|
|
470
474
|
<View style={{ position: 'absolute', bottom: bottom, paddingBottom: 20, paddingHorizontal: 20, backgroundColor: 'white', width: '100%' }}>
|
|
471
|
-
<OButton
|
|
475
|
+
<OButton
|
|
476
|
+
onClick={() => handleChangeMoment()}
|
|
477
|
+
isDisabled={!selectedTime}
|
|
478
|
+
text={t('CONTINUE', 'Continue')}
|
|
479
|
+
style={{ borderRadius: 7.6, height: 44, shadowOpacity: 0 }}
|
|
480
|
+
textStyle={{ fontSize: 14 }}
|
|
481
|
+
showNextIcon
|
|
482
|
+
/>
|
|
472
483
|
</View>
|
|
473
484
|
)}
|
|
474
485
|
</>
|
|
@@ -51,7 +51,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
51
51
|
const { confirmApplePayPayment } = useApplePay()
|
|
52
52
|
|
|
53
53
|
const [addCardOpen, setAddCardOpen] = useState({ stripe: false, stripeConnect: false });
|
|
54
|
-
|
|
54
|
+
const [newCardAdded, setNewCardAdded] = useState(null)
|
|
55
55
|
const isWalletCashEnabled = configs?.wallet_cash_enabled?.value === '1'
|
|
56
56
|
const isWalletPointsEnabled = configs?.wallet_credit_point_enabled?.value === '1'
|
|
57
57
|
|
|
@@ -223,6 +223,8 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
223
223
|
handlePaymethodDataChange={handlePaymethodDataChange}
|
|
224
224
|
clientSecret={props.clientSecret}
|
|
225
225
|
onPaymentChange={handlePaymethodDataChange}
|
|
226
|
+
newCardAdded={newCardAdded}
|
|
227
|
+
addNewCardAsDefault
|
|
226
228
|
/>
|
|
227
229
|
</View>
|
|
228
230
|
)}
|
|
@@ -233,6 +235,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
233
235
|
toSave
|
|
234
236
|
businessId={businessIds[0]}
|
|
235
237
|
businessIds={businessIds}
|
|
238
|
+
businessNames={openCarts?.map?.((cart: any) => cart?.business?.name)}
|
|
236
239
|
publicKey={paymethodSelected?.data?.publishable}
|
|
237
240
|
requirements={props.clientSecret}
|
|
238
241
|
handleSource={handlePaymethodDataChange}
|
|
@@ -306,7 +309,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
306
309
|
</>
|
|
307
310
|
)}
|
|
308
311
|
|
|
309
|
-
|
|
312
|
+
<OModal
|
|
310
313
|
entireModal
|
|
311
314
|
title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
|
|
312
315
|
open={addCardOpen.stripe}
|
|
@@ -326,10 +329,11 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
326
329
|
publicKey={paymethodSelected?.data?.publishable}
|
|
327
330
|
requirements={props.clientSecret}
|
|
328
331
|
onSelectCard={handlePaymethodDataChange}
|
|
332
|
+
setNewCardAdded={setNewCardAdded}
|
|
329
333
|
onCancel={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
|
|
330
334
|
/>
|
|
331
335
|
</KeyboardAvoidingView>
|
|
332
|
-
</OModal>
|
|
336
|
+
</OModal>
|
|
333
337
|
</PMContainer>
|
|
334
338
|
)
|
|
335
339
|
}
|