Skip to content

Commit

Permalink
semantic cards functioning properly
Browse files Browse the repository at this point in the history
  • Loading branch information
loren-michael committed May 18, 2022
1 parent 5256692 commit 5ac55f8
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 7 deletions.
27 changes: 27 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"semantic-ui-card": "^2.3.1",
"semantic-ui-css": "^2.4.1",
"semantic-ui-react": "^2.1.2",
"web-vitals": "^2.1.4"
},
Expand Down
4 changes: 1 addition & 3 deletions src/components/RecipeCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ function RecipeCard({ recipe, onRecDetails }) {


return (
<div className="ui link cards">
<Card className="ui cards" >
<Card>
<div className="image" >
<img src={recipe.img} alt={recipe.name} />
</div>
Expand All @@ -31,7 +30,6 @@ function RecipeCard({ recipe, onRecDetails }) {
</span>
</div>
</Card>
</div>
)

};
Expand Down
18 changes: 14 additions & 4 deletions src/components/RecipeContainer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react"
import { Card } from "semantic-ui-react";
import RecipeCard from "./RecipeCard"

function RecipeContainer({ recipes, onRecDetails }) {
Expand All @@ -10,12 +11,21 @@ function RecipeContainer({ recipes, onRecDetails }) {
// )
// })
// )
const renderRecipes = Object.keys(recipes).map((recipeId) => (
<RecipeCard key={recipeId} recipe={recipeId} onRecDetails={onRecDetails} />
))
// const renderRecipes = Object.keys(recipes).map((recipe) => (
// <Card.Group>
// <RecipeCard key={recipe.id} recipe={recipe} onRecDetails={onRecDetails} />
// </Card.Group>
// ))

return (
<ul>{renderRecipes}</ul>
<div className="ui centered link cards" id="rec-container" >
{recipes.map((recipe) => {
return (
<RecipeCard key={recipe.id} recipe={recipe} onRecDetails={onRecDetails} />
)
})}
</div>

)


Expand Down
5 changes: 5 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}

#rec-container {
margin-top: 20px;
}

0 comments on commit 5ac55f8

Please sign in to comment.