random recipe ok

This commit is contained in:
Ruidy Nemausat 2020-01-24 22:59:34 +01:00
parent 935b47bbf8
commit bd115ac0a8
7 changed files with 28 additions and 35 deletions

View file

@ -72,4 +72,4 @@ Free meal planner for cooks short on ideas! (like me …)
- WebApp - WebApp
- Random meal suggestion - Random meal suggestion
- Search by name: you're look for a recipe? Ours are easy to make and Yummy! - Search by name: you're looking for a recipe? Ours are easy to make and yummy!

View file

@ -6,10 +6,11 @@ import SearchPage from "./pages/Search";
import NotFound from "./pages/NotFound"; import NotFound from "./pages/NotFound";
import Navbar from "./components/Navbar"; import Navbar from "./components/Navbar";
import Footer from "./components/Footer"; import Footer from "./components/Footer";
// import "./App.css"; import "./App.css";
const App = () => { const App = () => {
const [searchString, setSearchString] = useState(""); const [searchString, setSearchString] = useState("");
// Find a better alternative …
const mealDef = { const mealDef = {
meals: [ meals: [
{ {
@ -78,8 +79,6 @@ const App = () => {
.then(mealItem => setMeal(mealItem)); .then(mealItem => setMeal(mealItem));
}; };
// const { mealItem } = meal;
const handleChange = ev => { const handleChange = ev => {
const { value } = ev.target; const { value } = ev.target;
setSearchString(value); setSearchString(value);

View file

@ -4,7 +4,7 @@ const GitHubLink = () => {
return ( return (
<a <a
className="grey-text text-lighten-4 right" className="grey-text text-lighten-4 right"
href="https://github.com/rjNemo" href="https://github.com/rjNemo/meal_planner"
target="blank" target="blank"
rel="noopener" rel="noopener"
> >

View file

@ -5,7 +5,7 @@ const Logo = () => {
return ( return (
<Link to="/" class="brand-logo"> <Link to="/" class="brand-logo">
<span role="img" aria-label="cookie"> <span role="img" aria-label="cookie">
🍪 🍪 Chef's Planner
</span> </span>
</Link> </Link>
); );

View file

@ -12,21 +12,18 @@ const MealPresentation = props => {
<div className="row"> <div className="row">
<div className="col s12"> <div className="col s12">
<h1>{mealName}</h1> <h1>{mealName}</h1>
<div className="col s8"> <img className="responsive-img" src={imgAddress} alt={mealName} />
<img src={imgAddress} alt={mealName} height="320" /> <ul>
</div> <li>
<div className="col s4"> <a href={videoAddress} target="blank">
<ul> See in video
<li> </a>
<a href={videoAddress} target="blank"> </li>
See in video {/* <video width="" height="" controls autoplay>
</a>
</li>
{/* <video width="" height="" controls autoplay>
<source src={videoAddress} type="video/mp4" /> <source src={videoAddress} type="video/mp4" />
Your browser does not support the video tag. Your browser does not support the video tag.
</video> */} </video> */}
{/* <iframe {/* <iframe
title="video" title="video"
width="560" width="560"
height="315" height="315"
@ -36,14 +33,13 @@ const MealPresentation = props => {
allowfullscreen allowfullscreen
></iframe> */} ></iframe> */}
<li> <li>
<b>Category:</b> {mealCategory} <b>Category:</b> {mealCategory}
</li> </li>
<li> <li>
<b>Origin:</b> {mealArea} <b>Origin:</b> {mealArea}
</li> </li>
</ul> </ul>
</div>
</div> </div>
</div> </div>
); );

View file

@ -7,9 +7,8 @@ const Navbar = props => {
return ( return (
<nav> <nav>
<div className="nav-wrapper"> <div className="nav-wrapper">
{/* <div className="container"> */}
<div className="row"> <div className="row">
<div className="col s2"> <div className="col s3">
<Logo /> <Logo />
</div> </div>
<div className="col s6"> <div className="col s6">
@ -18,12 +17,11 @@ const Navbar = props => {
handleChange={props.handleChange} handleChange={props.handleChange}
/> />
</div> </div>
<div className="col s4"> <div className="col s3">
<RandomButton handleClick={props.handleClick} /> <RandomButton handleClick={props.handleClick} />
</div> </div>
</div> </div>
</div> </div>
{/* </div> */}
</nav> </nav>
); );
}; };

View file

@ -4,9 +4,9 @@ import IngredientList from "../components/IngredientList";
import Recipe from "../components/Recipe"; import Recipe from "../components/Recipe";
const MealPage = props => { const MealPage = props => {
let meal = props.meal.meals[0]; const meal = props.meal.meals[0];
let { const {
strMeal, strMeal,
strMealThumb, strMealThumb,
strYoutube, strYoutube,
@ -15,7 +15,7 @@ const MealPage = props => {
strInstructions strInstructions
} = meal; } = meal;
let item = { const item = {
mealName: strMeal, mealName: strMeal,
imgAddress: strMealThumb, imgAddress: strMealThumb,
videoAddress: strYoutube, videoAddress: strYoutube,
@ -35,12 +35,12 @@ const MealPage = props => {
return ( return (
<div className="container"> <div className="container">
<MealPresentation meal={item} />
<div className="row"> <div className="row">
<div className="col s6"> <div className="col s6">
<IngredientList ingredients={ingredientList} /> <MealPresentation meal={item} />
</div> </div>
<div className="col s6"> <div className="col s6">
<IngredientList ingredients={ingredientList} />
<Recipe recipe={strInstructions} /> <Recipe recipe={strInstructions} />
</div> </div>
</div> </div>