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.

FeedItem.js 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import * as React from 'react';
  2. import {Avatar, Button, Card, Text, withTheme} from 'react-native-paper';
  3. import {View} from "react-native";
  4. import Autolink from "react-native-autolink";
  5. import i18n from "i18n-js";
  6. import ImageModal from 'react-native-image-modal';
  7. const ICON_AMICALE = require('../../../assets/amicale.png');
  8. /**
  9. * Component used to display a feed item
  10. */
  11. class FeedItem extends React.Component {
  12. shouldComponentUpdate() {
  13. return false;
  14. }
  15. /**
  16. * Gets the amicale INSAT logo
  17. *
  18. * @return {*}
  19. */
  20. getAvatar() {
  21. return (
  22. <Avatar.Image size={48} source={ICON_AMICALE}
  23. style={{backgroundColor: 'transparent'}}/>
  24. );
  25. }
  26. render() {
  27. return (
  28. <Card style={{margin: 10}}>
  29. <Card.Title
  30. title={this.props.title}
  31. subtitle={this.props.subtitle}
  32. left={this.getAvatar}
  33. />
  34. {this.props.full_picture !== '' && this.props.full_picture !== undefined ?
  35. <View style={{marginLeft: 'auto', marginRight: 'auto'}}>
  36. <ImageModal
  37. resizeMode="contain"
  38. imageBackgroundColor={"#000"}
  39. style={{
  40. width: 250,
  41. height: 250,
  42. }}
  43. source={{
  44. uri: this.props.full_picture,
  45. }}
  46. /></View> : <View/>}
  47. <Card.Content>
  48. {this.props.message !== undefined ?
  49. <Autolink
  50. text={this.props.message}
  51. hashtag="facebook"
  52. component={Text}
  53. /> : <View/>
  54. }
  55. </Card.Content>
  56. <Card.Actions>
  57. <Button
  58. color={'#57aeff'}
  59. onPress={this.props.onOutLinkPress}
  60. icon={'facebook'}>
  61. {i18n.t('homeScreen.dashboard.seeMore')}
  62. </Button>
  63. </Card.Actions>
  64. </Card>
  65. );
  66. }
  67. }
  68. export default withTheme(FeedItem);