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.

ProximoListItem.js 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // @flow
  2. import * as React from 'react';
  3. import {Avatar, List, Text, withTheme} from 'react-native-paper';
  4. import i18n from 'i18n-js';
  5. import type {ProximoArticleType} from '../../../screens/Services/Proximo/ProximoMainScreen';
  6. type PropsType = {
  7. onPress: () => void,
  8. color: string,
  9. item: ProximoArticleType,
  10. height: number,
  11. };
  12. class ProximoListItem extends React.Component<PropsType> {
  13. shouldComponentUpdate(): boolean {
  14. return false;
  15. }
  16. render(): React.Node {
  17. const {props} = this;
  18. return (
  19. <List.Item
  20. title={props.item.name}
  21. description={`${props.item.quantity} ${i18n.t(
  22. 'screens.proximo.inStock',
  23. )}`}
  24. descriptionStyle={{color: props.color}}
  25. onPress={props.onPress}
  26. left={(): React.Node => (
  27. <Avatar.Image
  28. style={{backgroundColor: 'transparent'}}
  29. size={64}
  30. source={{uri: props.item.image}}
  31. />
  32. )}
  33. right={(): React.Node => (
  34. <Text style={{fontWeight: 'bold'}}>{props.item.price}€</Text>
  35. )}
  36. style={{
  37. height: props.height,
  38. justifyContent: 'center',
  39. }}
  40. />
  41. );
  42. }
  43. }
  44. export default withTheme(ProximoListItem);