Fix Views After Merge + BottomBar
continuous-integration/drone/push Build is passing Details

pull/20/head
Louison PARANT 2 years ago
parent 532784deb1
commit 9d26970575

@ -3,7 +3,7 @@ import IIngredientService from "./IIngredientService";
import axios from 'axios'; import axios from 'axios';
export default class IngredientService implements IIngredientService { export default class IngredientService implements IIngredientService {
private readonly API_URL = "http://localhost:3000/ingredients"; private readonly API_URL = "http://leftovers.alwaysdata.net/ingredients";
constructor() {} constructor() {}

@ -3,7 +3,7 @@ import IRecipesService from "./IRecipesServices";
import Recipes from "../../Models/Recipes"; import Recipes from "../../Models/Recipes";
export default class RecipesService implements IRecipesService { export default class RecipesService implements IRecipesService {
private readonly API_URL = "http://localhost:3000/recipes"; private readonly API_URL = "http://leftovers.alwaysdata.net/recipes";
constructor() {} constructor() {}

@ -47,6 +47,8 @@ export default function ProfileDetails(props) {
backgroundColor: colors.cardBackground, backgroundColor: colors.cardBackground,
padding: "3%", padding: "3%",
marginHorizontal: "3%", marginHorizontal: "3%",
borderWidth: 1,
borderColor: colors.blocBorder,
}, },
pseudoBar: { pseudoBar: {

@ -37,6 +37,8 @@ export default function ProfileModification(props: ProfileProps) {
backgroundColor: colors.cardBackground, backgroundColor: colors.cardBackground,
padding: "3%", padding: "3%",
marginHorizontal: "3%", marginHorizontal: "3%",
borderWidth: 1,
borderColor: colors.blocBorder,
}, },
pseudoBar: { pseudoBar: {
@ -51,7 +53,7 @@ export default function ProfileModification(props: ProfileProps) {
padding: "5%", padding: "5%",
resizeMode: 'contain', resizeMode: 'contain',
borderWidth: 2, borderWidth: 2,
borderColor: colors.cardTitle, borderColor: colors.cardElementBorder,
borderRadius: 45, borderRadius: 45,
height: "100%", height: "100%",
flex: 0.04, flex: 0.04,
@ -62,7 +64,7 @@ export default function ProfileModification(props: ProfileProps) {
borderRadius: 10, borderRadius: 10,
borderWidth: 2, borderWidth: 2,
borderStyle: 'dashed', borderStyle: 'dashed',
borderColor: colors.cardTitle, borderColor: colors.cardElementBorder,
alignItems: 'center', alignItems: 'center',
textAlign: 'left', textAlign: 'left',
flex: 0.8, flex: 0.8,
@ -71,7 +73,7 @@ export default function ProfileModification(props: ProfileProps) {
}, },
modify: { modify: {
height: "100%", height: "100%",
tintColor: colors.cardTitle, tintColor: colors.cardElementBorder,
resizeMode: 'contain', resizeMode: 'contain',
flex: 0.1, flex: 0.1,
marginLeft: "3%", marginLeft: "3%",
@ -87,7 +89,7 @@ export default function ProfileModification(props: ProfileProps) {
}, },
filters: { filters: {
fontSize: 20, fontSize: 20,
color: colors.cardTitle, color: colors.cardElementBorder,
flex: 1, flex: 1,
}, },
nbSelected: { nbSelected: {

@ -1,17 +1,20 @@
import React from 'react'; import React, {useContext} from 'react';
import {StyleSheet, View} from 'react-native'; import {StyleSheet, View} from 'react-native';
import ColorContext from '../theme/ColorContext';
export default function Separator (){ export default function Separator (){
return <View style={styles.separator} />; const {colors, toggleColors } = useContext(ColorContext)
};
const styles = StyleSheet.create({ const styles = StyleSheet.create({
separator: { separator: {
width: "90%", width: "90%",
backgroundColor: '#3F3C42', backgroundColor: colors.cardDetail,
borderWidth : 1, borderWidth : 1,
marginLeft : "5%", marginLeft : "5%",
marginRight : "5%", marginRight : "5%",
borderColor: colors.cardDetail,
}, },
}); });
return <View style={styles.separator} />;
};

@ -41,29 +41,26 @@ export default function BottomBar({ state, descriptors, navigation }) {
bottom: 0, bottom: 0,
right: 0, right: 0,
left: 0, left: 0,
height: 70, height: "8%",
backgroundColor: theme === 'dark' ? "#3F3C42" : "transparent" backgroundColor: theme === 'dark' ? "#3F3C42" : "transparent"
}, },
BottomBarBlurContainer: { BottomBarBlurContainer: {
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
alignContent: 'space-around', alignContent: 'space-around',
padding: 2,
borderBlockColor: theme === 'light' ? '#F2F0E4' : '#222222', borderBlockColor: theme === 'light' ? '#F2F0E4' : '#222222',
borderWidth: 3, borderWidth: 2,
borderLeftColor: theme === 'light'? '#F2F0E4' : '#222222', borderLeftColor: theme === 'light'? '#F2F0E4' : '#222222',
borderLeftWidth: 3,
borderRightColor: theme === 'light'? '#F2F0E4' : '#222222', borderRightColor: theme === 'light'? '#F2F0E4' : '#222222',
borderRightWidth: 3
}, },
BottomBarIcon: { BottomBarIcon: {
width: 35, width: 25,
height: 35 height: 25,
resizeMode: "contain",
}, },
BottomBarElementContainer: { BottomBarElementContainer: {
flexDirection: 'column', flexDirection: 'column',
alignItems: 'center', alignItems: 'center',
margin: 3
} }
}) })
@ -117,17 +114,19 @@ export default function BottomBar({ state, descriptors, navigation }) {
key={route.name} key={route.name}
> >
<Image source={icon} style={[styles.BottomBarIcon, {tintColor: isFocused ? (theme === 'light' ? '#59BDCD': '#8DB4D9'): '#F2F0E4'}]} /> <Image source={icon} style={[styles.BottomBarIcon, {tintColor: isFocused ? (theme === 'light' ? '#59BDCD': '#8DB4D9'): '#F2F0E4'}]} />
<Text style={{ color: isFocused ? '#59BDCD' : '#F2F0E4' }}> <Text style={{ color: isFocused ? colors.textBottomBarFocussed : '#F2F0E4' }}>
{label} {label}
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
); );
})} })}
<Pressable onPress={ onThemeButtonPress }> <Pressable onPress={ onThemeButtonPress } style={{paddingHorizontal: "7%"}}>
<View style={{alignItems: "center", justifyContent: "center"}}>
<Image source={iconThemeButton} style={[styles.BottomBarIcon, {tintColor: '#F2F0E4'}]} /> <Image source={iconThemeButton} style={[styles.BottomBarIcon, {tintColor: '#F2F0E4'}]} />
<Text style={{color: '#F2F0E4'}}> <Text style={{color: '#F2F0E4'}}>
{textThemeButton} {textThemeButton}
</Text> </Text>
</View>
</Pressable> </Pressable>
</BlurView> </BlurView>
</View> </View>

