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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.23.76-test",
3
+ "version": "0.23.77-test",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -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
- {!isLoadingBusinessMarkers && isFocused ? (
272
- <View style={{ flex: 1 }}>
273
- <MapView
274
- ref={mapRef}
275
- provider={PROVIDER_GOOGLE}
276
- initialRegion={{
277
- latitude: initialPosition?.latitude ?? 1,
278
- longitude: initialPosition?.longitude ?? 1,
279
- latitudeDelta: haveOrders ? 0.01 : 0.1,
280
- longitudeDelta: haveOrders ? 0.01 * ASPECT_RATIO : 0.1 * ASPECT_RATIO,
281
- }}
282
- style={{ flex: 1 }}
283
- zoomTapEnabled
284
- zoomEnabled
285
- zoomControlEnabled
286
- cacheEnabled
287
- moveOnMarkerPress
288
- onTouchStart={() => (following.current = false)}
289
- >
290
- <>
291
- {Object.values(markerGroups).length ? (Object.values(markerGroups).map((marker: any) => (
292
- <RenderMarker
293
- key={marker[0]?.business_id}
294
- marker={marker[0]}
295
- orderIds={marker.map((order: any) => order.id).join(', ')}
296
- />
297
- ))) : null}
298
- {Object.values(customerMarkerGroups).length ? (Object.values(customerMarkerGroups).map((marker: any) => (
299
- <RenderMarker
300
- key={marker[0]?.customer_id}
301
- marker={marker[0]}
302
- orderIds={marker.map((order: any) => order.id).join(', ')}
303
- customer
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
- ))) : null}
306
- {typeof location.lat === 'number' && !Number.isNaN(location.lat) && typeof location.lng === 'number' && !Number.isNaN(location.lng) ? (
307
- <Marker
308
- coordinate={{
309
- latitude: typeof location.lat === 'number' && !Number.isNaN(location.lat) ? location.lat : 0,
310
- longitude: typeof location.lng === 'number' && !Number.isNaN(location.lng) ? location.lng : 0,
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
- <View style={styles.view}>
320
- <OIcon
321
- style={styles.image}
322
- src={{ uri: user.photo }}
323
- width={25}
324
- height={25}
325
- />
326
- </View>
327
- </Marker>
328
- ) : null}
329
- </>
330
- </MapView>
331
- <OFab
332
- materialIcon
333
- iconName="plus"
334
- onPress={() => onPressZoomIn()}
335
- style={{
336
- position: 'absolute',
337
- bottom: 75,
338
- right: 20,
339
- }}
340
- />
341
- <OFab
342
- materialIcon
343
- iconName="minus"
344
- onPress={() => onPressZoomOut()}
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
- <RemoveAccount disabled={isAdmin} onPress={() => onRemoveAccount()} activeOpacity={0.7}>
570
- <AntDesignIcon size={16} name='close' color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
571
- <OText size={14} lineHeight={24} weight={'400'} style={{ opacity: isAdmin ? 0.5 : 1 }} color={theme.colors.danger500}>{t('REMOVE_ACCOUNT', 'Remove account')}</OText>
572
- </RemoveAccount>
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)}