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.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // @flow
  2. import * as React from 'react';
  3. import ThemeManager from "../utils/ThemeManager";
  4. import WebViewScreen from "../components/WebViewScreen";
  5. type Props = {
  6. navigation: Object,
  7. }
  8. const PLANEX_URL = 'http://planex.insa-toulouse.fr/';
  9. const CUSTOM_CSS_GENERAL = 'https://srv-falcon.etud.insa-toulouse.fr/~amicale_app/custom_css/planex/customMobile.css';
  10. const CUSTOM_CSS_NIGHTMODE = 'https://srv-falcon.etud.insa-toulouse.fr/~amicale_app/custom_css/planex/customDark.css';
  11. /**
  12. * Class defining the app's planex screen.
  13. * This screen uses a webview to render the planex page
  14. */
  15. export default class PlanexScreen extends React.Component<Props> {
  16. customInjectedJS: string;
  17. constructor() {
  18. super();
  19. this.customInjectedJS =
  20. 'document.querySelector(\'head\').innerHTML += \'<meta name="viewport" content="width=device-width, initial-scale=1.0">\';' +
  21. 'document.querySelector(\'head\').innerHTML += \'<link rel="stylesheet" href="' + CUSTOM_CSS_GENERAL + '" type="text/css"/>\';';
  22. if (ThemeManager.getNightMode())
  23. this.customInjectedJS += 'document.querySelector(\'head\').innerHTML += \'<link rel="stylesheet" href="' + CUSTOM_CSS_NIGHTMODE + '" type="text/css"/>\';';
  24. }
  25. render() {
  26. const nav = this.props.navigation;
  27. return (
  28. <WebViewScreen
  29. navigation={nav}
  30. data={[
  31. {
  32. url: PLANEX_URL,
  33. icon: '',
  34. name: '',
  35. customJS: this.customInjectedJS
  36. },
  37. ]}
  38. customInjectedJS={this.customInjectedJS}
  39. headerTitle={'Planex'}
  40. hasHeaderBackButton={false}
  41. hasFooter={false}/>
  42. );
  43. }
  44. }