ordering-ui-react-native 0.22.40-release → 0.22.41-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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.22.40-release",
3
+ "version": "0.22.41-release",
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 } = props;
10
+ const { handleLogoutClick, formState } = props;
11
11
  const [, t] = useLanguage();
12
+ const [, { showToast }] = useToast()
12
13
  const theme = useTheme();
13
14
 
14
15
  const handleClick = async () => {
@@ -19,6 +20,12 @@ const LogoutButtonUI = (props: any) => {
19
20
  }
20
21
  };
21
22
 
23
+ useEffect(() => {
24
+ if (formState?.result?.error) {
25
+ showToast(ToastType.Error, t(formState?.result?.result))
26
+ }
27
+ }, [formState?.result])
28
+
22
29
  const styles = StyleSheet.create({
23
30
  container: {
24
31
  alignItems: 'center',
@@ -53,9 +60,11 @@ const LogoutButtonUI = (props: any) => {
53
60
  };
54
61
 
55
62
  export const LogoutButton = (props: any) => {
63
+ const [{ user }] = useSession()
56
64
  const logoutProps = {
57
65
  ...props,
58
66
  isNative: true,
67
+ isDriverApp: user?.level === 4,
59
68
  UIComponent: LogoutButtonUI,
60
69
  };
61
70
 
@@ -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,
@@ -263,8 +263,8 @@ const MapViewComponent = (props: MapViewParams) => {
263
263
  style={{ flex: 1 }}
264
264
  zoomTapEnabled
265
265
  zoomEnabled
266
- zoomControlEnabled
267
- cacheEnabled
266
+ zoomControlEnabled={!(isDeliveryApp && Platform.OS === 'android')}
267
+ cacheEnabled={(isDeliveryApp && Platform.OS === 'android' && isFocused) || Platform.OS === 'ios' || !isDeliveryApp}
268
268
  moveOnMarkerPress
269
269
  onTouchStart={() => (following.current = false)}
270
270
  >