👋 Welcome here.
A basic shopping list of movies, done with react.
Login and get your free API-Key here : https://www.omdbapi.com/ .
Inside App.js, replace "YOURAPIKEY" with your personal one : https://www.omdbapi.com/?apikey=YOURAPIKEY&s=${entry}
🚀 Run the app & search for a movie.
- in the response from the api-fetch, I didn't get the price of the movies; so I had to add it manually ↓↓↓
// App.js :
const getRandomPrice = (item) => {
item.price = (Math.random() \* 10).toFixed(2);
return item;
};
- store the map-logic inside a variable and then pass it through the render process.
// List.js :
const result = search.map((movie) => {
return (
<>
<Card movie={movie} removeUpdate={removeUpdate} />
</>
);
});
return <div className="wrapper-list">{result}</div>;
- React-router
- React-context
- Sass