diff --git a/package-lock.json b/package-lock.json index 882741a0b..bac568c79 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,7 +52,7 @@ "react-native-shimmer-placeholder": "^2.0.9", "react-native-tab-view": "^3.5.2", "react-native-vector-icons": "^9.0.0", - "react-native-webview": "^13.8.1", + "react-native-webview": "^13.2.2", "sanitize-html": "^2.12.1", "urlencode": "^2.0.0" }, @@ -16265,9 +16265,9 @@ } }, "node_modules/react-native-webview": { - "version": "13.8.1", - "resolved": "https://registry.npmjs.org/react-native-webview/-/react-native-webview-13.8.1.tgz", - "integrity": "sha512-7Jqm1WzWJrOWraBAXQfKtr/Uo5Jw/IJHzC40jYLwgV/eVGmLJ9BpGKw6QVw7wpRkjmTZ2Typ4B1aHJLJJQFslA==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/react-native-webview/-/react-native-webview-13.2.2.tgz", + "integrity": "sha512-uT70y2GUqQzaj2RwRb/QuKRdXeDjXM6oN3DdPqYQlOOMFTCT8r62fybyjVVRoik8io+KLa5KnmuSoS5B2O1BmA==", "dependencies": { "escape-string-regexp": "2.0.0", "invariant": "2.2.4" diff --git a/package.json b/package.json index 618634acc..dbb2231ca 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "react-native-shimmer-placeholder": "^2.0.9", "react-native-tab-view": "^3.5.2", "react-native-vector-icons": "^9.0.0", - "react-native-webview": "^13.8.1", + "react-native-webview": "^13.2.2", "sanitize-html": "^2.12.1", "urlencode": "^2.0.0" }, diff --git a/src/screens/WebviewScreen/components/Appbar.tsx b/src/screens/WebviewScreen/components/Appbar.tsx index aa2c26a3e..6ae11cc3f 100644 --- a/src/screens/WebviewScreen/components/Appbar.tsx +++ b/src/screens/WebviewScreen/components/Appbar.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Share, View, Text, TouchableOpacity } from 'react-native'; +import { Modal, Share, View, Text, TouchableOpacity } from 'react-native'; import { IconButton } from 'react-native-paper'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { WebView } from 'react-native-webview'; @@ -54,7 +54,6 @@ const Appbar: React.FC = ({ backgroundColor: theme.surface2, color: theme.onSurface, onPress: () => { - setMenuVisible(false); webView.current?.reload(); }, }, @@ -63,7 +62,6 @@ const Appbar: React.FC = ({ backgroundColor: theme.surface2, color: theme.onSurface, onPress: () => { - setMenuVisible(false); Share.share({ message: currentUrl }); }, }, @@ -72,7 +70,6 @@ const Appbar: React.FC = ({ backgroundColor: theme.surface2, color: theme.onSurface, onPress: () => { - setMenuVisible(false); Linking.openURL(currentUrl); }, }, @@ -81,7 +78,6 @@ const Appbar: React.FC = ({ backgroundColor: theme.surface2, color: theme.onSurface, onPress: () => { - setMenuVisible(false); webView.current?.clearCache?.(true); webView.current?.reload(); showToast(getString('webview.dataDeleted')); @@ -138,12 +134,32 @@ const Appbar: React.FC = ({ onPress={() => setMenuVisible(true)} theme={{ colors: { ...theme } }} /> - {menuVisible && ( - menuOptions[index].onPress()} - /> - )} + { + setModalVisible(false); + }} + > + setMenuVisible(false)} + style={{ + flex: 1, + width: '100%', + height: '100%', + flexDirection: 'column', + justifyContent: 'center', + alignItems: 'center', + backgroundColor: 'rgba(0,0,0,0.62)', + }} + > + menuOptions[index].onPress()} + /> + + );