|
@@ -1,5 +1,5 @@
|
1
|
1
|
import React from 'react';
|
2
|
|
-import { View } from 'react-native';
|
|
2
|
+import { StyleSheet, View } from 'react-native';
|
3
|
3
|
import GENERAL_STYLES from '../../constants/Styles';
|
4
|
4
|
import Urls from '../../constants/Urls';
|
5
|
5
|
import DateManager from '../../managers/DateManager';
|
|
@@ -15,6 +15,14 @@ type Props = {
|
15
|
15
|
onMessage: (event: { nativeEvent: { data: string } }) => void;
|
16
|
16
|
};
|
17
|
17
|
|
|
18
|
+const styles = StyleSheet.create({
|
|
19
|
+ error: {
|
|
20
|
+ position: 'absolute',
|
|
21
|
+ height: '100%',
|
|
22
|
+ width: '100%',
|
|
23
|
+ },
|
|
24
|
+});
|
|
25
|
+
|
18
|
26
|
// Watch for changes in the calendar and call the remove alpha function to prevent invisible events
|
19
|
27
|
const OBSERVE_MUTATIONS_INJECTED =
|
20
|
28
|
'function removeAlpha(node) {\n' +
|
|
@@ -99,19 +107,21 @@ const generateInjectedJS = (group: PlanexGroupType | undefined) => {
|
99
|
107
|
function PlanexWebview(props: Props) {
|
100
|
108
|
return (
|
101
|
109
|
<View style={GENERAL_STYLES.flex}>
|
102
|
|
- {!props.currentGroup ? (
|
103
|
|
- <ErrorView
|
104
|
|
- icon={'account-clock'}
|
105
|
|
- message={i18n.t('screens.planex.noGroupSelected')}
|
106
|
|
- />
|
107
|
|
- ) : null}
|
108
|
110
|
<WebViewScreen
|
109
|
111
|
url={Urls.planex.planning}
|
110
|
112
|
initialJS={generateInjectedJS(props.currentGroup)}
|
111
|
113
|
injectJS={props.injectJS}
|
112
|
114
|
onMessage={props.onMessage}
|
113
|
115
|
showAdvancedControls={false}
|
|
116
|
+ showControls={props.currentGroup !== undefined}
|
114
|
117
|
/>
|
|
118
|
+ {!props.currentGroup ? (
|
|
119
|
+ <ErrorView
|
|
120
|
+ icon={'account-clock'}
|
|
121
|
+ message={i18n.t('screens.planex.noGroupSelected')}
|
|
122
|
+ style={styles.error}
|
|
123
|
+ />
|
|
124
|
+ ) : null}
|
115
|
125
|
</View>
|
116
|
126
|
);
|
117
|
127
|
}
|