Application Android et IOS pour l'amicale des élèves https://play.google.com/store/apps/details?id=fr.amicaleinsat.application
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.

PlanningDisplayScreen.js 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // @flow
  2. import * as React from 'react';
  3. import {Image} from 'react-native';
  4. import {Container, Content, H1, H3, View} from 'native-base';
  5. import ThemeManager from "../utils/ThemeManager";
  6. import HTML from "react-native-render-html";
  7. import {Linking} from "expo";
  8. import PlanningEventManager from '../utils/PlanningEventManager';
  9. type Props = {
  10. navigation: Object,
  11. route: Object
  12. };
  13. function openWebLink(event, link) {
  14. Linking.openURL(link).catch((err) => console.error('Error opening link', err));
  15. }
  16. /**
  17. * Class defining an about screen. This screen shows the user information about the app and it's author.
  18. */
  19. export default class PlanningDisplayScreen extends React.Component<Props> {
  20. displayData = this.props.route.params['data'];
  21. render() {
  22. // console.log("rendering planningDisplayScreen");
  23. return (
  24. <Container>
  25. <Content padder>
  26. <H1>
  27. {this.displayData.title}
  28. </H1>
  29. <H3 style={{
  30. marginTop: 10,
  31. color: ThemeManager.getCurrentThemeVariables().listNoteColor
  32. }}>
  33. {PlanningEventManager.getFormattedTime(this.displayData)}
  34. </H3>
  35. {this.displayData.logo !== null ?
  36. <View style={{width: '100%', height: 300, marginTop: 20, marginBottom: 20}}>
  37. <Image style={{flex: 1, resizeMode: "contain"}}
  38. source={{uri: this.displayData.logo}}/>
  39. </View>
  40. : <View/>}
  41. {this.displayData.description !== null ?
  42. // Surround description with div to allow text styling if the description is not html
  43. <HTML html={"<div>" + this.displayData.description + "</div>"}
  44. tagsStyles={{
  45. p: {
  46. color: ThemeManager.getCurrentThemeVariables().textColor,
  47. fontSize: ThemeManager.getCurrentThemeVariables().fontSizeBase
  48. },
  49. div: {color: ThemeManager.getCurrentThemeVariables().textColor}
  50. }}
  51. onLinkPress={openWebLink}/>
  52. : <View/>}
  53. </Content>
  54. </Container>
  55. );
  56. }
  57. }