diff --git a/src/Components/HighlightedDish.jsx b/src/Components/HighlightedDish.jsx index cf8cfe4..5c621b4 100644 --- a/src/Components/HighlightedDish.jsx +++ b/src/Components/HighlightedDish.jsx @@ -10,7 +10,18 @@ import { Dishes } from '../API/Dishes'; function HighlightedDish() { - const [availableDishes, setAvailableDishes] = useState(Dishes) + const randomisedDishes = (dishes) => { + let currentIndex = dishes.length; + while (currentIndex !== 0 ){ + let randomIndex = Math.floor(Math.random()* currentIndex); + currentIndex--; + [Dishes[currentIndex], Dishes[randomIndex]] = [Dishes[randomIndex],Dishes[currentIndex]] + } + return dishes + } + + const [availableDishes, setAvailableDishes] = useState(randomisedDishes([...Dishes])) + const removeCard = () => { setAvailableDishes((prev) =>{ diff --git a/src/Contexts/Auth.jsx b/src/Contexts/Auth.jsx index e69de29..c7fb98a 100644 --- a/src/Contexts/Auth.jsx +++ b/src/Contexts/Auth.jsx @@ -0,0 +1,12 @@ +// import { useState } from "react"; +// import a + +// const AuthContext = React.createContext(); + +// export function AuthProvider({ children }){ +// const [currentUser, setCurrentUser] = useState(null); +// const [userLoggedIn, setUserLoggedIn] = useState(false); +// const [loading, setLoading] = useState(true); + + +// } \ No newline at end of file