// @flow import * as React from 'react'; import {Platform, View} from 'react-native'; import {Spinner} from 'native-base'; import WebView from "react-native-webview"; import Touchable from "react-native-platform-touchable"; import CustomMaterialIcon from "../components/CustomMaterialIcon"; import ThemeManager from "../utils/ThemeManager"; import BaseContainer from "../components/BaseContainer"; type Props = { navigation: Object, } const PLANEX_URL = 'http://planex.insa-toulouse.fr/'; const CUSTOM_CSS_GENERAL = 'https://srv-falcon.etud.insa-toulouse.fr/~amicale_app/custom_css/planex/customMobile.css'; const CUSTOM_CSS_NIGHTMODE = 'https://srv-falcon.etud.insa-toulouse.fr/~amicale_app/custom_css/planex/customDark.css'; /** * Class defining the app's planex screen. * This screen uses a webview to render the planex page */ export default class PlanningScreen extends React.Component { webview: WebView; customInjectedJS: string; constructor() { super(); this.customInjectedJS = 'document.querySelector(\'head\').innerHTML += \'\';' + 'document.querySelector(\'head\').innerHTML += \'\';'; if (ThemeManager.getNightMode()) this.customInjectedJS += 'document.querySelector(\'head\').innerHTML += \'\';'; } getRefreshButton() { return ( this.refreshWebview()}> ); }; refreshWebview() { this.webview.reload(); } render() { const nav = this.props.navigation; return ( (this.webview = ref)} source={{uri: PLANEX_URL}} style={{ width: '100%', height: '100%', }} startInLoadingState={true} injectedJavaScript={this.customInjectedJS} javaScriptEnabled={true} renderLoading={() => } /> ); } }