Skip to content

Commit

Permalink
fix: tags are rendered if something is written
Browse files Browse the repository at this point in the history
  • Loading branch information
woile committed Aug 31, 2024
1 parent 14d6bdc commit 522f419
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/assets/react.svg

This file was deleted.

9 changes: 6 additions & 3 deletions src/components/recipe-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export default function RecipeCard({ parsedRecipe, rawRecipe }: RecipeProps) {
parsedRecipe.metadata
?.get("tags")
?.split(",")
.map((t) => t.trim()) || [];
.filter((v) => !!v) || [];

return (
<div className="relative rounded-md border bg-muted p-6 ">
<div className="absolute top-0 right-0 pt-3 pr-3">
Expand Down Expand Up @@ -44,7 +45,9 @@ export default function RecipeCard({ parsedRecipe, rawRecipe }: RecipeProps) {
<span>
{ref.quantity} {ref.unit}
</span>{" "}
<RecipeRef baseUrl={BASE_URL} path={ref.name}>{ref.name}</RecipeRef>
<RecipeRef baseUrl={BASE_URL} path={ref.name}>
{ref.name}
</RecipeRef>
</li>
))}
</ul>
Expand All @@ -66,7 +69,7 @@ export default function RecipeCard({ parsedRecipe, rawRecipe }: RecipeProps) {
{parsedRecipe.tokens?.length > 0 && (
<div className="recipe-content whitespace-pre text-wrap">
<h2 className="text-lg font-semibold mb-2 ">Instructions</h2>
<Instructions tokens={parsedRecipe.tokens} baseUrl={BASE_URL}/>
<Instructions tokens={parsedRecipe.tokens} baseUrl={BASE_URL} />
</div>
)}
<div className="flex flex-wrap gap-2 pt-12">
Expand Down

0 comments on commit 522f419

Please sign in to comment.