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.3KB

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. type Props = {
  6. onPress: Function,
  7. color: string,
  8. item: Object,
  9. height: number,
  10. }
  11. class ProximoListItem extends React.Component<Props> {
  12. colors: Object;
  13. constructor(props) {
  14. super(props);
  15. this.colors = props.theme.colors;
  16. }
  17. shouldComponentUpdate() {
  18. return false;
  19. }
  20. render() {
  21. return (
  22. <List.Item
  23. title={this.props.item.name}
  24. description={this.props.item.quantity + ' ' + i18n.t('proximoScreen.inStock')}
  25. descriptionStyle={{color: this.props.color}}
  26. onPress={this.props.onPress}
  27. left={() => <Avatar.Image style={{backgroundColor: 'transparent'}} size={64}
  28. source={{uri: this.props.item.image}}/>}
  29. right={() =>
  30. <Text style={{fontWeight: "bold"}}>
  31. {this.props.item.price}€
  32. </Text>}
  33. style={{
  34. height: this.props.height,
  35. justifyContent: 'center',
  36. }}
  37. />
  38. );
  39. }
  40. }
  41. export default withTheme(ProximoListItem);