Skip to content
Snippets Groups Projects
Commit ccbe661a authored by zh393's avatar zh393
Browse files

added more material-ui

parent b6b4ec6d
No related branches found
No related tags found
No related merge requests found
...@@ -15,16 +15,7 @@ function SelectedItems(props) { ...@@ -15,16 +15,7 @@ function SelectedItems(props) {
) )
} }
</List> </List>
// items = <ul>
// {props.data.map(ingredient =>
// <li key={ingredient.id}>
// {ingredient.name} {ingredient.id}
// </li>
// )
// }
// </ul>
} else { } else {
// items = <Typography variant ="p">Searching...</Typography>
items = <List> items = <List>
<ListItem> <ListItem>
<ListItemText <ListItemText
......
...@@ -28,13 +28,16 @@ function Recipe() { ...@@ -28,13 +28,16 @@ function Recipe() {
resp.then(r => setData(r.data)); resp.then(r => setData(r.data));
}, []) // eslint-disable-line react-hooks/exhaustive-deps }, []) // eslint-disable-line react-hooks/exhaustive-deps
let body = <p>Loading...</p>; let body = <Typography variant="p">Loading...</Typography>;
if (data.length !== 0) { if (data.length !== 0) {
let pattern = /<.+>/; let pattern = /<.+>/;
if (pattern.test(data.instructions)) { if (pattern.test(data.instructions)) {
body = parse(data.instructions) body = parse(data.instructions)
} else { } else if (data.instructions === "" || data.instructions === null){
body = <p>{data.instructions}</p>; body = <Typography variant="p">No instructions :(</Typography>
}
else {
body = <Typography variant="p">{data.instructions}</Typography>;
} }
} }
......
...@@ -37,7 +37,15 @@ function Results() { ...@@ -37,7 +37,15 @@ function Results() {
const recipeComponent = recipes.map(recipe => const recipeComponent = recipes.map(recipe =>
<Link to={"/recipe/" + recipe.id}> <Link to={"/recipe/" + recipe.id}>
<h3 key={recipe.id}>{recipe.title}</h3> <Typography
variant="h5"
key={recipe.id}
sx = {{
mb: 2
}}
>
{recipe.title}
</Typography>
</Link> </Link>
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment