ordering-ui-react-native 0.23.76-test → 0.23.77-test
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
CHANGED
|
@@ -107,7 +107,7 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
107
107
|
}, [userLocation, locationSelected]);
|
|
108
108
|
|
|
109
109
|
|
|
110
|
-
useEffect(() => {
|
|
110
|
+
/* useEffect(() => {
|
|
111
111
|
if (isFocused) {
|
|
112
112
|
getBusinessLocations()
|
|
113
113
|
}
|
|
@@ -138,7 +138,7 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
138
138
|
setLocationSelected(null)
|
|
139
139
|
}
|
|
140
140
|
}, [])
|
|
141
|
-
)
|
|
141
|
+
) */
|
|
142
142
|
|
|
143
143
|
const styles = StyleSheet.create({
|
|
144
144
|
image: {
|
|
@@ -268,88 +268,86 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
268
268
|
return (
|
|
269
269
|
<SafeAreaView style={{ flex: 1 }}>
|
|
270
270
|
<View style={{ flex: 1 }}>
|
|
271
|
-
{
|
|
272
|
-
<
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
271
|
+
<View style={{ flex: 1 }}>
|
|
272
|
+
<MapView
|
|
273
|
+
ref={mapRef}
|
|
274
|
+
provider={PROVIDER_GOOGLE}
|
|
275
|
+
initialRegion={{
|
|
276
|
+
latitude: initialPosition?.latitude ?? 1,
|
|
277
|
+
longitude: initialPosition?.longitude ?? 1,
|
|
278
|
+
latitudeDelta: haveOrders ? 0.01 : 0.1,
|
|
279
|
+
longitudeDelta: haveOrders ? 0.01 * ASPECT_RATIO : 0.1 * ASPECT_RATIO,
|
|
280
|
+
}}
|
|
281
|
+
style={{ flex: 1 }}
|
|
282
|
+
zoomTapEnabled
|
|
283
|
+
zoomEnabled
|
|
284
|
+
zoomControlEnabled
|
|
285
|
+
cacheEnabled
|
|
286
|
+
moveOnMarkerPress
|
|
287
|
+
onTouchStart={() => (following.current = false)}
|
|
288
|
+
>
|
|
289
|
+
<>
|
|
290
|
+
{Object.values(markerGroups).length ? (Object.values(markerGroups).map((marker: any) => (
|
|
291
|
+
<RenderMarker
|
|
292
|
+
key={marker[0]?.business_id}
|
|
293
|
+
marker={marker[0]}
|
|
294
|
+
orderIds={marker.map((order: any) => order.id).join(', ')}
|
|
295
|
+
/>
|
|
296
|
+
))) : null}
|
|
297
|
+
{Object.values(customerMarkerGroups).length ? (Object.values(customerMarkerGroups).map((marker: any) => (
|
|
298
|
+
<RenderMarker
|
|
299
|
+
key={marker[0]?.customer_id}
|
|
300
|
+
marker={marker[0]}
|
|
301
|
+
orderIds={marker.map((order: any) => order.id).join(', ')}
|
|
302
|
+
customer
|
|
303
|
+
/>
|
|
304
|
+
))) : null}
|
|
305
|
+
{typeof location.lat === 'number' && !Number.isNaN(location.lat) && typeof location.lng === 'number' && !Number.isNaN(location.lng) ? (
|
|
306
|
+
<Marker
|
|
307
|
+
coordinate={{
|
|
308
|
+
latitude: typeof location.lat === 'number' && !Number.isNaN(location.lat) ? location.lat : 0,
|
|
309
|
+
longitude: typeof location.lng === 'number' && !Number.isNaN(location.lng) ? location.lng : 0,
|
|
310
|
+
}}
|
|
311
|
+
title={t('YOUR_LOCATION', 'Your Location')}
|
|
312
|
+
>
|
|
313
|
+
<Icon
|
|
314
|
+
name="map-marker"
|
|
315
|
+
size={50}
|
|
316
|
+
color={theme.colors.primary}
|
|
304
317
|
/>
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}}
|
|
312
|
-
title={t('YOUR_LOCATION', 'Your Location')}
|
|
313
|
-
>
|
|
314
|
-
<Icon
|
|
315
|
-
name="map-marker"
|
|
316
|
-
size={50}
|
|
317
|
-
color={theme.colors.primary}
|
|
318
|
+
<View style={styles.view}>
|
|
319
|
+
<OIcon
|
|
320
|
+
style={styles.image}
|
|
321
|
+
src={{ uri: user.photo }}
|
|
322
|
+
width={25}
|
|
323
|
+
height={25}
|
|
318
324
|
/>
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
style={{
|
|
346
|
-
position: 'absolute',
|
|
347
|
-
bottom: 35,
|
|
348
|
-
right: 20,
|
|
349
|
-
}}
|
|
350
|
-
/>
|
|
351
|
-
</View>
|
|
352
|
-
) : null}
|
|
325
|
+
</View>
|
|
326
|
+
</Marker>
|
|
327
|
+
) : null}
|
|
328
|
+
</>
|
|
329
|
+
</MapView>
|
|
330
|
+
<OFab
|
|
331
|
+
materialIcon
|
|
332
|
+
iconName="plus"
|
|
333
|
+
onPress={() => onPressZoomIn()}
|
|
334
|
+
style={{
|
|
335
|
+
position: 'absolute',
|
|
336
|
+
bottom: 75,
|
|
337
|
+
right: 20,
|
|
338
|
+
}}
|
|
339
|
+
/>
|
|
340
|
+
<OFab
|
|
341
|
+
materialIcon
|
|
342
|
+
iconName="minus"
|
|
343
|
+
onPress={() => onPressZoomOut()}
|
|
344
|
+
style={{
|
|
345
|
+
position: 'absolute',
|
|
346
|
+
bottom: 35,
|
|
347
|
+
right: 20,
|
|
348
|
+
}}
|
|
349
|
+
/>
|
|
350
|
+
</View>
|
|
353
351
|
</View>
|
|
354
352
|
<View>
|
|
355
353
|
<Alert
|
|
@@ -82,6 +82,7 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
82
82
|
const [phoneToShow, setPhoneToShow] = useState('');
|
|
83
83
|
const [openModal, setOpenModal] = useState(false)
|
|
84
84
|
const allowDriverUpdateData = user?.level !== 4 || configs?.allow_driver_update_data?.value === "1"
|
|
85
|
+
const allowDeleteDriverAccount = user?.level !== 4 || configs?.allow_delete_driver_account?.value === "1"
|
|
85
86
|
const isAdmin = user?.level === 0
|
|
86
87
|
|
|
87
88
|
const setUserCellPhone = (isEdit = false) => {
|
|
@@ -566,10 +567,12 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
566
567
|
|
|
567
568
|
<LogoutButton setRootState={props.setRootState} />
|
|
568
569
|
</Actions>
|
|
569
|
-
|
|
570
|
-
<
|
|
571
|
-
|
|
572
|
-
|
|
570
|
+
{allowDeleteDriverAccount && (
|
|
571
|
+
<RemoveAccount disabled={isAdmin} onPress={() => onRemoveAccount()} activeOpacity={0.7}>
|
|
572
|
+
<AntDesignIcon size={16} name='close' color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
573
|
+
<OText size={14} lineHeight={24} weight={'400'} style={{ opacity: isAdmin ? 0.5 : 1 }} color={theme.colors.danger500}>{t('REMOVE_ACCOUNT', 'Remove account')}</OText>
|
|
574
|
+
</RemoveAccount>
|
|
575
|
+
)}
|
|
573
576
|
<OModal
|
|
574
577
|
open={openModal}
|
|
575
578
|
onClose={() => setOpenModal(false)}
|