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; const componentWidth = 280;
export default function FoodElementText(props : foodElementImageProps) { export default function FoodElementText(props : FoodElementTextProps) {
const colors = useContext(ColorContext).colors const colors = useContext(ColorContext).colors
const styles = StyleSheet.create({ const styles = StyleSheet.create({

@ -11,7 +11,6 @@ type ListProps = {
} }
export default function ListSelect(props: ListProps) { export default function ListSelect(props: ListProps) {
const [selected, setSelected] = React.useState([]);
const colors = useContext(ColorContext).colors; const colors = useContext(ColorContext).colors;
const styles = StyleSheet.create({ 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%"}}> <Pressable onPress={changeListVisibility} style={{height: "5%", marginTop: "6%", flex: 1, marginBottom: "3%"}}>
<View style={styles.filterBar}> <View style={styles.filterBar}>
<Text style={styles.filters}>Filters</Text> <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> <Image source={require("../assets/images/arrow.png")} style={styles.arrow}></Image>
</View> </View>
</Pressable> </Pressable>

@ -15,6 +15,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
export default function CreateProfile(props) { export default function CreateProfile(props) {
const colors = useContext(ColorContext).colors const colors = useContext(ColorContext).colors
const profile_service = new ProfileService() const profile_service = new ProfileService()
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"}]
const [name, onChangeName] = useState(); const [name, onChangeName] = useState();
const [avatar, setAvatar] = useState<string>(''); const [avatar, setAvatar] = useState<string>('');

@ -15,9 +15,6 @@ export default function Profiles({navigation, props}) {
const colors = useContext(ColorContext).colors const colors = useContext(ColorContext).colors
const profile_service = new ProfileService() 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 [visible, setVisible] = useState(false);
const [profiles, setProfiles] = useState([]); const [profiles, setProfiles] = useState([]);
const [selectedProfileIndex, setSelectedProfileIndex] = useState(null); const [selectedProfileIndex, setSelectedProfileIndex] = useState(null);
@ -45,10 +42,10 @@ export default function Profiles({navigation, props}) {
const handleGetProfiles = async () => { const handleGetProfiles = async () => {
try { try {
const results = await profile_service.getProfiles() const existingProfiles = await AsyncStorage.getItem('profiles');
return results return JSON.parse(existingProfiles) || [];
} catch (error) { } catch (error) {
console.log(error); console.log("Error occured during GetProfiles", error);
return []; return [];
} }
} }
@ -227,8 +224,6 @@ export default function Profiles({navigation, props}) {
</View> </View>
)); ));
return ( return (
<SafeAreaProvider style={{flex: 1}}> <SafeAreaProvider style={{flex: 1}}>
<PaperProvider> <PaperProvider>

Loading…
Cancel
Save