Skip to content

Commit

Permalink
fix: Use Safe Area Insets for WebView Screen (Closes #1301)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajarsheechatterjee committed Nov 5, 2024
1 parent bdd00cd commit 5460047
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/screens/WebviewScreen/WebviewScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useRef, useState } from 'react';
import WebView, { WebViewNavigation } from 'react-native-webview';
import { ProgressBar } from 'react-native-paper';
import { useSafeAreaInsets } from 'react-native-safe-area-context';

import { getPlugin } from '@plugins/pluginManager';
import { useBackHandler } from '@hooks';
Expand All @@ -25,6 +26,7 @@ const WebviewScreen = ({ route, navigation }: WebviewScreenProps) => {
const { name, url, pluginId, isNovel } = route.params;
const isSave = getPlugin(pluginId)?.webStorageUtilized;
const uri = resolveUrl(pluginId, url, isNovel);
const { bottom } = useSafeAreaInsets();

const theme = useTheme();
const webViewRef = useRef<WebView | null>(null);
Expand Down Expand Up @@ -107,6 +109,7 @@ const WebviewScreen = ({ route, navigation }: WebviewScreenProps) => {
onMessage={({ nativeEvent }) =>
setTempData(JSON.parse(nativeEvent.data))
}
containerStyle={{ paddingBottom: bottom }}
/>
{menuVisible ? (
<Menu
Expand Down

0 comments on commit 5460047

Please sign in to comment.