diff --git a/src/components/Screens/ErrorView.tsx b/src/components/Screens/ErrorView.tsx index c21b77a..e0377cd 100644 --- a/src/components/Screens/ErrorView.tsx +++ b/src/components/Screens/ErrorView.tsx @@ -19,7 +19,7 @@ import * as React from 'react'; import { Button, Subheading, useTheme } from 'react-native-paper'; -import { StyleSheet, View } from 'react-native'; +import { StyleSheet, View, ViewStyle } from 'react-native'; import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'; import i18n from 'i18n-js'; import * as Animatable from 'react-native-animatable'; @@ -36,6 +36,7 @@ type Props = { icon: string; onPress: () => void; }; + style?: ViewStyle; }; const styles = StyleSheet.create({ @@ -147,7 +148,7 @@ function ErrorView(props: Props) { const { button } = props; return ( - + void; }; +const styles = StyleSheet.create({ + error: { + position: 'absolute', + height: '100%', + width: '100%', + }, +}); + // Watch for changes in the calendar and call the remove alpha function to prevent invisible events const OBSERVE_MUTATIONS_INJECTED = 'function removeAlpha(node) {\n' + @@ -99,19 +107,21 @@ const generateInjectedJS = (group: PlanexGroupType | undefined) => { function PlanexWebview(props: Props) { return ( - {!props.currentGroup ? ( - - ) : null} + {!props.currentGroup ? ( + + ) : null} ); } diff --git a/src/components/Screens/WebViewScreen.tsx b/src/components/Screens/WebViewScreen.tsx index 04e3a83..84dd7fb 100644 --- a/src/components/Screens/WebViewScreen.tsx +++ b/src/components/Screens/WebViewScreen.tsx @@ -57,6 +57,7 @@ type Props = { injectJS?: string; customPaddingFunction?: null | ((padding: number) => string); showAdvancedControls?: boolean; + showControls?: boolean; }; const AnimatedWebView = Animated.createAnimatedComponent(WebView); @@ -110,13 +111,20 @@ function WebViewScreen(props: Props) { ); useLayoutEffect(() => { - navigation.setOptions({ - headerRight: props.showAdvancedControls - ? getAdvancedButtons - : getBasicButton, - }); + if (props.showControls !== false) { + navigation.setOptions({ + headerRight: props.showAdvancedControls + ? getAdvancedButtons + : getBasicButton, + }); + } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [navigation, props.showAdvancedControls, navState?.url]); + }, [ + navigation, + props.showAdvancedControls, + navState?.url, + props.showControls, + ]); useEffect(() => { if (props.injectJS && props.injectJS !== currentInjectedJS) {