Application Android et IOS pour l'amicale des élèves
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PlanexScreen.js 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // @flow
  2. import * as React from 'react';
  3. import {View} from 'react-native';
  4. import {Container, Content, Spinner} from 'native-base';
  5. import CustomHeader from "../components/CustomHeader";
  6. import WebView from "react-native-webview";
  7. type Props = {
  8. navigation: Object,
  9. }
  10. type State = {
  11. isFinishedLoading: boolean
  12. }
  13. const PLANEX_URL = 'http://planex.insa-toulouse.fr/';
  14. /**
  15. * Class defining the app's planex screen.
  16. * This screen uses a webview to render the planex page
  17. */
  18. export default class PlanningScreen extends React.Component<Props, State> {
  19. state = {
  20. isFinishedLoading: false,
  21. };
  22. render() {
  23. const nav = this.props.navigation;
  24. return (
  25. <Container>
  26. <CustomHeader navigation={nav} title={'Planex'}/>
  27. <WebView
  28. source={{uri: PLANEX_URL}}
  29. style={{width: this.state.isFinishedLoading ? '100%' : 0}}
  30. onLoadEnd={() => {
  31. this.setState({isFinishedLoading: true})
  32. }}
  33. />
  34. {this.state.isFinishedLoading ?
  35. <View/> :
  36. <Content>
  37. <Spinner/>
  38. </Content>}
  39. </Container>
  40. );
  41. }
  42. }