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

Commit 43260e3

Browse files
committed
stop guide item date from overlapping title
1 parent 2311828 commit 43260e3

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

src/components/guides/GuideItem.tsx

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,27 @@ export const GuideItem: React.FC<Props> = ({ guide, featured }) => {
2121
>
2222
<div className="flex flex-col gap-y-4">
2323
<div>
24-
<time
25-
dateTime={guide.published_at}
26-
className="absolute right-0 top-0 m-3 text-2xs text-muted-foreground"
27-
>
28-
{new Date(guide.published_at).toLocaleDateString('en-US', {
29-
year: 'numeric',
30-
month: 'short',
31-
day: 'numeric',
32-
})}
33-
</time>
34-
<p
35-
className={cn(
36-
'font-display text-xl font-semibold',
37-
featured ? 'lg:text-2xl xl:text-3xl' : '',
38-
)}
39-
>
40-
{guide.title}
41-
</p>
24+
<div className="flex items-start justify-between gap-x-1">
25+
<p
26+
className={cn(
27+
'font-display text-xl font-semibold',
28+
featured ? 'lg:text-2xl xl:text-3xl' : '',
29+
)}
30+
>
31+
{guide.title}
32+
</p>
33+
<time
34+
dateTime={guide.published_at}
35+
className="text-nowrap text-2xs text-muted-foreground"
36+
>
37+
{new Date(guide.published_at).toLocaleDateString('en-US', {
38+
year: 'numeric',
39+
month: 'short',
40+
day: 'numeric',
41+
})}
42+
</time>
43+
</div>
44+
4245
<p
4346
className={cn(
4447
'text-md mt-3 text-base text-foreground dark:text-foreground-light',
@@ -50,11 +53,11 @@ export const GuideItem: React.FC<Props> = ({ guide, featured }) => {
5053
</div>
5154
<div className="flex">
5255
{guide.tags?.length ? (
53-
<div className="flex items-center gap-x-2">
56+
<div className="flex flex-wrap items-center gap-2">
5457
{guide.tags.map((tag) => (
5558
<span
5659
key={tag}
57-
className="inline-flex items-center rounded-md border bg-zinc-600/10 px-2.5 py-0.5 text-xs font-semibold text-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2"
60+
className="items-center rounded-md border bg-zinc-600/10 px-2.5 py-0.5 text-xs font-semibold text-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2"
5861
>
5962
{tag}
6063
</span>

0 commit comments

Comments
 (0)