Skip to content

Commit 4f69aa6

Browse files
committed
refactor: improve AuthorArticles layout with responsive design and add link icon for social media
1 parent 14e03ae commit 4f69aa6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

app/authors/[author]/page.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
RiFacebookFill,
1414
RiLinkedinFill,
1515
RiDiscordFill,
16+
RiLink,
1617
} from "react-icons/ri";
1718

1819
type AuthorData = {
@@ -115,6 +116,7 @@ const SOCIAL_ICONS: { [key: string]: any } = {
115116
facebook: RiFacebookFill,
116117
linkedin: RiLinkedinFill,
117118
discord: RiDiscordFill,
119+
link: RiLink,
118120
};
119121

120122
// **Async page component**
@@ -191,23 +193,23 @@ function AuthorArticles({ articles }: { articles: ArticleData[] }) {
191193
return (
192194
<div className="grid md:grid-cols-2">
193195
{articles.map((article) => (
194-
<article className="flex items-center gap-2 md:gap-12 p-8 border border-white" key={article.uid}>
196+
<article className="flex flex-col sm:flex-row items-start sm:items-center gap-4 md:gap-12 p-8 border border-white" key={article.uid}>
195197
<Link href={`/posts/${article.slug}`} className="flex-shrink-0">
196198
<img
197-
className="h-[150px] w-[150px] object-cover hover:scale-105 transition-transform"
199+
className="h-[100px] w-[100px] sm:h-[150px] sm:w-[150px] object-cover hover:scale-105 transition-transform "
198200
src={article.img}
199201
alt={article.title}
200202
/>
201203
</Link>
202204

203205
<div>
204-
<p className="heading3-title pb-4">
206+
<p className="heading3-title pb-2 sm:pb-4">
205207
<Link href={`/posts/${article.slug}`} className="hover:text-white transition-colors">
206208
{article.title}
207209
</Link>
208210
</p>
209211

210-
<div className="flex flex-wrap gap-4">
212+
<div className="flex flex-wrap gap-2 sm:gap-4">
211213
<div className="flex items-center">
212214
<p className="font-semibold pr-2">Date:</p>
213215
<time dateTime={article.date.toISOString()} className="text-white">

0 commit comments

Comments
 (0)