Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit 1c991b8

Browse files
committed
refactor: improve BlogPost and ArticleCard components with better spacing and updated styles for visual clarity and consistency
1 parent 294c7d4 commit 1c991b8

File tree

2 files changed

+32
-28
lines changed

2 files changed

+32
-28
lines changed

app/sections/blog-post.tsx

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ const BlogPost = forwardRef<HTMLElement, BlogPostProps>((props, ref) => {
4747
<Image data={image} sizes="90vw" />
4848
</div>
4949
)}
50-
<article className="prose lg:max-w-4xl mx-auto py-4 lg:py-10">
51-
<div className="space-y-5 text-left">
52-
<h3 className="h3 leading-tight!">{title}</h3>
50+
<article className="prose lg:max-w-4xl mx-auto py-20">
51+
<div className="space-y-5 text-left mb-3">
52+
<h3 className="h3 !mt-0 !mb-8 leading-tight! !tracking-tighter font-normal">{title}</h3>
5353
{(formattedDate || author?.name) && (
5454
<span className="flex items-center text-[#918379] gap-0.5 text-[14px]">
5555
{formattedDate && author?.name ? (
@@ -69,29 +69,33 @@ const BlogPost = forwardRef<HTMLElement, BlogPostProps>((props, ref) => {
6969
suppressHydrationWarning
7070
dangerouslySetInnerHTML={{ __html: contentHtml }}
7171
/>
72-
<div className="border-t border-line-subtle w-1/3 mx-auto" />
73-
<div className="flex flex-col md:flex-row items-center justify-between gap-2">
74-
{showTags && (
75-
<div>
76-
<strong>Tags:</strong>
77-
<span className="ml-2">{tags.join(", ")}</span>
72+
{(showTags || showShareButtons) && (
73+
<>
74+
<div className="border-t border-line-subtle w-1/3 mx-auto" />
75+
<div className="flex flex-col md:flex-row items-center justify-between gap-2">
76+
{showTags && (
77+
<div>
78+
<strong>Tags:</strong>
79+
<span className="ml-2">{tags.join(", ")}</span>
80+
</div>
81+
)}
82+
{showShareButtons && (
83+
<div className="flex gap-2 items-center">
84+
<strong>Share:</strong>
85+
<FacebookShareButton url={articleUrl}>
86+
<FacebookLogoIcon size={24} />
87+
</FacebookShareButton>
88+
<PinterestShareButton url={articleUrl} media={image?.url}>
89+
<PinterestLogoIcon size={24} />
90+
</PinterestShareButton>
91+
<TwitterShareButton url={articleUrl} title={title}>
92+
<XLogoIcon size={24} />
93+
</TwitterShareButton>
94+
</div>
95+
)}
7896
</div>
79-
)}
80-
{showShareButtons && (
81-
<div className="flex gap-2 items-center">
82-
<strong>Share:</strong>
83-
<FacebookShareButton url={articleUrl}>
84-
<FacebookLogoIcon size={24} />
85-
</FacebookShareButton>
86-
<PinterestShareButton url={articleUrl} media={image?.url}>
87-
<PinterestLogoIcon size={24} />
88-
</PinterestShareButton>
89-
<TwitterShareButton url={articleUrl} title={title}>
90-
<XLogoIcon size={24} />
91-
</TwitterShareButton>
92-
</div>
93-
)}
94-
</div>
97+
</>
98+
)}
9599
</div>
96100
</article>
97101
</Section>

app/sections/blogs.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export function ArticleCard({
178178
</div>
179179
)}
180180
<div className="flex flex-col gap-3">
181-
<h5 className="font-normal text-(--accent-color) line-clamp-3">
181+
<h5 className="font-normal text-(--accent-color) line-clamp-3 tracking-tighter">
182182
{article.title}
183183
</h5>
184184
{showSeperator && (
@@ -190,7 +190,7 @@ export function ArticleCard({
190190
</p>
191191
)}
192192
{(showDate || showAuthor) && (
193-
<div className="flex mt-4 gap-1 text-(--accent-color) text-sm opacity-80">
193+
<div className="flex mt-4 gap-1 text-(--accent-color) opacity-80">
194194
{showDate && (
195195
<time>
196196
{new Date(article.publishedAt).toLocaleDateString("en-US", {
@@ -206,7 +206,7 @@ export function ArticleCard({
206206
)}
207207
{showReadmore && (
208208
<div className="mt-2">
209-
<span className="text-(--accent-color) text-sm underline opacity-80 hover:opacity-100 transition-opacity">
209+
<span className="text-(--accent-color) underline opacity-80 hover:opacity-100 transition-opacity uppercase">
210210
Read more →
211211
</span>
212212
</div>

0 commit comments

Comments
 (0)