Skip to content

Commit

Permalink
Change markdown renderer components margins
Browse files Browse the repository at this point in the history
  • Loading branch information
T1LT committed Jan 19, 2024
1 parent 670047a commit 08d0266
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
8 changes: 2 additions & 6 deletions app/(recipes)/recipes/[item]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,11 @@ export default async function RecipeItem({
</div>
<div>
<h3 className="font-bold text-xl">Ingredients</h3>
<div className="mt-2">
<MarkdownRenderer>{recipe.ingredients}</MarkdownRenderer>
</div>
<MarkdownRenderer>{recipe.ingredients}</MarkdownRenderer>
</div>
<div>
<h3 className="font-bold text-xl">Procedure</h3>
<div className="mt-2">
<MarkdownRenderer>{recipe.procedure}</MarkdownRenderer>
</div>
<MarkdownRenderer>{recipe.procedure}</MarkdownRenderer>
</div>
</div>
);
Expand Down
1 change: 0 additions & 1 deletion app/(recipes)/recipes/like-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default function LikeButton({
userLiked,
(state, _) => !state,
);

const handleLike = async () => {
setOptimisticUserLiked(!userLiked);
await changeLike(recipeId, likes, optimisticUserLiked);
Expand Down
10 changes: 5 additions & 5 deletions components/markdown-renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ export const MarkdownRenderer: React.FC<MarkdownRendererProps> = ({
p: ({ children }) => <p className="my-2">{children}</p>,
img: () => null,
ul: ({ children }) => (
<ul className="list-disc flex flex-col gap-2 list-inside">
<ul className="list-disc flex flex-col gap-2 list-inside my-2">
{children}
</ul>
),
ol: ({ children }) => (
<ol className="list-decimal flex flex-col gap-2 list-inside">
<ol className="list-decimal flex flex-col gap-2 list-inside my-2">
{children}
</ol>
),
h1: ({ children }) => (
<h1 className="font-bold text-lg">{children}</h1>
<h1 className="font-bold text-lg my-1">{children}</h1>
),
h2: ({ children }) => (
<h2 className="font-bold text-base">{children}</h2>
<h2 className="font-bold text-base my-1">{children}</h2>
),
h3: ({ children }) => (
<h3 className="font-bold text-sm">{children}</h3>
<h3 className="font-bold text-sm my-1">{children}</h3>
),
},
}}
Expand Down

0 comments on commit 08d0266

Please sign in to comment.