From f3e2f937c7f2fe453744620e98595d780e61017e Mon Sep 17 00:00:00 2001 From: Leon Date: Fri, 13 Oct 2023 10:52:55 +0800 Subject: [PATCH] fix: Fix the style of native webview --- .../kit/src/components/WebView/NativeWebView.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/kit/src/components/WebView/NativeWebView.tsx b/packages/kit/src/components/WebView/NativeWebView.tsx index 979f7f60047..30f7bf866d1 100644 --- a/packages/kit/src/components/WebView/NativeWebView.tsx +++ b/packages/kit/src/components/WebView/NativeWebView.tsx @@ -7,9 +7,9 @@ import { } from 'react'; import { JsBridgeNativeHost } from '@onekeyfe/onekey-cross-webview'; -import { StyleSheet } from 'react-native'; import { WebView } from 'react-native-webview'; +import { useTheme } from '@onekeyhq/components'; import debugLogger from '@onekeyhq/shared/src/logger/debugLogger'; import { openUrlExternal } from '../../utils/openUrl'; @@ -23,11 +23,6 @@ import type { WebViewMessageEvent, WebViewProps } from 'react-native-webview'; export type NativeWebViewProps = WebViewProps & InpageProviderWebViewProps; -const styles = StyleSheet.create({ - container: { - flex: 1, - }, -}); const NativeWebView = forwardRef( ( { @@ -42,6 +37,7 @@ const NativeWebView = forwardRef( }: NativeWebViewProps, ref, ) => { + const { themeVariant } = useTheme(); const webviewRef = useRef(); const jsBridge = useMemo( @@ -117,7 +113,10 @@ const NativeWebView = forwardRef( return (