diff --git a/src/screens/WebviewScreen/WebviewScreen.tsx b/src/screens/WebviewScreen/WebviewScreen.tsx index 8e362c014..5a9b51789 100644 --- a/src/screens/WebviewScreen/WebviewScreen.tsx +++ b/src/screens/WebviewScreen/WebviewScreen.tsx @@ -9,6 +9,7 @@ import { getUserAgent } from '@hooks/persisted/useUserAgent'; import { resolveUrl } from '@services/plugin/fetch'; import { storage } from '@plugins/helpers/storage'; import Appbar from './components/Appbar'; +import Menu from './Menu'; type StorageData = { localStorage?: Record; @@ -29,6 +30,7 @@ const WebviewScreen = ({ route, navigation }: WebviewScreenProps) => { const [canGoBack, setCanGoBack] = useState(false); const [canGoForward, setCanGoForward] = useState(false); const [tempData, setTempData] = useState(); + const [menuVisible, setMenuVisible] = useState(false); const handleNavigation = (e: WebViewNavigation) => { if (!e.loading) { @@ -80,6 +82,15 @@ const WebviewScreen = ({ route, navigation }: WebviewScreenProps) => { navigation.goBack(); }} /> + {menuVisible ? ( + + ) : null} ; goBack: () => void; + setMenuVisible: () => void; } const Appbar: React.FC = ({ @@ -27,9 +29,9 @@ const Appbar: React.FC = ({ canGoForward, webView, goBack, + setMenuVisible, }) => { const { top } = useSafeAreaInsets(); - const [menuVisible, setMenuVisible] = useState(false); return ( = ({ flexDirection: 'row', }} > - = ({ = ({ style={{ flexDirection: 'row', justifyContent: 'flex-end', + marginHorizontal: 3, }} > - webView.current?.goBack()} - theme={{ colors: { ...theme } }} + theme={theme} /> - webView.current?.goForward()} - theme={{ colors: { ...theme } }} + theme={theme} /> - setMenuVisible(true)} - theme={{ colors: { ...theme } }} + theme={theme} /> - {menuVisible ? ( - - ) : null} );