improve proximo list item
This commit is contained in:
parent
aefeb8373a
commit
f6f1a5519e
1 changed files with 9 additions and 1 deletions
|
@ -23,6 +23,7 @@ import i18n from 'i18n-js';
|
||||||
import type { ProximoArticleType } from '../../../screens/Services/Proximo/ProximoMainScreen';
|
import type { ProximoArticleType } from '../../../screens/Services/Proximo/ProximoMainScreen';
|
||||||
import { StyleSheet } from 'react-native';
|
import { StyleSheet } from 'react-native';
|
||||||
import Urls from '../../../constants/Urls';
|
import Urls from '../../../constants/Urls';
|
||||||
|
import GENERAL_STYLES from '../../../constants/Styles';
|
||||||
|
|
||||||
type PropsType = {
|
type PropsType = {
|
||||||
onPress: () => void;
|
onPress: () => void;
|
||||||
|
@ -34,9 +35,13 @@ type PropsType = {
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
avatar: {
|
avatar: {
|
||||||
backgroundColor: 'transparent',
|
backgroundColor: 'transparent',
|
||||||
|
marginRight: 5,
|
||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
|
marginLeft: 10,
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
|
fontSize: 15,
|
||||||
|
...GENERAL_STYLES.centerVertical,
|
||||||
},
|
},
|
||||||
item: {
|
item: {
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
|
@ -47,6 +52,7 @@ function ProximoListItem(props: PropsType) {
|
||||||
return (
|
return (
|
||||||
<List.Item
|
<List.Item
|
||||||
title={props.item.name}
|
title={props.item.name}
|
||||||
|
titleNumberOfLines={2}
|
||||||
description={`${props.item.quantity} ${i18n.t(
|
description={`${props.item.quantity} ${i18n.t(
|
||||||
'screens.proximo.inStock'
|
'screens.proximo.inStock'
|
||||||
)}`}
|
)}`}
|
||||||
|
@ -59,7 +65,9 @@ function ProximoListItem(props: PropsType) {
|
||||||
source={{ uri: Urls.proximo.images + props.item.image }}
|
source={{ uri: Urls.proximo.images + props.item.image }}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
right={() => <Text style={styles.text}>{props.item.price}€</Text>}
|
right={() => (
|
||||||
|
<Text style={styles.text}>{props.item.price.toFixed(2)}€</Text>
|
||||||
|
)}
|
||||||
style={{
|
style={{
|
||||||
height: props.height,
|
height: props.height,
|
||||||
...styles.item,
|
...styles.item,
|
||||||
|
|
Loading…
Reference in a new issue