Skip to content

Commit 9ebe591

Browse files
committed
feat: wrap featured article items with card
1 parent 462efa4 commit 9ebe591

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

src/components/home/featured-articles.tsx

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -32,38 +32,38 @@ export const FeaturedArticles: FC<FeaturedArticlesProps> = async (props) => {
3232
<Flex direction="column" gap="8">
3333
{articles.map(
3434
({ id, createdAt, coverPhoto, slug, title, description }) => (
35-
<Flex
36-
key={id}
37-
asChild
38-
align="start"
39-
direction={{ initial: 'column-reverse', sm: 'row' }}
40-
gap="4"
41-
>
35+
<Card key={id} asChild variant="ghost">
4236
<Link href={`${routes.blog.pathname}/${slug}`}>
43-
<Card className="shrink-0">
44-
<Inset>
45-
{coverPhoto ? (
46-
<Image
47-
alt={title}
48-
className="h-[108px] w-[192px] sm:h-[90px] sm:w-[160px]"
49-
height={9 * 12}
50-
src={coverPhoto}
51-
width={16 * 12}
52-
/>
53-
) : null}
54-
</Inset>
55-
</Card>
56-
<Flex direction="column" gap="2">
57-
<Heading as="h3" size="4">
58-
{title}
59-
</Heading>
60-
<Text as="p">{description}</Text>
61-
<Text color="gray" size="2">
62-
{dateFormatter.format(new Date(createdAt))}
63-
</Text>
37+
<Flex
38+
align="start"
39+
direction={{ initial: 'column-reverse', sm: 'row' }}
40+
gap="4"
41+
>
42+
<Card className="shrink-0">
43+
<Inset>
44+
{coverPhoto ? (
45+
<Image
46+
alt={title}
47+
className="h-[108px] w-[192px] sm:h-[90px] sm:w-[160px]"
48+
height={9 * 12}
49+
src={coverPhoto}
50+
width={16 * 12}
51+
/>
52+
) : null}
53+
</Inset>
54+
</Card>
55+
<Flex direction="column" gap="2">
56+
<Heading as="h3" size="4">
57+
{title}
58+
</Heading>
59+
<Text as="p">{description}</Text>
60+
<Text color="gray" size="2">
61+
{dateFormatter.format(new Date(createdAt))}
62+
</Text>
63+
</Flex>
6464
</Flex>
6565
</Link>
66-
</Flex>
66+
</Card>
6767
),
6868
)}
6969
</Flex>

0 commit comments

Comments
 (0)