ordering-ui-react-native 0.23.78 → 0.23.80

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.78",
3
+ "version": "0.23.80",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -1,14 +1,15 @@
1
- import React from 'react';
1
+ import React, { useEffect } from 'react';
2
2
  import { TouchableOpacity, StyleSheet } from 'react-native';
3
- import { LogoutAction } from 'ordering-components/native';
4
- import { useLanguage } from 'ordering-components/native';
3
+ import { LogoutAction, ToastType, useToast } from 'ordering-components/native';
4
+ import { useLanguage, useSession } from 'ordering-components/native';
5
5
  import { useTheme } from 'styled-components/native';
6
6
  import { OIcon, OText } from '../shared';
7
7
  import { _retrieveStoreData, _clearStoreData } from '../../providers/StoreUtil';
8
8
 
9
9
  const LogoutButtonUI = (props: any) => {
10
- const { handleLogoutClick, setRootState } = props;
10
+ const { handleLogoutClick, setRootState, formState } = props;
11
11
  const [, t] = useLanguage();
12
+ const [, { showToast }] = useToast()
12
13
  const theme = useTheme();
13
14
 
14
15
  const handleClick = async () => {
@@ -20,6 +21,12 @@ const LogoutButtonUI = (props: any) => {
20
21
  }
21
22
  };
22
23
 
24
+ useEffect(() => {
25
+ if (formState?.result?.error) {
26
+ showToast(ToastType.Error, t(formState?.result?.result))
27
+ }
28
+ }, [formState?.result])
29
+
23
30
  const styles = StyleSheet.create({
24
31
  container: {
25
32
  alignItems: 'center',
@@ -54,9 +61,11 @@ const LogoutButtonUI = (props: any) => {
54
61
  };
55
62
 
56
63
  export const LogoutButton = (props: any) => {
64
+ const [{ user }] = useSession()
57
65
  const logoutProps = {
58
66
  ...props,
59
67
  isNative: true,
68
+ isDriverApp: user?.level === 4,
60
69
  UIComponent: LogoutButtonUI,
61
70
  };
62
71
 
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect, useRef, useCallback } from 'react';
2
- import { Dimensions, SafeAreaView, StyleSheet, View } from 'react-native';
2
+ import { Dimensions, Platform, SafeAreaView, StyleSheet, View } from 'react-native';
3
3
  import { useFocusEffect } from '@react-navigation/native'
4
4
  import MapView, {
5
5
  PROVIDER_GOOGLE,
@@ -265,8 +265,8 @@ const MapViewComponent = (props: MapViewParams) => {
265
265
  style={{ flex: 1 }}
266
266
  zoomTapEnabled
267
267
  zoomEnabled
268
- zoomControlEnabled
269
- cacheEnabled
268
+ zoomControlEnabled={!(isDeliveryApp && Platform.OS === 'android')}
269
+ cacheEnabled={(isDeliveryApp && Platform.OS === 'android' && isFocused) || Platform.OS === 'ios' || !isDeliveryApp}
270
270
  moveOnMarkerPress
271
271
  onTouchStart={() => (following.current = false)}
272
272
  >