diff --git a/screens/PlanexScreen.js b/screens/PlanexScreen.js index 5fadda9..1fbf064 100644 --- a/screens/PlanexScreen.js +++ b/screens/PlanexScreen.js @@ -1,10 +1,13 @@ // @flow import * as React from 'react'; -import {View} from 'react-native'; -import {Container, Content, Spinner} from 'native-base'; +import {Platform, View} from 'react-native'; +import {Container, Right, Spinner} from 'native-base'; import CustomHeader from "../components/CustomHeader"; import WebView from "react-native-webview"; +import Touchable from "react-native-platform-touchable"; +import CustomMaterialIcon from "../components/CustomMaterialIcon"; +import ThemeManager from "../utils/ThemeManager"; type Props = { navigation: Object, @@ -26,23 +29,53 @@ export default class PlanningScreen extends React.Component { 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: this.state.isFinishedLoading ? '100%' : 0}} - onLoadEnd={() => { - this.setState({isFinishedLoading: true}) + style={{ + width: '100%', + height: '100%', }} + startInLoadingState={true} + renderLoading={() => + + + + } /> - {this.state.isFinishedLoading ? - : - - - } ); }