chore: ios window color [skip e2e]

This commit is contained in:
Aman Harwara
2023-11-06 14:38:05 +05:30
parent d55b2527d5
commit ade6c8bb1e

View File

@@ -356,45 +356,52 @@ const MobileWebAppContents = ({ destroyAndReload }: { destroyAndReload: () => vo
} }
return ( return (
<WebView <View
ref={webViewRef}
source={{ uri: sourceUri }}
style={{ style={{
flex: 1,
backgroundColor: '#000000', backgroundColor: '#000000',
opacity: didLoadEnd ? 1 : 0,
}} }}
originWhitelist={['*']} >
onError={(err) => console.error('An error has occurred', err)} <WebView
onHttpError={() => console.error('An HTTP error occurred')} ref={webViewRef}
onMessage={onMessage} source={{ uri: sourceUri }}
onContentProcessDidTerminate={() => { style={{
webViewRef.current?.reload() backgroundColor: Platform.OS === 'ios' ? 'transparent' : '#000000',
}} opacity: didLoadEnd ? 1 : 0,
onRenderProcessGone={() => { }}
webViewRef.current?.reload() originWhitelist={['*']}
}} onError={(err) => console.error('An error has occurred', err)}
hideKeyboardAccessoryView={true} onHttpError={() => console.error('An HTTP error occurred')}
onShouldStartLoadWithRequest={onShouldStartLoadWithRequest} onMessage={onMessage}
allowFileAccess={true} onContentProcessDidTerminate={() => {
allowUniversalAccessFromFileURLs={true} webViewRef.current?.reload()
injectedJavaScriptBeforeContentLoaded={injectedJS} }}
bounces={false} onRenderProcessGone={() => {
keyboardDisplayRequiresUserAction={false} webViewRef.current?.reload()
allowsInlineMediaPlayback={requireInlineMediaPlaybackForMomentsFeature} }}
mediaPlaybackRequiresUserAction={requireMediaUserInteractionForMomentsFeature} hideKeyboardAccessoryView={true}
scalesPageToFit={true} onShouldStartLoadWithRequest={onShouldStartLoadWithRequest}
/** allowFileAccess={true}
* This disables the global window scroll but keeps scroll within div elements like lists and textareas. allowUniversalAccessFromFileURLs={true}
* This is needed to prevent the keyboard from pushing the webview up and down when it appears and disappears. injectedJavaScriptBeforeContentLoaded={injectedJS}
*/ bounces={false}
scrollEnabled={false} keyboardDisplayRequiresUserAction={false}
overScrollMode="never" allowsInlineMediaPlayback={requireInlineMediaPlaybackForMomentsFeature}
nativeConfig={Platform.select({ mediaPlaybackRequiresUserAction={requireMediaUserInteractionForMomentsFeature}
android: { scalesPageToFit={true}
component: CustomAndroidWebView, /**
} as WebViewNativeConfig, * This disables the global window scroll but keeps scroll within div elements like lists and textareas.
})} * This is needed to prevent the keyboard from pushing the webview up and down when it appears and disappears.
webviewDebuggingEnabled */
/> scrollEnabled={false}
overScrollMode="never"
nativeConfig={Platform.select({
android: {
component: CustomAndroidWebView,
} as WebViewNativeConfig,
})}
webviewDebuggingEnabled
/>
</View>
) )
} }