@ -46,7 +46,7 @@ export default function CreateProfile(props) {
<View style={{marginTop: "6%"}}/> <View style={{marginTop: "6%"}}/>
<ProfileModification name="" avatar="plus_small.png" diets={die} allergies={all}></ProfileModification> <ProfileModification name="" avatar="plus_small.png" diets={die} allergies={all}></ProfileModification>
<View style={{marginTop: "3%"}}/> <View style={{marginTop: "3%"}}/>
<ValidateButton title="Create Profile" image="plus.png" colour={colors.cardTitle} backColour={colors.cardBackground} todo={handleCreateProfile}></ValidateButton> <ValidateButton title="Create Profile" image="plus.png" colour={colors.buttonMain} backColour={colors.cardBackground} todo={handleCreateProfile}></ValidateButton>
<View style={{marginTop: "20%"}}/> <View style={{marginTop: "20%"}}/>
</LinearGradient> </LinearGradient>
</ScrollView> </ScrollView>

@ -1,4 +1,4 @@
import React from 'react'; import React, {useContext} from 'react';
import {StyleSheet, View, Text, ScrollView, useWindowDimensions} from 'react-native'; import {StyleSheet, View, Text, ScrollView, useWindowDimensions} from 'react-native';
import {LinearGradient} from 'expo-linear-gradient'; import {LinearGradient} from 'expo-linear-gradient';
import {SafeAreaProvider} from 'react-native-safe-area-context'; import {SafeAreaProvider} from 'react-native-safe-area-context';
@ -8,8 +8,10 @@ import TopBar from '../components/TopBar';
import ListSelect from '../components/ListSelect'; import ListSelect from '../components/ListSelect';
import ListWithoutSelect from '../components/ListWithoutSelect'; import ListWithoutSelect from '../components/ListWithoutSelect';
import ProfileSelection from '../components/ProfileSelection'; import ProfileSelection from '../components/ProfileSelection';
import ColorContext from '../theme/ColorContext';
export default function FiltersSelection(props) { export default function FiltersSelection(props) {
const {colors, toggleColors} = useContext(ColorContext);
const profiles = [ const profiles = [
{name: "Johnny Silverhand", avatar: "plus_small.png", isActive: "flex"}, {name: "Johnny Silverhand", avatar: "plus_small.png", isActive: "flex"},
{name: "Panam Palmer", avatar: "plus_small.png", isActive: "none"}, {name: "Panam Palmer", avatar: "plus_small.png", isActive: "none"},
@ -41,53 +43,7 @@ export default function FiltersSelection(props) {
const dieAdd = die.filter(isInProfileDiets); const dieAdd = die.filter(isInProfileDiets);
const allAdd = [] const allAdd = []
return ( const styles = StyleSheet.create({
<SafeAreaProvider style={{flex: 1}}>
<TopBar title="Filters Selection" isVisible="true"/>
<ScrollView>
<LinearGradient colors={['#2680AA', '#59BDCD']} style={[styles.linearGradient, {minHeight: useWindowDimensions().height}]}>
<View style={{marginTop: "6%"}}/>
<View style={styles.profilesSelection}>
<View style={styles.filterBar}>
<Text style={styles.filters}>Profiles</Text>
<Text style={styles.nbSelected}>{cptActive} selected, 1 waiting</Text>
</View>
<View style={{marginTop: "3%"}}/>
<ProfileSelection listProfile={profiles} disableSelection={false}/>
<View style={{marginTop: "4%"}}/>
<ValidateButton title="Change Selected Profiles" image="update.png" colour="#59BDCD" backColour="#E3DEC9" todo={ () => console.log("change selected profile")}></ValidateButton>
</View>
<View style={{marginTop: "6%"}}/>
<View style={styles.background}>
<View style={styles.filterBar}>
<Text style={styles.filters}>Filters from Profiles</Text>
</View>
<ListWithoutSelect title="Diets" content={dieProfiles}></ListWithoutSelect>
<View style={{marginTop: "3%"}}/>
<ListWithoutSelect title="Allergies" content={allProfiles}></ListWithoutSelect>
</View>
<View style={{marginTop: "6%"}}/>
<View style={styles.background}>
<View style={styles.filterBar}>
<Text style={styles.filters}>Additional Filters</Text>
<Text style={styles.nbSelected}>{dieAdd.length} available</Text>
</View>
<ListSelect title="Diets" content={dieAdd}></ListSelect>
<View style={{marginTop: "3%"}}/>
<ListWithoutSelect title="Allergies" content={allAdd}></ListWithoutSelect>
<View style={{marginTop: "3%"}}/>
<ValidateButton title="Add Allergy" image="plus.png" colour="#59BDCD" backColour="#E3DEC9" todo={() => console.log("add allergy")}></ValidateButton>
</View>
<View style={{marginTop: "6%"}}/>
<ValidateButton title="Save Filters" image="save.png" colour="#ACA279" backColour="#F2F0E4" todo={() => console.log("save filters")}></ValidateButton>
<View style={{marginTop: "20%"}}/>
</LinearGradient>
</ScrollView>
</SafeAreaProvider>
);
}
const styles = StyleSheet.create({
container: { container: {
height: "100%", height: "100%",
width: "100%", width: "100%",
@ -112,6 +68,8 @@ const styles = StyleSheet.create({
backgroundColor: '#F2F0E4', backgroundColor: '#F2F0E4',
padding: "3%", padding: "3%",
marginHorizontal: "3%", marginHorizontal: "3%",
borderWidth: 1,
borderColor: colors.blocBorder,
}, },
filterBar: { filterBar: {
@ -140,5 +98,53 @@ const styles = StyleSheet.create({
backgroundColor: '#F2F0E4', backgroundColor: '#F2F0E4',
marginHorizontal: "3%", marginHorizontal: "3%",
paddingBottom: "3%", paddingBottom: "3%",
borderWidth: 1,
borderColor: colors.blocBorder,
}, },
}); });
return (
<SafeAreaProvider style={{flex: 1}}>
<TopBar title="Filters Selection" isVisible="true"/>
<ScrollView>
<LinearGradient colors={['#2680AA', '#59BDCD']} style={[styles.linearGradient, {minHeight: useWindowDimensions().height}]}>
<View style={{marginTop: "6%"}}/>
<View style={styles.profilesSelection}>
<View style={styles.filterBar}>
<Text style={styles.filters}>Profiles</Text>
<Text style={styles.nbSelected}>{cptActive} selected, 1 waiting</Text>
</View>
<View style={{marginTop: "3%"}}/>
<ProfileSelection listProfile={profiles} disableSelection={false}/>
<View style={{marginTop: "4%"}}/>
<ValidateButton title="Change Selected Profiles" image="update.png" colour="#59BDCD" backColour="#E3DEC9" todo={ () => console.log("change selected profile")}></ValidateButton>
</View>
<View style={{marginTop: "6%"}}/>
<View style={styles.background}>
<View style={styles.filterBar}>
<Text style={styles.filters}>Filters from Profiles</Text>
</View>
<ListWithoutSelect title="Diets" content={dieProfiles}></ListWithoutSelect>
<View style={{marginTop: "3%"}}/>
<ListWithoutSelect title="Allergies" content={allProfiles}></ListWithoutSelect>
</View>
<View style={{marginTop: "6%"}}/>
<View style={styles.background}>
<View style={styles.filterBar}>
<Text style={styles.filters}>Additional Filters</Text>
<Text style={styles.nbSelected}>{dieAdd.length} available</Text>
</View>
<ListSelect title="Diets" content={dieAdd}></ListSelect>
<View style={{marginTop: "3%"}}/>
<ListWithoutSelect title="Allergies" content={allAdd}></ListWithoutSelect>
<View style={{marginTop: "3%"}}/>
<ValidateButton title="Add Allergy" image="plus.png" colour="#59BDCD" backColour="#E3DEC9" todo={() => console.log("add allergy")}></ValidateButton>
</View>
<View style={{marginTop: "6%"}}/>
<ValidateButton title="Save Filters" image="save.png" colour="#ACA279" backColour="#F2F0E4" todo={() => console.log("save filters")}></ValidateButton>
<View style={{marginTop: "20%"}}/>
</LinearGradient>
</ScrollView>
</SafeAreaProvider>
);
}

@ -86,6 +86,8 @@ export default function HomePage({ navigation, props }) {
backgroundColor: colors.cardBackground, backgroundColor: colors.cardBackground,
marginHorizontal: "3%", marginHorizontal: "3%",
paddingBottom: "3%", paddingBottom: "3%",
borderWidth: 1,
borderColor: colors.blocBorder,
}, },
welcome: { welcome: {
@ -161,7 +163,7 @@ export default function HomePage({ navigation, props }) {
<View style={{marginTop: "3%"}}/> <View style={{marginTop: "3%"}}/>
<View style={styles.ingredientSelection}> <View style={styles.ingredientSelection}>
<Text style={{fontSize: 15, color: colors.carrouselText}}>Selected Ingredient</Text> <Text style={{fontSize: 15, color: colors.carrouselText}}>Selected Ingredient</Text>
<View style={{flexDirection: "row", padding: "4%", justifyContent: "center", alignItems: "center"}}> <View style={{flexDirection: "row", padding: "4%", justifyContent: "center", alignItems: "center", marginLeft: "8%"}}>
<Pressable onPress={decreaseCounter}> <Pressable onPress={decreaseCounter}>
<Image source={bracketLeft} style={{width: 40, height: 40, resizeMode: "contain"}} tintColor={colors.carrouselText}/> <Image source={bracketLeft} style={{width: 40, height: 40, resizeMode: "contain"}} tintColor={colors.carrouselText}/>
</Pressable> </Pressable>

@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState, useContext } from 'react';
import { View, StyleSheet, Text, Image, Pressable, ActivityIndicator, FlatList, ScrollView, useWindowDimensions } from 'react-native'; import { View, StyleSheet, Text, Image, Pressable, ActivityIndicator, FlatList, ScrollView, useWindowDimensions } from 'react-native';
import { SafeAreaProvider } from 'react-native-safe-area-context'; import { SafeAreaProvider } from 'react-native-safe-area-context';
import TopBar from '../components/TopBar'; import TopBar from '../components/TopBar';
@ -11,6 +11,7 @@ import moins from '../assets/images/minus.png';
import Ingredient from '../Models/Ingredient'; import Ingredient from '../Models/Ingredient';
import IngredientService from '../Services/Ingredients/IngredientsServices'; import IngredientService from '../Services/Ingredients/IngredientsServices';
import { LinearGradient } from 'expo-linear-gradient'; import { LinearGradient } from 'expo-linear-gradient';
import ColorContext from '../theme/ColorContext';
export default function IngredientSelection(props) { export default function IngredientSelection(props) {
const alphabetArray: Array<string> = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]; const alphabetArray: Array<string> = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
@ -19,6 +20,7 @@ export default function IngredientSelection(props) {
const [response, setResponse] = useState<Ingredient[] | undefined>(undefined); const [response, setResponse] = useState<Ingredient[] | undefined>(undefined);
const [selectedIngredients, setSelectedIngredients] = useState([]); const [selectedIngredients, setSelectedIngredients] = useState([]);
const ingredientService = new IngredientService(); const ingredientService = new IngredientService();
const {colors, toggleColors} = useContext(ColorContext);
const [searchQuery, setSearchQuery] = useState(''); const [searchQuery, setSearchQuery] = useState('');
@ -108,6 +110,32 @@ const loadIngredients = async () => {
} }
}; };
const styles = StyleSheet.create({
linearGradient: {
width: "100%",
flex: 1,
padding: "3%",
paddingTop: 0,
alignItems: "center",
justifyContent: "flex-start",
},
element: {
width: "100%",
backgroundColor:'#F2F0E4',
borderRadius: 30,
borderWidth: 1,
borderColor: colors.blocBorder,
},
horizontalAlignment: {
width: "100%",
flexDirection: 'row',
justifyContent: 'space-around',
alignItems: 'center',
marginTop: "3%",
}
});
return ( return (
<SafeAreaProvider style={{flex: 1}}> <SafeAreaProvider style={{flex: 1}}>
<ScrollView> <ScrollView>
@ -173,27 +201,3 @@ const loadIngredients = async () => {
</SafeAreaProvider> </SafeAreaProvider>
); );
} }
const styles = StyleSheet.create({
linearGradient: {
width: "100%",
flex: 1,
padding: "3%",
paddingTop: 0,
alignItems: "center",
justifyContent: "flex-start",
},
element: {
width: "100%",
backgroundColor:'#F2F0E4',
borderRadius: 30,
},
horizontalAlignment: {
width: "100%",
flexDirection: 'row',
justifyContent: 'space-around',
alignItems: 'center',
marginTop: "3%",
}
});

@ -1,4 +1,4 @@
import React from 'react'; import React, {useContext} from 'react';
import {StyleSheet, View, ScrollView, useWindowDimensions} from 'react-native'; import {StyleSheet, View, ScrollView, useWindowDimensions} from 'react-native';
import { LinearGradient } from 'expo-linear-gradient'; import { LinearGradient } from 'expo-linear-gradient';
import { SafeAreaProvider } from 'react-native-safe-area-context'; import { SafeAreaProvider } from 'react-native-safe-area-context';
@ -6,7 +6,10 @@ import { SafeAreaProvider } from 'react-native-safe-area-context';
import ProfileModification from '../components/ProfileModification'; import ProfileModification from '../components/ProfileModification';
import ValidateButton from '../components/ValidateButton'; import ValidateButton from '../components/ValidateButton';
import ColorContext from '../theme/ColorContext'
export default function ModifyProfile(props) { export default function ModifyProfile(props) {
const {colors, toggleColors} = useContext(ColorContext);
const all = [{value: "Mussels"}, {value: "Skimmed Milk"}, {value: "Nuts"}] const all = [{value: "Mussels"}, {value: "Skimmed Milk"}, {value: "Nuts"}]
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"}]
return ( return (
@ -16,7 +19,7 @@ export default function ModifyProfile(props) {
<View style={{marginTop: "6%"}}/> <View style={{marginTop: "6%"}}/>
<ProfileModification name="Johnny Silverhand" avatar="plus_small.png" diets={die} allergies={all}></ProfileModification> <ProfileModification name="Johnny Silverhand" avatar="plus_small.png" diets={die} allergies={all}></ProfileModification>
<View style={{marginTop: "3%"}}/> <View style={{marginTop: "3%"}}/>
<ValidateButton title="Update Profile" image="update.png" colour="#ACA279" backColour="#F2F0E4" todo={() => (console.log("Profile Modified"))}></ValidateButton> <ValidateButton title="Update Profile" image="update.png" colour={colors.buttonMain} backColour={colors.buttonBackground} todo={() => (console.log("Profile Modified"))}></ValidateButton>
<View style={{marginBottom: "20%"}}/> <View style={{marginBottom: "20%"}}/>
</LinearGradient> </LinearGradient>
</ScrollView> </ScrollView>

@ -167,8 +167,7 @@ export default function Profiles({navigation, props}) {
avatar={profile.avatar} avatar={profile.avatar}
diets={profile.diets} diets={profile.diets}
allergies={profile.allergies} allergies={profile.allergies}
onDeleteProfile={raisePopUp} onDeleteProfile={raisePopUp}/>
/>
{index < profiles.length - 1 && <View style={styles.separator} />} {index < profiles.length - 1 && <View style={styles.separator} />}
</View> </View>
)); ));

@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState, useContext } from 'react';
import { View, StyleSheet, Text, ScrollView, useWindowDimensions} from 'react-native'; import { View, StyleSheet, Text, ScrollView, useWindowDimensions} from 'react-native';
import { SafeAreaProvider } from 'react-native-safe-area-context'; import { SafeAreaProvider } from 'react-native-safe-area-context';
@ -8,9 +8,11 @@ import RecipesService from '../Services/Recipes/RecipesServices';
import Recipes from '../Models/Recipes'; 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';
export default function RecipeDetails(props) { export default function RecipeDetails(props) {
const {colors, toggleColors} = useContext(ColorContext);
const [isLoading, setIsLoading] = useState(true); const [isLoading, setIsLoading] = useState(true);
const [error, setError] = useState(); const [error, setError] = useState();
@ -43,7 +45,6 @@ export default function RecipeDetails(props) {
} }
return ( return (
<SafeAreaProvider> <SafeAreaProvider>
<ScrollView> <ScrollView>
<LinearGradient colors={['#2680AA', '#59BDCD']} style={[styles.linearGradient, {minHeight: useWindowDimensions().height}]}> <LinearGradient colors={['#2680AA', '#59BDCD']} style={[styles.linearGradient, {minHeight: useWindowDimensions().height}]}>
@ -74,7 +75,6 @@ export default function RecipeDetails(props) {
</ScrollView> </ScrollView>
</SafeAreaProvider> </SafeAreaProvider>
); );
}
const styles = StyleSheet.create({ const styles = StyleSheet.create({
linearGradient: { linearGradient: {
@ -95,6 +95,8 @@ export default function RecipeDetails(props) {
backgroundColor: '#F2F0E4', backgroundColor: '#F2F0E4',
padding: "3%", padding: "3%",
marginHorizontal: "3%", marginHorizontal: "3%",
borderWidth: 1,
borderColor: colors.blocBorder,
}, },
filterBar: { filterBar: {
@ -116,4 +118,4 @@ export default function RecipeDetails(props) {
textAlign: "right", textAlign: "right",
}, },
}); });
}

@ -1,4 +1,4 @@
import React, { useState } from 'react'; import React, { useState, useContext } from 'react';
import {View, StyleSheet, Text, Image, Pressable, useWindowDimensions, ScrollView} from 'react-native'; import {View, StyleSheet, Text, Image, Pressable, useWindowDimensions, ScrollView} from 'react-native';
import {SafeAreaProvider } from 'react-native-safe-area-context'; import {SafeAreaProvider } from 'react-native-safe-area-context';
import {Modal, Portal, PaperProvider} from 'react-native-paper'; import {Modal, Portal, PaperProvider} from 'react-native-paper';
@ -10,6 +10,7 @@ import FoodElementTextSimple from '../components/FoodElementTextSimple';
import FoodElementText from '../components/FoodElementText'; import FoodElementText from '../components/FoodElementText';
import CustomButton from '../components/CustomButton'; import CustomButton from '../components/CustomButton';
import DietsTab from '../components/ListSelect'; import DietsTab from '../components/ListSelect';
import ColorContext from '../theme/ColorContext';
import brochette from '../assets/images/brochette.png'; import brochette from '../assets/images/brochette.png';
import ParameterTopBar from '../components/ParameterTopBar'; import ParameterTopBar from '../components/ParameterTopBar';
@ -23,6 +24,7 @@ import minus from '../assets/images/minus.png';
export default function RecipeSuggestion(props) { export default function RecipeSuggestion(props) {
const {colors, toggleColors} = useContext(ColorContext)
const [visible, setVisible] = React.useState(false); const [visible, setVisible] = React.useState(false);
const [visibleFilters, setVisibleFilters] = React.useState(false); const [visibleFilters, setVisibleFilters] = React.useState(false);
const [visibleIngredients, setVisibleIngredients] = React.useState(true); const [visibleIngredients, setVisibleIngredients] = React.useState(true);
@ -92,6 +94,81 @@ export default function RecipeSuggestion(props) {
</View> </View>
)); ));
const styles = StyleSheet.create({
linearGradient: {
width: "100%",
flex: 1,
//padding: "2%",
paddingTop: 0,
alignItems: "center",
justifyContent: "center"
},
background: {
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
borderRadius: 20,
backgroundColor: '#F2F0E4',
padding: "3%",
marginHorizontal: "3%",
borderWidth: 1,
borderColor: colors.blocBorder,
},
filterBar: {
flexDirection: "row",
width: "85%",
paddingTop: "3%",
paddingBottom: "2%",
alignItems: "flex-end",
justifyContent: "center",
},
filters: {
fontSize: 20,
color: '#ACA279',
flex: 1,
},
nbSelected: {
fontSize: 11,
color: "#3F3C42",
textAlign: "right",
},
page: {
flex: 1,
backgroundColor: '#59BDCD',
alignItems: 'center',
paddingHorizontal: "3%",
},
modal :{
position: 'absolute',
top: '50%',
height: "50%",
width: "100%",
borderWidth: 1,
borderColor: "red",
borderTopLeftRadius: 20,
borderTopRightRadius: 20,
},
horizontalAlignment: {
display: 'flex',
height: "10%",
width: "100%",
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
},
recipes: {
flexDirection: "row",
overflow: "scroll",
alignItems: "flex-start",
justifyContent: "center",
},
});
return ( return (
<SafeAreaProvider style={{flex: 1}}> <SafeAreaProvider style={{flex: 1}}>
<PaperProvider> <PaperProvider>
@ -167,76 +244,3 @@ export default function RecipeSuggestion(props) {
</SafeAreaProvider> </SafeAreaProvider>
); );
} }
const styles = StyleSheet.create({
linearGradient: {
width: "100%",
flex: 1,
//padding: "2%",
paddingTop: 0,
alignItems: "center",
justifyContent: "center"
},
background: {
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
borderRadius: 20,
backgroundColor: '#F2F0E4',
padding: "3%",
marginHorizontal: "3%",
},
filterBar: {
flexDirection: "row",
width: "85%",
paddingTop: "3%",
paddingBottom: "2%",
alignItems: "flex-end",
justifyContent: "center",
},
filters: {
fontSize: 20,
color: '#ACA279',
flex: 1,
},
nbSelected: {
fontSize: 11,
color: "#3F3C42",
textAlign: "right",
},
page: {
flex: 1,
backgroundColor: '#59BDCD',
alignItems: 'center',
paddingHorizontal: "3%",
},
modal :{
position: 'absolute',
top: '50%',
height: "50%",
width: "100%",
borderWidth: 1,
borderColor: "red",
borderTopLeftRadius: 20,
borderTopRightRadius: 20,
},
horizontalAlignment: {
display: 'flex',
height: "10%",
width: "100%",
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
},
recipes: {
flexDirection: "row",
overflow: "scroll",
alignItems: "flex-start",
justifyContent: "center",
},
});

@ -30,7 +30,10 @@ export interface Theme {
welcomeName: string, welcomeName: string,
carrouselBackground: string, carrouselBackground: string,
carrouselText: string, carrouselText: string,
carrouselDetail: string carrouselDetail: string,
textBottomBarFocussed: string,
blocBorder: string,
buttonMain: string,
} }
export const LightTheme : Theme = { export const LightTheme : Theme = {
@ -53,7 +56,10 @@ export const LightTheme : Theme = {
welcomeName: Moonstone, welcomeName: Moonstone,
carrouselBackground: Pearl, carrouselBackground: Pearl,
carrouselText: Ecru, carrouselText: Ecru,
carrouselDetail: Moonstone carrouselDetail: Moonstone,
textBottomBarFocussed: Moonstone,
blocBorder: Alabaster,
buttonMain: Ecru,
} }
export const DarkTheme : Theme = { export const DarkTheme : Theme = {
@ -76,6 +82,9 @@ export const DarkTheme : Theme = {
welcomeName:Alabaster, welcomeName:Alabaster,
carrouselBackground: CarolinaBlue, carrouselBackground: CarolinaBlue,
carrouselText: SteelBlue, carrouselText: SteelBlue,
carrouselDetail: Alabaster carrouselDetail: Alabaster,
textBottomBarFocussed: SteelBlue,
blocBorder: EerieBlack,
buttonMain: CarolinaBlue,
} }

Loading…
Cancel
Save