Merge pull request 'add component for ingredient, the back end is not complete' (#5) from WORK-RHA into master
Reviewed-on: #5pull/9/head
commit
b6d223f13d
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.6 KiB |
@ -0,0 +1,58 @@
|
|||||||
|
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';
|
||||||
|
|
||||||
|
export default function FoodElementText(props) {
|
||||||
|
return (
|
||||||
|
<Pressable style={styles.button}>
|
||||||
|
<View style={styles.container}>
|
||||||
|
<View style={styles.view}>
|
||||||
|
<Text style={styles.text}>{props.title}</Text>
|
||||||
|
<Separator/>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
<Image source={plus} style={{width: 40, height: 40}}/>
|
||||||
|
</View>
|
||||||
|
</Pressable>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
button: {
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
width : 350,
|
||||||
|
height: 60,
|
||||||
|
borderRadius: 5,
|
||||||
|
elevation: 3,
|
||||||
|
backgroundColor: '#ACA279',
|
||||||
|
},
|
||||||
|
text: {
|
||||||
|
fontSize: 15,
|
||||||
|
lineHeight: 21,
|
||||||
|
fontWeight: 'bold',
|
||||||
|
letterSpacing: 0.25,
|
||||||
|
padding : 7,
|
||||||
|
color: 'black',
|
||||||
|
},
|
||||||
|
view: {
|
||||||
|
|
||||||
|
alignItems: 'flex-start',
|
||||||
|
justifyContent: 'center',
|
||||||
|
marginRight: 5 // Centre le contenu horizontalement
|
||||||
|
},
|
||||||
|
container: {
|
||||||
|
width : 340,
|
||||||
|
height: 50,
|
||||||
|
borderRadius: 5,
|
||||||
|
elevation: 3,
|
||||||
|
borderWidth: 2,
|
||||||
|
borderColor: 'black',
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import {StyleSheet, View} from 'react-native';
|
||||||
|
|
||||||
|
export default function Separator (){
|
||||||
|
return <View style={styles.separator} />;
|
||||||
|
};
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
separator: {
|
||||||
|
width: 250, // Largeur de la ligne
|
||||||
|
backgroundColor: 'black', // Couleur de la ligne
|
||||||
|
borderWidth : 1,
|
||||||
|
marginLeft : 10,
|
||||||
|
marginRight : 10,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in new issue