Skip to content

Commit 59524cf

Browse files
committed
fix: changelog style
1 parent d98f241 commit 59524cf

File tree

2 files changed

+25
-18
lines changed

2 files changed

+25
-18
lines changed

components/changelog.tsx

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,39 @@ interface ChangelogProps {
1313
export function ChangelogComponent({ date, mdx, title, url }: ChangelogProps) {
1414
return (
1515
<div className="relative">
16-
<svg
17-
width="1px"
18-
height="100%"
19-
className="absolute left-4 sm:left-56 hidden sm:block"
20-
>
21-
<line
22-
x1="0"
23-
y1="1"
24-
x2="1"
25-
y2="100%"
26-
stroke="gray"
27-
strokeWidth="4"
28-
strokeDasharray="5, 10"
29-
/>
30-
</svg>
3116
<div className="relative w-full pb-4 pt-8 sm:pb-6 sm:pt-16">
32-
<div className="absolute left-5 sm:left-[220px] top-[50px] sm:top-[82px] w-2 h-2 bg-slate-500 rounded-xl hidden sm:block" />
3317
<div className="flex flex-col sm:flex-row">
3418
<div className="w-full sm:w-72 text-base sm:text-lg mb-2 sm:mt-2 text-left sm:text-right sm:pr-28 text-gray-400">
3519
{date}
3620
</div>
37-
21+
<div className="relative">
22+
<svg
23+
width="1px"
24+
height="calc(100% + 80px)"
25+
className="absolute left-0 sm:left-1/2 -translate-x-1/2 hidden sm:block top-[-20px]"
26+
style={{ left: "calc(50% - 56px)" }}
27+
>
28+
<line
29+
x1="0"
30+
y1="1"
31+
x2="1"
32+
y2="100%"
33+
stroke="gray"
34+
strokeWidth="4"
35+
strokeDasharray="5, 10"
36+
/>
37+
</svg>
38+
<div className="absolute left-0 sm:left-1/2 -translate-x-1/2 top-[50px] sm:top-[20px] w-2 h-2 bg-slate-500 rounded-xl hidden sm:block"
39+
style={{ left: "calc(50% - 56px)" }} />
40+
</div>
3841
<div className="flex-1">
3942
<Link className="text-2xl sm:text-4xl font-bold" href={url}>
4043
{title}
4144
</Link>
42-
{mdx}
45+
{/* code block min width */}
46+
<div className="min-w-[600px]">
47+
{mdx}
48+
</div>
4349
</div>
4450
</div>
4551
</div>

pages/changelog.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ return pages.map((page) => {
3434
const Mdx = dynamic(import(`pages/changelog/${page.name}.mdx`), {ssr: false})
3535
return (
3636
<ChangelogComponent
37+
key={page.frontMatter.title}
3738
date={page.frontMatter?.date}
3839
mdx={<Mdx />}
3940
title={page.frontMatter.title}

0 commit comments

Comments
 (0)