forked from bewildergeist/awp-spring-2022
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3340e9b
commit 3b0027d
Showing
11 changed files
with
106 additions
and
61 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,39 @@ | ||
{ | ||
"posts": [ | ||
"recipes": [ | ||
{ | ||
"id": "1", | ||
"title": "Post 1", | ||
"body": "This is test post #1" | ||
"title": "Pizza", | ||
"ingredients": [ | ||
"Pizza sauce", | ||
"cheese, pepperoni", | ||
"dressing" | ||
], | ||
"body": "This is your standard danish pizza" | ||
}, | ||
{ | ||
"id": "2", | ||
"title": "Post 2", | ||
"body": "This is test post #2" | ||
"title": "Lasagne", | ||
"ingredients": [ | ||
"Chopped tomatoes", | ||
"lasagne plates", | ||
"ground beef", | ||
"onions", | ||
"garlic", | ||
"cheese", | ||
"bechamel" | ||
], | ||
"body": "This is your standard lasagne" | ||
}, | ||
{ | ||
"id": "3", | ||
"title": "Post 3", | ||
"body": "This is test post #3" | ||
"title": "Gnocci", | ||
"ingredients": [ | ||
"Potatoes", | ||
"flour", | ||
"vegetables of your choice", | ||
"tomato sauce" | ||
], | ||
"body": "This is your standard gnocci" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
lesson-04/remix-site/app/routes/posts.jsx → lesson-04/remix-site/app/routes/recipes.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Link, useLoaderData } from "remix"; | ||
import db from "~/db/db.server.js"; | ||
|
||
export async function loader() { | ||
return db.data.recipes; | ||
} | ||
|
||
export default function RecipeItems() { | ||
const recipes = useLoaderData(); | ||
|
||
return ( | ||
<div> | ||
<div className="page-header"> | ||
<h1>Recipes</h1> | ||
<Link to="/recipes/new" className="btn"> | ||
New recipe | ||
</Link> | ||
</div> | ||
<ul className="posts-list"> | ||
{recipes.map((recipe) => ( | ||
<li key={recipe.id}> | ||
<Link to={recipe.id}> | ||
<h3>{recipe.title}</h3> | ||
</Link> | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.