Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit 5e5fff3

Browse files
update the card UI
1 parent ce1cf71 commit 5e5fff3

File tree

1 file changed

+26
-22
lines changed
  • packages/section-blog-theme/components/Card

1 file changed

+26
-22
lines changed
Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
11
import Link from "next/link";
22
import type { authorType } from "@/src/types"
3+
34
export function ArticleCard({ title, description, date, tag, URL, author }: { title: string; description: string; date: string; tag: string[] | undefined; URL: string; author?: string | authorType; }) {
45
return (
5-
<Link href={URL}>
6-
<div className="my-16 container border-foreground/60 dark:border-foreground flex-row flex max-[479px]">
7-
<div className="px-0 sm:px-8">
8-
<h1 className="text-2xl lg:text-4xl font-bold mb-1 lg:mb-1">{title}</h1>
9-
<p className="text-ellipsis text-md lg:text-lg mb-2 md:mb-2 lg:mb-3">{description}</p>
10-
<div className="mt-1 text-xs sm:text-sm">
11-
{
12-
typeof author === 'string' ? <span>Published By {author}</span> : typeof author === 'object' ? <span>Published By {author.name}</span> : ""}{tag && tag.length > 0
13-
? (
14-
<span className="capitalize">
15-
{tag[0]}
16-
</span>
17-
)
18-
: ""}<time
19-
dateTime={date}
20-
title={date}
21-
>
22-
{date}
23-
</time>
24-
</div>
6+
<article className="p-6 bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700">
7+
<div className="flex justify-between items-center mb-5 text-gray-500">
8+
{ tag && tag.length > 0
9+
? (
10+
<span className="bg-[#1E429F] px-2.5 py-0.5 text-white text-xs font-medium inline-flex items-center rounded">
11+
{tag[0]}
12+
</span>
13+
)
14+
: ""}
15+
<time className="text-sm" dateTime={date} title={date}>
16+
{date}
17+
</time>
18+
</div>
19+
<h2 className="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white"> <Link href={URL}>{title}</Link> </h2>
20+
<p className="mb-5 font-light">{description}</p>
21+
22+
<div className="flex justify-between items-center">
23+
<div className="flex items-center space-x-4">
24+
{typeof author === 'string' ? <span className="font-medium text-black dark:text-white"> {author}</span> : typeof author === 'object' ? <span className="font-medium dark:text-white"> {author.name}</span> : ""}
2525
</div>
26+
<Link href={URL} className="inline-flex items-center font-medium">
27+
Read More
28+
</Link>
2629
</div>
27-
</Link>
30+
</article>
2831
);
29-
}
32+
33+
}

0 commit comments

Comments
 (0)