mirror of
https://github.com/rjNemo/meal_planner
synced 2026-06-12 13:26:45 +00:00
SearchBar & Page
This commit is contained in:
parent
a1462ed9e0
commit
0a9a00dbc3
6 changed files with 6 additions and 10 deletions
|
|
@ -67,7 +67,7 @@ Free meal planner for cooks short on ideas! (like me …)
|
||||||
- `React` client on the front-end
|
- `React` client on the front-end
|
||||||
- [Materialize](https://materializecss.com) CSS librairy for styling
|
- [Materialize](https://materializecss.com) CSS librairy for styling
|
||||||
- Public API: [TheMealDb](https://www.themealdb.com/api.php) and [TheCocktailDb](https://www.thecocktaildb.com/api.php)
|
- Public API: [TheMealDb](https://www.themealdb.com/api.php) and [TheCocktailDb](https://www.thecocktaildb.com/api.php)
|
||||||
- Hosting: anywhere
|
- Hosting: [Render](https://render.com/)
|
||||||
|
|
||||||
## Versions
|
## Versions
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,6 @@ const App = () => {
|
||||||
<SearchPage
|
<SearchPage
|
||||||
searchString={searchString}
|
searchString={searchString}
|
||||||
searchResults={searchResults}
|
searchResults={searchResults}
|
||||||
// getSearchResults={getSearchResults}
|
|
||||||
/>
|
/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="/:idMeal">
|
<Route path="/:idMeal">
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ const CategoryEntry = props => {
|
||||||
return (
|
return (
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<Link to={`${url}/${strCategory}`}>
|
<Link to={`${url}/${strCategory}`}>
|
||||||
<li key={props.i}>
|
<li>
|
||||||
<img src={strCategoryThumb} alt={strCategory} />
|
<img src={strCategoryThumb} alt={strCategory} />
|
||||||
<h3>{strCategory}</h3> {strCategoryDescription}
|
<h3>{strCategory}</h3> {strCategoryDescription}
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ const SearchBar = props => {
|
||||||
return (
|
return (
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<input
|
<input
|
||||||
className="input-field col s9"
|
className="input-field col s10"
|
||||||
type="text"
|
type="text"
|
||||||
name="search"
|
name="search"
|
||||||
value={props.searchString}
|
value={props.searchString}
|
||||||
|
|
@ -14,15 +14,13 @@ const SearchBar = props => {
|
||||||
/>
|
/>
|
||||||
<Link to="/search">
|
<Link to="/search">
|
||||||
<button
|
<button
|
||||||
className="btn waves-effect waves-light right"
|
className="btn-floating waves-effect waves-light right "
|
||||||
type="submit"
|
type="submit"
|
||||||
name="searchButton"
|
name="searchButton"
|
||||||
value="Search"
|
value="Search"
|
||||||
onClick={props.onSubmit}
|
onClick={props.onSubmit}
|
||||||
>
|
>
|
||||||
{" "}
|
<i className="material-icons right">send</i>
|
||||||
Search
|
|
||||||
<i class="material-icons right">send</i>
|
|
||||||
</button>
|
</button>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ const CategoryListPage = props => {
|
||||||
<h1>The Chef's Meal Categories</h1>
|
<h1>The Chef's Meal Categories</h1>
|
||||||
<ul>
|
<ul>
|
||||||
{categories.map((category, i) => (
|
{categories.map((category, i) => (
|
||||||
<CategoryEntry i={i} category={category} />
|
<CategoryEntry key={i} category={category} />
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ const SearchPage = props => {
|
||||||
const { meals } = props.searchResults;
|
const { meals } = props.searchResults;
|
||||||
const { searchString } = props;
|
const { searchString } = props;
|
||||||
|
|
||||||
// console.log(meals[0]);
|
|
||||||
return (
|
return (
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<h1>Search Results for: {searchString} </h1>
|
<h1>Search Results for: {searchString} </h1>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue