diff --git a/LeftOvers/Services/Ingredients/IngredientsServices.tsx b/LeftOvers/Services/Ingredients/IngredientsServices.tsx index 7aff716..d50cc89 100644 --- a/LeftOvers/Services/Ingredients/IngredientsServices.tsx +++ b/LeftOvers/Services/Ingredients/IngredientsServices.tsx @@ -5,8 +5,6 @@ import axios from 'axios'; export default class IngredientService implements IIngredientService { private readonly API_URL = "http://leftovers.alwaysdata.net/ingredients"; - constructor() {} - async getAllIngredient(): Promise { try { const response = await axios.get(this.API_URL); diff --git a/LeftOvers/Services/Recipes/RecipesServices.tsx b/LeftOvers/Services/Recipes/RecipesServices.tsx index f549ebf..c86d71d 100644 --- a/LeftOvers/Services/Recipes/RecipesServices.tsx +++ b/LeftOvers/Services/Recipes/RecipesServices.tsx @@ -5,8 +5,6 @@ import Recipes from "../../Models/Recipes"; export default class RecipesService implements IRecipesService { private readonly API_URL = "http://leftovers.alwaysdata.net/recipes"; - constructor() {} - async getAllRecipes(): Promise { try { const response = await axios.get(this.API_URL); diff --git a/LeftOvers/components/FoodElementText.tsx b/LeftOvers/components/FoodElementText.tsx index 53e024f..68b1135 100644 --- a/LeftOvers/components/FoodElementText.tsx +++ b/LeftOvers/components/FoodElementText.tsx @@ -13,7 +13,7 @@ const componentWidth = 280; export default function FoodElementText(props : any) { - const {colors, toggleColors } = useContext(ColorContext) + const {colors} = useContext(ColorContext) const styles = StyleSheet.create({ button: { diff --git a/LeftOvers/components/ListSelect.tsx b/LeftOvers/components/ListSelect.tsx index a455070..b7380b5 100644 --- a/LeftOvers/components/ListSelect.tsx +++ b/LeftOvers/components/ListSelect.tsx @@ -9,8 +9,8 @@ type ListProps = { } export default function ListSelect(props: ListProps) { - const [selected, setSelected] = React.useState([]); - const { colors, toggleColors } = useContext(ColorContext); + const [selected, setSelected] = React.useState(["None"]); + const {colors} = useContext(ColorContext); const styles = StyleSheet.create({ titleBar: { diff --git a/LeftOvers/components/ListWithoutSelect.tsx b/LeftOvers/components/ListWithoutSelect.tsx index 4da6900..5fa3c67 100644 --- a/LeftOvers/components/ListWithoutSelect.tsx +++ b/LeftOvers/components/ListWithoutSelect.tsx @@ -9,8 +9,7 @@ type ListProps = { } export default function ListWithoutSelect(props: ListProps) { - const [selected, setSelected] = React.useState([]); - const { colors, toggleColors } = useContext(ColorContext); + const { colors } = useContext(ColorContext); const styles = StyleSheet.create({ titleBar: { diff --git a/LeftOvers/components/ProfileDetails.tsx b/LeftOvers/components/ProfileDetails.tsx index 3a7df35..3eedd69 100644 --- a/LeftOvers/components/ProfileDetails.tsx +++ b/LeftOvers/components/ProfileDetails.tsx @@ -14,8 +14,8 @@ type ProfileProps = { } export default function ProfileDetails(props) { - const { colors, toggleColors } = useContext(ColorContext) - const navigation = useNavigation() + const { colors } = useContext(ColorContext) + //const navigation = useNavigation() const [display, setDisplay] = useState("none") const changeListVisibility = () => { if (display == "none"){ diff --git a/LeftOvers/components/ProfileElement.tsx b/LeftOvers/components/ProfileElement.tsx index f3ecf30..af0c042 100644 --- a/LeftOvers/components/ProfileElement.tsx +++ b/LeftOvers/components/ProfileElement.tsx @@ -10,7 +10,7 @@ type Profile = { } export default function ProfileElement(props : Profile) { - const { colors, toggleColors } = useContext(ColorContext) + const { colors } = useContext(ColorContext) const [waiting, setWaiting] = useState("none") const [separator, setSeparator] = useState("none") diff --git a/LeftOvers/components/ProfileModification.tsx b/LeftOvers/components/ProfileModification.tsx index c82741d..c3e9e14 100644 --- a/LeftOvers/components/ProfileModification.tsx +++ b/LeftOvers/components/ProfileModification.tsx @@ -15,7 +15,7 @@ type ProfileProps = { export default function ProfileModification(props: ProfileProps) { const [name, onChangeName] = useState(props.name); - const { colors, toggleColors } = useContext(ColorContext); + const { colors } = useContext(ColorContext); let imageSource if (props.avatar == "plus.png"){ diff --git a/LeftOvers/components/ProfileSelection.tsx b/LeftOvers/components/ProfileSelection.tsx index c4f05a8..376ee7e 100644 --- a/LeftOvers/components/ProfileSelection.tsx +++ b/LeftOvers/components/ProfileSelection.tsx @@ -19,7 +19,7 @@ type Profile = { } export default function ProfileSelection(props: ProfileSelectionProps) { - const { colors, toggleColors } = useContext(ColorContext); + const { colors } = useContext(ColorContext); const [cpt, setCpt] = useState(0); const decreaseCounter = () => { diff --git a/LeftOvers/components/Separator.tsx b/LeftOvers/components/Separator.tsx index 2e26d93..a20c830 100644 --- a/LeftOvers/components/Separator.tsx +++ b/LeftOvers/components/Separator.tsx @@ -3,7 +3,7 @@ import {StyleSheet, View} from 'react-native'; import ColorContext from '../theme/ColorContext'; export default function Separator (){ - const {colors, toggleColors } = useContext(ColorContext) + const {colors } = useContext(ColorContext) const styles = StyleSheet.create({ separator: { diff --git a/LeftOvers/navigation/CookingStackScreen.tsx b/LeftOvers/navigation/CookingStackScreen.tsx index b94c8d8..f043b31 100644 --- a/LeftOvers/navigation/CookingStackScreen.tsx +++ b/LeftOvers/navigation/CookingStackScreen.tsx @@ -9,7 +9,7 @@ import ThemeContext from '../theme/ThemeContext'; const CookingStack = createNativeStackNavigator() export default function CookingStackScreen() { - const {theme, toggleTheme} = useContext(ThemeContext); + const {theme} = useContext(ThemeContext); return ( diff --git a/LeftOvers/navigation/HomeStackScreen.tsx b/LeftOvers/navigation/HomeStackScreen.tsx index 88ce93b..9e94f4e 100644 --- a/LeftOvers/navigation/HomeStackScreen.tsx +++ b/LeftOvers/navigation/HomeStackScreen.tsx @@ -22,8 +22,7 @@ function AppIcon() { } export default function HomeStackScreen() { - const {theme, toggleTheme} = useContext(ThemeContext) - const {colors, toggleColors} = useContext(ColorContext) + const {colors} = useContext(ColorContext) return ( diff --git a/LeftOvers/navigation/ProfileStackScreen.tsx b/LeftOvers/navigation/ProfileStackScreen.tsx index ea88a7f..654ddb6 100644 --- a/LeftOvers/navigation/ProfileStackScreen.tsx +++ b/LeftOvers/navigation/ProfileStackScreen.tsx @@ -15,7 +15,7 @@ import AddIcon from '../assets/images/plus.png' const ProfilesStack = createNativeStackNavigator() export default function ProfilesStackScreen({ navigation }) { - const {theme, toggleTheme} = useContext(ThemeContext); + const {theme} = useContext(ThemeContext); const styles = StyleSheet.create({ headerBarContainer: { diff --git a/LeftOvers/navigation/Utils.tsx b/LeftOvers/navigation/Utils.tsx index 0a6c072..557d67b 100644 --- a/LeftOvers/navigation/Utils.tsx +++ b/LeftOvers/navigation/Utils.tsx @@ -4,7 +4,7 @@ import { Text, StyleSheet } from 'react-native'; import ColorContext from '../theme/ColorContext'; export function HeaderTitle(props) { - const {colors, toggleColors} = useContext(ColorContext) + const {colors} = useContext(ColorContext) const styles = StyleSheet.create({ headerTitle: { diff --git a/LeftOvers/screens/CreateProfile.tsx b/LeftOvers/screens/CreateProfile.tsx index cbf23f6..db3c9a5 100644 --- a/LeftOvers/screens/CreateProfile.tsx +++ b/LeftOvers/screens/CreateProfile.tsx @@ -8,7 +8,7 @@ import ValidateButton from '../components/ValidateButton'; import ColorContext from '../theme/ColorContext'; export default function CreateProfile(props) { - const { colors, toggleColors } = useContext(ColorContext) + const { colors } = useContext(ColorContext) const all = [] const die = [{value: "Dairy free"}, {value: "Gluten free"}, {value: "Porkless"}, {value: "Vegan"}, {value: "Vegetarian"}, {value: "Pescatarian"}] diff --git a/LeftOvers/screens/FiltersSelection.tsx b/LeftOvers/screens/FiltersSelection.tsx index a52a85a..4a65841 100644 --- a/LeftOvers/screens/FiltersSelection.tsx +++ b/LeftOvers/screens/FiltersSelection.tsx @@ -11,7 +11,7 @@ import ProfileSelection from '../components/ProfileSelection'; import ColorContext from '../theme/ColorContext'; export default function FiltersSelection(props) { - const {colors, toggleColors} = useContext(ColorContext); + const {colors} = useContext(ColorContext); const profiles = [ {name: "Johnny Silverhand", avatar: "plus_small.png", isActive: "flex"}, {name: "Panam Palmer", avatar: "plus_small.png", isActive: "none"}, diff --git a/LeftOvers/screens/HomePage.tsx b/LeftOvers/screens/HomePage.tsx index 825c163..c991b0c 100644 --- a/LeftOvers/screens/HomePage.tsx +++ b/LeftOvers/screens/HomePage.tsx @@ -13,7 +13,7 @@ import bracketRight from '../assets/images/angle_bracket_right.png'; export default function HomePage({ navigation, props }) { - const {colors, toggleColors} = useContext(ColorContext); + const {colors} = useContext(ColorContext); const profiles = [ {name: "Johnny Silverhand", avatar: "plus_small.png", isActive: "flex"}, diff --git a/LeftOvers/screens/IngredientSelection.tsx b/LeftOvers/screens/IngredientSelection.tsx index 606de64..adf6ab2 100644 --- a/LeftOvers/screens/IngredientSelection.tsx +++ b/LeftOvers/screens/IngredientSelection.tsx @@ -15,11 +15,11 @@ import ColorContext from '../theme/ColorContext'; export default function IngredientSelection(props) { const alphabetArray: Array = ["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 [isLoading, setIsLoading] = useState(true); - const [error, setError] = useState(); + const [error, setError] = useState(""); const [response, setResponse] = useState(undefined); const [selectedIngredients, setSelectedIngredients] = useState([]); const ingredientService = new IngredientService(); - const {colors, toggleColors} = useContext(ColorContext); + const {colors} = useContext(ColorContext); const [searchQuery, setSearchQuery] = useState(''); diff --git a/LeftOvers/screens/ModifyProfile.tsx b/LeftOvers/screens/ModifyProfile.tsx index ef9ca0c..12ecf88 100644 --- a/LeftOvers/screens/ModifyProfile.tsx +++ b/LeftOvers/screens/ModifyProfile.tsx @@ -9,7 +9,7 @@ import ValidateButton from '../components/ValidateButton'; import ColorContext from '../theme/ColorContext' export default function ModifyProfile(props) { - const {colors, toggleColors} = useContext(ColorContext); + const {colors} = useContext(ColorContext); 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"}] return ( diff --git a/LeftOvers/screens/Profiles.tsx b/LeftOvers/screens/Profiles.tsx index 8f39896..a88e79d 100644 --- a/LeftOvers/screens/Profiles.tsx +++ b/LeftOvers/screens/Profiles.tsx @@ -9,7 +9,7 @@ import ProfileDelete from '../components/ProfileDelete'; import ColorContext from '../theme/ColorContext'; export default function Profiles({navigation, props}) { - const { colors, toggleColors } = useContext(ColorContext) + const { colors } = useContext(ColorContext) const allJohnny = [{value: "Coconut"}, {value: "Skimmed Milk"}, {value: "Nuts"}] const dieJohnny = [{value: "Gluten free"}, {value: "Porkless"}, {value: "Pescatarian"}] diff --git a/LeftOvers/screens/RecipeDetails.tsx b/LeftOvers/screens/RecipeDetails.tsx index e0b9dce..b79b2da 100644 --- a/LeftOvers/screens/RecipeDetails.tsx +++ b/LeftOvers/screens/RecipeDetails.tsx @@ -11,7 +11,7 @@ import ColorContext from '../theme/ColorContext'; export default function RecipeDetails(props) { - const {colors, toggleColors} = useContext(ColorContext); + const {colors} = useContext(ColorContext); const [isLoading, setIsLoading] = useState(true); const [error, setError] = useState(); diff --git a/LeftOvers/screens/RecipeSuggestion.tsx b/LeftOvers/screens/RecipeSuggestion.tsx index 9257dfa..92a7247 100644 --- a/LeftOvers/screens/RecipeSuggestion.tsx +++ b/LeftOvers/screens/RecipeSuggestion.tsx @@ -7,14 +7,9 @@ import TopBar from '../components/TopBar'; import RecipeElement from '../components/RecipeElement'; import SelectedIngredient from '../components/SelectedIngredient'; import FoodElementTextSimple from '../components/FoodElementTextSimple'; -import FoodElementText from '../components/FoodElementText'; import CustomButton from '../components/CustomButton'; -import DietsTab from '../components/ListSelect'; import ColorContext from '../theme/ColorContext'; - -import brochette from '../assets/images/brochette.png'; import ParameterTopBar from '../components/ParameterTopBar'; -import ListSelect from '../components/ListSelect'; import ListWithoutSelect from '../components/ListWithoutSelect'; import ValidateButton from '../components/ValidateButton'; import bracketLeft from '../assets/images/angle_bracket_left.png'; @@ -24,7 +19,7 @@ import minus from '../assets/images/minus.png'; export default function RecipeSuggestion(props) { - const {colors, toggleColors} = useContext(ColorContext) + const {colors} = useContext(ColorContext) const [visible, setVisible] = React.useState(false); const [visibleFilters, setVisibleFilters] = React.useState(false); const [visibleIngredients, setVisibleIngredients] = React.useState(true);