Merge Master
continuous-integration/drone/push Build is passing Details

pull/23/head
Louison PARANT 1 year ago
parent 5802f0038f
commit 6e170687bc

@ -14,7 +14,7 @@ const componentHeight = 60;
const componentWidth = 280;
export default function FoodElementText(props : foodElementImageProps) {
export default function FoodElementText(props : FoodElementTextProps) {
const colors = useContext(ColorContext).colors
const styles = StyleSheet.create({

@ -11,7 +11,6 @@ type ListProps = {
}
export default function ListSelect(props: ListProps) {
const [selected, setSelected] = React.useState([]);
const colors = useContext(ColorContext).colors;
const styles = StyleSheet.create({

@ -137,7 +137,7 @@ export default function ProfileDetails(props) {
<Pressable onPress={changeListVisibility} style={{height: "5%", marginTop: "6%", flex: 1, marginBottom: "3%"}}>
<View style={styles.filterBar}>
<Text style={styles.filters}>Filters</Text>
<Text style={styles.nbSelected}>{props.diets.length} diets selected</Text>
{/*<Text style={styles.nbSelected}>{props.diets.length} diets selected</Text>*/}
<Image source={require("../assets/images/arrow.png")} style={styles.arrow}></Image>
</View>
</Pressable>

@ -15,6 +15,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
export default function CreateProfile(props) {
const colors = useContext(ColorContext).colors
const profile_service = new ProfileService()
const all = []
const die = [{value: "Dairy free"}, {value: "Gluten free"}, {value: "Porkless"}, {value: "Vegan"}, {value: "Vegetarian"}, {value: "Pescatarian"}]
const [name, onChangeName] = useState();
const [avatar, setAvatar] = useState<string>('');

@ -15,9 +15,6 @@ export default function Profiles({navigation, props}) {
const colors = useContext(ColorContext).colors
const profile_service = new ProfileService()
const all = []
const die = [{value: "Dairy free"}, {value: "Gluten free"}, {value: "Porkless"}, {value: "Vegan"}, {value: "Vegetarian"}, {value: "Pescatarian"}]
const [visible, setVisible] = useState(false);
const [profiles, setProfiles] = useState([]);
const [selectedProfileIndex, setSelectedProfileIndex] = useState(null);
@ -45,10 +42,10 @@ export default function Profiles({navigation, props}) {
const handleGetProfiles = async () => {
try {
const results = await profile_service.getProfiles()
return results
const existingProfiles = await AsyncStorage.getItem('profiles');
return JSON.parse(existingProfiles) || [];
} catch (error) {
console.log(error);
console.log("Error occured during GetProfiles", error);
return [];
}
}
@ -70,7 +67,7 @@ export default function Profiles({navigation, props}) {
height: "75%",
width: "100%",
};
const styles = StyleSheet.create({
const styles = StyleSheet.create({
container: {
height: "100%",
width: "100%",
@ -227,8 +224,6 @@ export default function Profiles({navigation, props}) {
</View>
));
return (
<SafeAreaProvider style={{flex: 1}}>
<PaperProvider>

Loading…
Cancel
Save