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.

FeedItem.js 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import * as React from 'react';
  2. import {Avatar, Button, Card, withTheme} from 'react-native-paper';
  3. import {TouchableOpacity, View} from "react-native";
  4. import Autolink from "react-native-autolink";
  5. import i18n from "i18n-js";
  6. const ICON_AMICALE = require('../../assets/amicale.png');
  7. /**
  8. * Gets the amicale INSAT logo
  9. *
  10. * @return {*}
  11. */
  12. function getAvatar() {
  13. return (
  14. <Avatar.Image size={48} source={ICON_AMICALE}
  15. style={{backgroundColor: 'transparent'}}/>
  16. );
  17. }
  18. /**
  19. * Component used to display a feed item
  20. *
  21. * @param props Props to pass to the component
  22. * @return {*}
  23. */
  24. function FeedItem(props) {
  25. const {colors} = props.theme;
  26. return (
  27. <Card style={{margin: 10}}>
  28. <Card.Title
  29. title={props.title}
  30. subtitle={props.subtitle}
  31. left={getAvatar}
  32. />
  33. {props.full_picture !== '' && props.full_picture !== undefined ?
  34. <TouchableOpacity onPress={props.onImagePress}>
  35. <Card.Cover source={{uri: props.full_picture}}/>
  36. </TouchableOpacity> : <View/>}
  37. <Card.Content>
  38. {props.message !== undefined ?
  39. <Autolink
  40. text={props.message}
  41. hashtag="facebook"
  42. style={{color: colors.text}}
  43. /> : <View/>
  44. }
  45. </Card.Content>
  46. <Card.Actions>
  47. <Button
  48. color={'#57aeff'}
  49. onPress={props.onOutLinkPress}
  50. icon={'facebook'}>
  51. {i18n.t('homeScreen.dashboard.seeMore')}
  52. </Button>
  53. </Card.Actions>
  54. </Card>
  55. );
  56. }
  57. export default withTheme(FeedItem);