mirror of
https://github.com/rjNemo/meal_planner
synced 2026-06-06 02:26:49 +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
|
||||
- [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)
|
||||
- Hosting: anywhere
|
||||
- Hosting: [Render](https://render.com/)
|
||||
|
||||
## Versions
|
||||
|
||||
|
|
|
|||
|
|
@ -166,7 +166,6 @@ const App = () => {
|
|||
<SearchPage
|
||||
searchString={searchString}
|
||||
searchResults={searchResults}
|
||||
// getSearchResults={getSearchResults}
|
||||
/>
|
||||
</Route>
|
||||
<Route path="/:idMeal">
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ const CategoryEntry = props => {
|
|||
return (
|
||||
<div className="row">
|
||||
<Link to={`${url}/${strCategory}`}>
|
||||
<li key={props.i}>
|
||||
<li>
|
||||
<img src={strCategoryThumb} alt={strCategory} />
|
||||
<h3>{strCategory}</h3> {strCategoryDescription}
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ const SearchBar = props => {
|
|||
return (
|
||||
<div className="row">
|
||||
<input
|
||||
className="input-field col s9"
|
||||
className="input-field col s10"
|
||||
type="text"
|
||||
name="search"
|
||||
value={props.searchString}
|
||||
|
|
@ -14,15 +14,13 @@ const SearchBar = props => {
|
|||
/>
|
||||
<Link to="/search">
|
||||
<button
|
||||
className="btn waves-effect waves-light right"
|
||||
className="btn-floating waves-effect waves-light right "
|
||||
type="submit"
|
||||
name="searchButton"
|
||||
value="Search"
|
||||
onClick={props.onSubmit}
|
||||
>
|
||||
{" "}
|
||||
Search
|
||||
<i class="material-icons right">send</i>
|
||||
<i className="material-icons right">send</i>
|
||||
</button>
|
||||
</Link>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ const CategoryListPage = props => {
|
|||
<h1>The Chef's Meal Categories</h1>
|
||||
<ul>
|
||||
{categories.map((category, i) => (
|
||||
<CategoryEntry i={i} category={category} />
|
||||
<CategoryEntry key={i} category={category} />
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ const SearchPage = props => {
|
|||
const { meals } = props.searchResults;
|
||||
const { searchString } = props;
|
||||
|
||||
// console.log(meals[0]);
|
||||
return (
|
||||
<div className="container">
|
||||
<h1>Search Results for: {searchString} </h1>
|
||||
|
|
|
|||
Loading…
Reference in a new issue