|
|
|
@ -1,24 +1,27 @@
|
|
|
|
|
import React from 'react';
|
|
|
|
|
import {StyleSheet,Pressable, Text, View, Image} from 'react-native';
|
|
|
|
|
import Separator from '../components/Separator';
|
|
|
|
|
import plus from '../assets/images/plus.png';
|
|
|
|
|
import moins from '../assets/images/minus.png';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface foodElementImageProps {
|
|
|
|
|
source : string
|
|
|
|
|
source : string | null
|
|
|
|
|
title : string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const componentHeight = 60;
|
|
|
|
|
const componentWidth = 280;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default function FoodElementText(props : any) {
|
|
|
|
|
const isTextOverflowing = props.title.length * 10 > 260;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Pressable style={styles.button}>
|
|
|
|
|
<View style={styles.container}>
|
|
|
|
|
<View style={styles.view}>
|
|
|
|
|
<Text style={styles.text}>{props.title}</Text>
|
|
|
|
|
<Separator/>
|
|
|
|
|
{!isTextOverflowing && <Separator />}
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</Pressable>
|
|
|
|
@ -26,11 +29,13 @@ export default function FoodElementText(props : any) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
button: {
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
justifyContent: 'center',
|
|
|
|
|
width : 270,
|
|
|
|
|
height: 60,
|
|
|
|
|
width : componentWidth,
|
|
|
|
|
minHeight: componentHeight,
|
|
|
|
|
borderRadius: 5,
|
|
|
|
|
elevation: 3,
|
|
|
|
|
backgroundColor: '#E3DEC9',
|
|
|
|
@ -40,8 +45,9 @@ const styles = StyleSheet.create({
|
|
|
|
|
lineHeight: 21,
|
|
|
|
|
fontWeight: 'bold',
|
|
|
|
|
letterSpacing: 0.25,
|
|
|
|
|
padding : 7,
|
|
|
|
|
padding: 7,
|
|
|
|
|
color: 'black',
|
|
|
|
|
width: 250,
|
|
|
|
|
},
|
|
|
|
|
view: {
|
|
|
|
|
alignItems: 'flex-start',
|
|
|
|
@ -49,8 +55,8 @@ const styles = StyleSheet.create({
|
|
|
|
|
marginRight: 5 // Centre le contenu horizontalement
|
|
|
|
|
},
|
|
|
|
|
container: {
|
|
|
|
|
width :260,
|
|
|
|
|
height: 50,
|
|
|
|
|
width : componentWidth - 10,
|
|
|
|
|
minHeight : componentHeight - 10,
|
|
|
|
|
borderRadius: 5,
|
|
|
|
|
elevation: 3,
|
|
|
|
|
borderWidth: 2,
|
|
|
|
|