ordering-ui-react-native 0.18.14 → 0.18.15
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 +1 -1
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/MapView/index.tsx +8 -8
- package/themes/original/src/components/BusinessPreorder/index.tsx +1 -1
- package/themes/original/src/components/Cart/index.tsx +2 -1
- package/themes/original/src/components/MultiCheckout/index.tsx +26 -0
- package/themes/original/src/components/OrderProgress/index.tsx +4 -4
- package/themes/original/src/components/PaymentOptions/index.tsx +1 -1
package/package.json
CHANGED
|
@@ -80,9 +80,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
80
80
|
locations.map((location: { lat: number; lng: number; level: number }) => {
|
|
81
81
|
return location.level === 4 && driverLocation?.lat
|
|
82
82
|
? {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
latitude: driverLocation?.lat,
|
|
84
|
+
longitude: driverLocation?.lng,
|
|
85
|
+
}
|
|
86
86
|
: { latitude: location.lat, longitude: location.lng };
|
|
87
87
|
});
|
|
88
88
|
|
|
@@ -107,7 +107,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
107
107
|
}
|
|
108
108
|
let data = null;
|
|
109
109
|
const details = {
|
|
110
|
-
geometry: { location: { lat: pos
|
|
110
|
+
geometry: { location: { lat: pos?.latitude, lng: pos?.longitude } },
|
|
111
111
|
};
|
|
112
112
|
if (isSetInputs) {
|
|
113
113
|
data = {
|
|
@@ -165,8 +165,8 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
165
165
|
const lat1 = pointA.lat;
|
|
166
166
|
const lon1 = pointA.lng;
|
|
167
167
|
|
|
168
|
-
const lat2 = pointB
|
|
169
|
-
const lon2 = pointB
|
|
168
|
+
const lat2 = pointB?.latitude;
|
|
169
|
+
const lon2 = pointB?.longitude;
|
|
170
170
|
|
|
171
171
|
const R = 6371e3;
|
|
172
172
|
const φ1 = lat1 * (Math.PI / 180);
|
|
@@ -201,11 +201,11 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
201
201
|
content: !(errKey === 'ERROR_MAX_LIMIT_LOCATION_TO')
|
|
202
202
|
? [t(errKey, mapErrors[errKey])]
|
|
203
203
|
: [
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
204
|
+
`${t(errKey, mapErrors[errKey])} ${maxLimitLocation} ${t(
|
|
205
|
+
'METTERS',
|
|
206
|
+
'meters',
|
|
207
|
+
)}`,
|
|
208
|
+
],
|
|
209
209
|
key: errKey,
|
|
210
210
|
});
|
|
211
211
|
};
|
|
@@ -237,9 +237,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
237
237
|
MARKERS = locations.map((location: { lat: number; lng: number; level: number }) => {
|
|
238
238
|
return location.level === 4 && driverLocation?.lat
|
|
239
239
|
? {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
latitude: driverLocation?.lat,
|
|
241
|
+
longitude: driverLocation?.lng,
|
|
242
|
+
}
|
|
243
243
|
: { latitude: location.lat, longitude: location.lng };
|
|
244
244
|
})
|
|
245
245
|
fitAllMarkers();
|
|
@@ -284,7 +284,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
284
284
|
onRegionChangeComplete={
|
|
285
285
|
!readOnly
|
|
286
286
|
? coordinates => handleChangeRegion(coordinates)
|
|
287
|
-
: () => {}
|
|
287
|
+
: () => { }
|
|
288
288
|
}
|
|
289
289
|
zoomTapEnabled
|
|
290
290
|
zoomEnabled
|
|
@@ -302,12 +302,13 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
302
302
|
i: number,
|
|
303
303
|
) => (
|
|
304
304
|
<React.Fragment key={i}>
|
|
305
|
-
<Marker
|
|
306
|
-
coordinate={location}
|
|
307
|
-
onPress={() => {
|
|
305
|
+
<Marker
|
|
306
|
+
coordinate={location}
|
|
307
|
+
onPress={() => {
|
|
308
308
|
mapRef.current?.animateCamera({
|
|
309
|
-
|
|
310
|
-
|
|
309
|
+
center: { latitude: location?.latitude, longitude: location?.longitude },
|
|
310
|
+
})
|
|
311
|
+
}}
|
|
311
312
|
>
|
|
312
313
|
<Icon
|
|
313
314
|
name="map-marker"
|
|
@@ -328,46 +329,46 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
328
329
|
<Callout
|
|
329
330
|
onPress={() => {
|
|
330
331
|
showLocation({
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
332
|
+
latitude: location?.latitude,
|
|
333
|
+
longitude: location?.longitude,
|
|
334
|
+
sourceLatitude: userLocation?.latitude,
|
|
335
|
+
sourceLongitude: userLocation.longitude,
|
|
336
|
+
naverCallerName: 'com.businessapp',
|
|
337
|
+
dialogTitle: t('SHOW_IN_OTHER_MAPS', 'Show in other maps'),
|
|
338
|
+
dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
|
|
339
|
+
cancelText: t('CANCEL', 'Cancel'),
|
|
339
340
|
})
|
|
340
341
|
}}
|
|
341
342
|
>
|
|
342
|
-
<View style={{flex: 1,width: 250, paddingRight: 10, paddingLeft: 10, justifyContent:'space-between' }}>
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
343
|
+
<View style={{ flex: 1, width: 250, paddingRight: 10, paddingLeft: 10, justifyContent: 'space-between' }}>
|
|
344
|
+
<View style={{ flex: 1, marginBottom: 20 }}>
|
|
345
|
+
<OText size={16} weight={'bold'} style={{ paddingTop: 10, marginBottom: 10 }}>{locations[i]?.title}</OText>
|
|
346
|
+
{locations[i]?.address && (
|
|
347
|
+
<>
|
|
348
|
+
<OText size={16} >{locations[i]?.address.addressName}</OText>
|
|
349
|
+
<OText size={16} >{locations[i]?.address.zipcode}</OText>
|
|
350
|
+
</>
|
|
351
|
+
)}
|
|
352
|
+
</View>
|
|
353
|
+
<OButton
|
|
354
|
+
text={t('GO_TO_THIS_LOCATION', 'Go to this location')}
|
|
355
|
+
imgRightSrc={null}
|
|
356
|
+
textStyle={{
|
|
357
|
+
color: theme.colors.white,
|
|
358
|
+
fontFamily: 'Poppins',
|
|
359
|
+
fontStyle: 'normal',
|
|
360
|
+
fontWeight: 'normal',
|
|
361
|
+
fontSize: 16
|
|
362
|
+
}}
|
|
363
|
+
style={{
|
|
364
|
+
alignContent: 'center',
|
|
365
|
+
borderRadius: 10,
|
|
366
|
+
height: 35,
|
|
367
|
+
bottom: 10
|
|
368
|
+
}}
|
|
369
|
+
bgColor={theme.colors.primary}
|
|
370
|
+
borderColor={theme.colors.primary}
|
|
371
|
+
/>
|
|
371
372
|
</View>
|
|
372
373
|
</Callout>
|
|
373
374
|
</Marker>
|
|
@@ -42,7 +42,7 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
42
42
|
followUserLocation
|
|
43
43
|
} = useLocation();
|
|
44
44
|
|
|
45
|
-
const location = { lat: userLocation
|
|
45
|
+
const location = { lat: userLocation?.latitude, lng: userLocation?.longitude }
|
|
46
46
|
const haveOrders = Object.values(markerGroups)?.length > 0 && Object.values(customerMarkerGroups)?.length > 0
|
|
47
47
|
const closeAlert = () => {
|
|
48
48
|
setAlertState({
|
|
@@ -57,8 +57,8 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
57
57
|
[
|
|
58
58
|
{ latitude: location.latitude, longitude: location.longitude },
|
|
59
59
|
{
|
|
60
|
-
latitude: userLocation
|
|
61
|
-
longitude: userLocation
|
|
60
|
+
latitude: userLocation?.latitude,
|
|
61
|
+
longitude: userLocation?.longitude,
|
|
62
62
|
},
|
|
63
63
|
],
|
|
64
64
|
{
|
|
@@ -213,10 +213,10 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
useEffect(() => {
|
|
216
|
-
if (userLocation
|
|
216
|
+
if (userLocation?.latitude !== 0 && userLocation?.longitude !== 0) {
|
|
217
217
|
const location = {
|
|
218
|
-
lat: userLocation
|
|
219
|
-
lng: userLocation
|
|
218
|
+
lat: userLocation?.latitude,
|
|
219
|
+
lng: userLocation?.longitude
|
|
220
220
|
}
|
|
221
221
|
setDriverLocation({ location })
|
|
222
222
|
}
|
|
@@ -231,8 +231,8 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
231
231
|
ref={mapRef}
|
|
232
232
|
provider={PROVIDER_GOOGLE}
|
|
233
233
|
initialRegion={{
|
|
234
|
-
latitude: initialPosition
|
|
235
|
-
longitude: initialPosition
|
|
234
|
+
latitude: initialPosition?.latitude,
|
|
235
|
+
longitude: initialPosition?.longitude,
|
|
236
236
|
latitudeDelta: haveOrders ? 0.01 : 0.1,
|
|
237
237
|
longitudeDelta: haveOrders ? 0.01 * ASPECT_RATIO : 0.1 * ASPECT_RATIO,
|
|
238
238
|
}}
|
|
@@ -557,7 +557,7 @@ export const BusinessPreorder = (props: any) => {
|
|
|
557
557
|
: null
|
|
558
558
|
|
|
559
559
|
const splitCateringValue = (configName : string) =>
|
|
560
|
-
Object.values(
|
|
560
|
+
Object.values(props?.business?.configs || {})
|
|
561
561
|
?.find(config => config?.key === configName)
|
|
562
562
|
?.value?.split('|')
|
|
563
563
|
?.find(val => val.includes(cateringTypeString || ''))?.split(',')[1]
|
|
@@ -45,6 +45,7 @@ const CartUI = (props: any) => {
|
|
|
45
45
|
isMultiCheckout,
|
|
46
46
|
hideDeliveryFee,
|
|
47
47
|
hideDriverTip,
|
|
48
|
+
hideCouponInput,
|
|
48
49
|
preorderSlotInterval,
|
|
49
50
|
preorderLeadTime,
|
|
50
51
|
preorderTimeRange,
|
|
@@ -406,7 +407,7 @@ const CartUI = (props: any) => {
|
|
|
406
407
|
<OText size={12}>-{parsePrice(event.amount, { isTruncable: true })}</OText>
|
|
407
408
|
</OSTable>
|
|
408
409
|
))}
|
|
409
|
-
{isCouponEnabled && !isCartPending && (
|
|
410
|
+
{isCouponEnabled && !isCartPending && !hideCouponInput && (
|
|
410
411
|
<OSTable>
|
|
411
412
|
<OSCoupon>
|
|
412
413
|
<CouponControl
|
|
@@ -23,7 +23,9 @@ import { MultiCartsPaymethodsAndWallets } from '../MultiCartsPaymethodsAndWallet
|
|
|
23
23
|
import { Cart } from '../Cart'
|
|
24
24
|
import { FloatingButton } from '../FloatingButton'
|
|
25
25
|
import { DriverTips } from '../DriverTips'
|
|
26
|
+
import { CouponControl } from '../CouponControl';
|
|
26
27
|
import { DriverTipsContainer } from '../Cart/styles'
|
|
28
|
+
import { OSTable, OSCoupon } from '../OrderSummary/styles';
|
|
27
29
|
|
|
28
30
|
import {
|
|
29
31
|
ChContainer,
|
|
@@ -263,6 +265,29 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
263
265
|
</ChSection>
|
|
264
266
|
)}
|
|
265
267
|
|
|
268
|
+
{
|
|
269
|
+
validationFields?.fields?.checkout?.coupon?.enabled &&
|
|
270
|
+
openCarts.every((cart: any) => cart.business_id && cart.status !== 2) &&
|
|
271
|
+
configs?.multi_business_checkout_coupon_input_style?.value === 'group' &&
|
|
272
|
+
(
|
|
273
|
+
<ChSection>
|
|
274
|
+
<OText size={14} lineHeight={20} color={theme.colors.textNormal}>
|
|
275
|
+
{t('DISCOUNT_COUPON', 'Discount coupon')}
|
|
276
|
+
</OText>
|
|
277
|
+
<OSTable>
|
|
278
|
+
<OSCoupon>
|
|
279
|
+
<CouponControl
|
|
280
|
+
isMulti
|
|
281
|
+
carts={openCarts}
|
|
282
|
+
businessIds={openCarts.map((cart: any) => cart.business_id)}
|
|
283
|
+
price={openCarts.reduce((total: any, cart: any) => total + cart.total, 0)}
|
|
284
|
+
/>
|
|
285
|
+
</OSCoupon>
|
|
286
|
+
</OSTable>
|
|
287
|
+
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
|
|
288
|
+
</ChSection>
|
|
289
|
+
)}
|
|
290
|
+
|
|
266
291
|
<ChSection>
|
|
267
292
|
<ChCarts>
|
|
268
293
|
<CartsHeader>
|
|
@@ -276,6 +301,7 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
276
301
|
cart={cart}
|
|
277
302
|
cartuuid={cart.uuid}
|
|
278
303
|
isMultiCheckout
|
|
304
|
+
hideCouponInput={configs?.multi_business_checkout_coupon_input_style?.value === 'group'}
|
|
279
305
|
hideDeliveryFee={configs?.multi_business_checkout_show_combined_delivery_fee?.value === '1'}
|
|
280
306
|
hideDriverTip={configs?.multi_business_checkout_show_combined_driver_tip?.value === '1'}
|
|
281
307
|
onNavigationRedirect={(route: string, params: any) => props.navigation.navigate(route, params)}
|
|
@@ -117,11 +117,11 @@ const OrderProgressUI = (props: any) => {
|
|
|
117
117
|
<View style={styles.logoWrapper}>
|
|
118
118
|
<FastImage
|
|
119
119
|
style={{ width: 50, height: 50 }}
|
|
120
|
-
source={{
|
|
120
|
+
source={orderList?.orders.length === 1 ? {
|
|
121
121
|
uri: optimizeImage(lastOrder?.business?.logo, 'h_50,c_limit'),
|
|
122
122
|
priority: FastImage.priority.normal,
|
|
123
|
-
}}
|
|
124
|
-
resizeMode={FastImage.resizeMode.
|
|
123
|
+
} : theme.images.logos.logotype}
|
|
124
|
+
resizeMode={FastImage.resizeMode.contain}
|
|
125
125
|
/>
|
|
126
126
|
</View>
|
|
127
127
|
<View style={{
|
|
@@ -190,7 +190,7 @@ export const OrderProgress = (props: any) => {
|
|
|
190
190
|
useDefualtSessionManager: true,
|
|
191
191
|
paginationSettings: {
|
|
192
192
|
initialPage: 1,
|
|
193
|
-
pageSize:
|
|
193
|
+
pageSize: 10,
|
|
194
194
|
controlType: 'infinity'
|
|
195
195
|
}
|
|
196
196
|
}
|
|
@@ -75,7 +75,7 @@ const PaymentOptionsUI = (props: any) => {
|
|
|
75
75
|
case 'paypal':
|
|
76
76
|
return theme.images.general.paypal
|
|
77
77
|
case 'stripe':
|
|
78
|
-
return theme.images.general.
|
|
78
|
+
return theme.images.general.creditCard
|
|
79
79
|
case 'stripe_direct':
|
|
80
80
|
return theme.images.general.stripecc
|
|
81
81
|
case 'stripe_connect':
|