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.

CardListItem.js 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // @flow
  2. import * as React from 'react';
  3. import {Caption, Card, Paragraph, TouchableRipple} from 'react-native-paper';
  4. import {View} from 'react-native';
  5. import type {ServiceItemType} from '../../../managers/ServicesManager';
  6. type PropsType = {
  7. item: ServiceItemType,
  8. };
  9. export default class CardListItem extends React.Component<PropsType> {
  10. shouldComponentUpdate(): boolean {
  11. return false;
  12. }
  13. render(): React.Node {
  14. const {props} = this;
  15. const {item} = props;
  16. const source =
  17. typeof item.image === 'number' ? item.image : {uri: item.image};
  18. return (
  19. <Card
  20. style={{
  21. width: '40%',
  22. margin: 5,
  23. marginLeft: 'auto',
  24. marginRight: 'auto',
  25. }}>
  26. <TouchableRipple style={{flex: 1}} onPress={item.onPress}>
  27. <View>
  28. <Card.Cover style={{height: 80}} source={source} />
  29. <Card.Content>
  30. <Paragraph>{item.title}</Paragraph>
  31. <Caption>{item.subtitle}</Caption>
  32. </Card.Content>
  33. </View>
  34. </TouchableRipple>
  35. </Card>
  36. );
  37. }
  38. }