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';
export default function Profiles({navigation, props}) {
const { colors } = useContext(ColorContext)
const { colors, toggleColors } = useContext(ColorContext)
const all = []
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%",
};
const styles = StyleSheet.create({
const styles = StyleSheet.create({
container: {
height: "100%",
width: "100%",
@ -105,7 +106,7 @@ export default function Profiles({navigation, props}) {
separator: {
marginTop: "6%"
},
modal: {
position: 'absolute',
top: '0%',
@ -121,7 +122,7 @@ export default function Profiles({navigation, props}) {
width: "100%",
flex: 1,
},
profileValidation: {
width: "100%",
alignItems: "center",
@ -199,29 +200,18 @@ export default function Profiles({navigation, props}) {
const profileComponents = profiles.map((profile, index) => (
<View key={index}>
<ProfileDetails
name={profile.name}
avatar={profile.avatar}
diets={profile.diets}
allergies={profile.allergies}
onModification={() => navigation.navigate('ProfileModification')}
onDeleteProfile={raisePopUp}/>
{index < profiles.length - 1 && <View style={styles.separator}/>}
</View>
));
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}
name={profile.name}
avatar={profile.avatar}
diets={profile.diets}
allergies={profile.allergies}
onDeleteProfile={() => raisePopUp(index)}
/>
<Portal>
<Modal visible={visible} onDismiss={erasePopUp} contentContainerStyle={containerStyle} style={{marginTop: 0, justifyContent: "flex-start"}}>
<View style={styles.modal}>
<Modal visible={visible} onRequestClose={erasePopUp} animationType="fade" transparent={true}>
<View style={styles.modal}>
<View style={styles.viewModal}>
<View style={styles.profileValidation}>
<ProfileDelete
<View style={styles.viewModal}>
<View style={styles.profileValidation}>
{/* <ProfileDelete
name={profiles[selectedProfileIndex].name}
avatar={profiles[selectedProfileIndex].avatar}
diets={profiles[selectedProfileIndex].diets}
@ -269,4 +259,4 @@ export default function Profiles({navigation, props}) {
</PaperProvider>
</SafeAreaProvider>
);
}
}

@ -8,13 +8,19 @@ import Recipes from '../Models/Recipes';
import { LinearGradient } from 'expo-linear-gradient';
import ListWithoutSelect from '../components/ListWithoutSelect';
import ColorContext from '../theme/ColorContext';
import Ingredient from '../Models/Ingredient';
export default function RecipeDetails(props) {
const {colors} = useContext(ColorContext);
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 loadRecipe = async () => {
@ -35,9 +41,6 @@ export default function RecipeDetails(props) {
loadRecipe();
}, []);
loadRecipe()
console.log("Response.name: " + response.name)
function convertToHoursMinutes(totalMinutes: number): string {
const hours = Math.floor(totalMinutes / 60);
const minutes = totalMinutes % 60;

Loading…
Cancel
Save