Fix Merge Issue
continuous-integration/drone/push Build is passing Details

pull/23/head
Louison PARANT 1 year ago
parent 1efbac082f
commit dfcf2a646f

@ -13,7 +13,7 @@ import Profil from '../Models/Profil';
import { PaperProvider, Portal } from 'react-native-paper'; import { PaperProvider, Portal } from 'react-native-paper';
export default function Profiles({navigation, props}) { export default function Profiles({navigation, props}) {
const { colors } = useContext(ColorContext) const { colors, toggleColors } = useContext(ColorContext)
const all = [] const all = []
const die = [{value: "Dairy free"}, {value: "Gluten free"}, {value: "Porkless"}, {value: "Vegan"}, {value: "Vegetarian"}, {value: "Pescatarian"}] const die = [{value: "Dairy free"}, {value: "Gluten free"}, {value: "Porkless"}, {value: "Vegan"}, {value: "Vegetarian"}, {value: "Pescatarian"}]
@ -85,7 +85,8 @@ export default function Profiles({navigation, props}) {
width: "100%", width: "100%",
}; };
const styles = StyleSheet.create({
const styles = StyleSheet.create({
container: { container: {
height: "100%", height: "100%",
width: "100%", width: "100%",
@ -105,7 +106,7 @@ export default function Profiles({navigation, props}) {
separator: { separator: {
marginTop: "6%" marginTop: "6%"
}, },
modal: { modal: {
position: 'absolute', position: 'absolute',
top: '0%', top: '0%',
@ -121,7 +122,7 @@ export default function Profiles({navigation, props}) {
width: "100%", width: "100%",
flex: 1, flex: 1,
}, },
profileValidation: { profileValidation: {
width: "100%", width: "100%",
alignItems: "center", alignItems: "center",
@ -199,29 +200,18 @@ export default function Profiles({navigation, props}) {
const profileComponents = profiles.map((profile, index) => ( const profileComponents = profiles.map((profile, index) => (
<View key={index}> <View key={index}>
<ProfileDetails <ProfileDetails
name={profile.name} name={profile.name}
avatar={profile.avatar} avatar={profile.avatar}
diets={profile.diets} diets={profile.diets}
allergies={profile.allergies} allergies={profile.allergies}
onModification={() => navigation.navigate('ProfileModification')} onDeleteProfile={() => raisePopUp(index)}
onDeleteProfile={raisePopUp}/> />
{index < profiles.length - 1 && <View style={styles.separator}/>} <Portal>
</View> <Modal visible={visible} onDismiss={erasePopUp} contentContainerStyle={containerStyle} style={{marginTop: 0, justifyContent: "flex-start"}}>
));
return (
<SafeAreaProvider style={{flex: 1}}>
<ScrollView>
<View style={{opacity: opacity, height: "100%", width: "100%", flex: 1}}>
<LinearGradient colors={[colors.primary, colors.primaryComplement]} style={[styles.linearGradient, {minHeight: useWindowDimensions().height}]}>
<View style={styles.separator}/>
{profileComponents}
<View style={styles.modal}> <View style={styles.modal}>
<Modal visible={visible} onRequestClose={erasePopUp} animationType="fade" transparent={true}> <View style={styles.viewModal}>
<View style={styles.modal}> <View style={styles.profileValidation}>
<View style={styles.viewModal}> {/* <ProfileDelete
<View style={styles.profileValidation}>
<ProfileDelete
name={profiles[selectedProfileIndex].name} name={profiles[selectedProfileIndex].name}
avatar={profiles[selectedProfileIndex].avatar} avatar={profiles[selectedProfileIndex].avatar}
diets={profiles[selectedProfileIndex].diets} diets={profiles[selectedProfileIndex].diets}
@ -269,4 +259,4 @@ export default function Profiles({navigation, props}) {
</PaperProvider> </PaperProvider>
</SafeAreaProvider> </SafeAreaProvider>
); );
} }

@ -8,13 +8,19 @@ import Recipes from '../Models/Recipes';
import { LinearGradient } from 'expo-linear-gradient'; import { LinearGradient } from 'expo-linear-gradient';
import ListWithoutSelect from '../components/ListWithoutSelect'; import ListWithoutSelect from '../components/ListWithoutSelect';
import ColorContext from '../theme/ColorContext'; import ColorContext from '../theme/ColorContext';
import Ingredient from '../Models/Ingredient';
export default function RecipeDetails(props) { export default function RecipeDetails(props) {
const {colors} = useContext(ColorContext); const {colors} = useContext(ColorContext);
const [isLoading, setIsLoading] = useState(true) const [isLoading, setIsLoading] = useState(true)
const [response, setResponse] = useState<Recipes>();
const ingredientList = [new Ingredient(3, "Carrot"), new Ingredient(4, "Potato"), new Ingredient(5, "Peach")]
const [response, setResponse] = useState<Recipes>(new Recipes (120, "Carrot", "Delicious", 90, ["Fork", "Fish", "Knife"], ingredientList))
const recipesService = new RecipesService(); const recipesService = new RecipesService();
const loadRecipe = async () => { const loadRecipe = async () => {
@ -35,9 +41,6 @@ export default function RecipeDetails(props) {
loadRecipe(); loadRecipe();
}, []); }, []);
loadRecipe()
console.log("Response.name: " + response.name)
function convertToHoursMinutes(totalMinutes: number): string { function convertToHoursMinutes(totalMinutes: number): string {
const hours = Math.floor(totalMinutes / 60); const hours = Math.floor(totalMinutes / 60);
const minutes = totalMinutes % 60; const minutes = totalMinutes % 60;

Loading…
Cancel
Save