// @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, } type State = { isFinishedLoading: boolean } // const PLANEX_URL = 'http://planex.insa-toulouse.fr/'; // TODO use real url in prod const PLANEX_URL = 'https://srv-falcon.etud.insa-toulouse.fr/~vergnet/planex/planex.insa-toulouse.fr.html'; /** * Class defining the app's planex screen. * This screen uses a webview to render the planex page */ export default class PlanningScreen extends React.Component { state = { isFinishedLoading: false, }; webview: WebView; getRefreshButton() { return ( this.refreshWebview()}> ); }; refreshWebview() { this.setState({isFinishedLoading: false}); this.webview.reload(); } render() { const nav = this.props.navigation; return ( (this.webview = ref)} source={{uri: PLANEX_URL}} style={{ width: '100%', height: '100%', }} startInLoadingState={true} renderLoading={() => } /> ); } }