Skip to content

Commit 2b03c59

Browse files
authored
fix: Changelog trigger and minor visual bugs (#6567)
fix: changelog index and mobile issues
1 parent cb3d05f commit 2b03c59

File tree

7 files changed

+41
-14
lines changed

7 files changed

+41
-14
lines changed

components/Common/Badge/index.module.css

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
border
2121
px-2.5
2222
py-0.5
23+
text-center
2324
text-white;
2425
}
2526

components/Downloads/ChangelogModal/index.module.css

+5
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,10 @@
8989
pre {
9090
@apply overflow-auto;
9191
}
92+
93+
code,
94+
a {
95+
@apply break-words;
96+
}
9297
}
9398
}

components/Downloads/Release/ChangelogLink.tsx

+8-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@ const ChangelogLink: FC<PropsWithChildren> = ({ children }) => {
1010
const { modalOpen, setModalOpen } = useContext(ReleaseContext);
1111

1212
return (
13-
<button onClick={() => setModalOpen(!modalOpen)}>
14-
<LinkWithArrow className="cursor-pointer">{children}</LinkWithArrow>
15-
</button>
13+
<LinkWithArrow asChild>
14+
<button
15+
className="anchor cursor-pointer"
16+
onClick={() => setModalOpen(!modalOpen)}
17+
>
18+
{children}
19+
</button>
20+
</LinkWithArrow>
1621
);
1722
};
1823

Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
11
import { ArrowUpRightIcon } from '@heroicons/react/24/solid';
2-
import type { ComponentProps, FC } from 'react';
2+
import type { SlotProps } from '@radix-ui/react-slot';
3+
import { Slot } from '@radix-ui/react-slot';
4+
import type { ComponentProps, FC, PropsWithChildren } from 'react';
35

46
import Link from '@/components/Link';
57

6-
const LinkWithArrow: FC<ComponentProps<typeof Link>> = ({
8+
type LinkWithArrowProps =
9+
| ({ asChild?: false } & ComponentProps<typeof Link>)
10+
| ({ asChild: true } & SlotProps);
11+
12+
const LinkWithArrow: FC<PropsWithChildren<LinkWithArrowProps>> = ({
713
children,
14+
asChild = false,
815
...props
9-
}) => (
10-
<Link {...props}>
11-
{children}
12-
<ArrowUpRightIcon className="ml-1 inline w-3 fill-neutral-600 dark:fill-white" />
13-
</Link>
14-
);
16+
}) => {
17+
const Comp = asChild ? Slot : Link;
18+
19+
return (
20+
<Comp {...props}>
21+
<>
22+
{children}
23+
<ArrowUpRightIcon className="ml-1 inline w-3 fill-neutral-600 dark:fill-white" />
24+
</>
25+
</Comp>
26+
);
27+
};
1528

1629
export default LinkWithArrow;

package-lock.json

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"@radix-ui/react-label": "^2.0.2",
5050
"@radix-ui/react-scroll-area": "^1.0.5",
5151
"@radix-ui/react-select": "^2.0.0",
52+
"@radix-ui/react-slot": "^1.0.2",
5253
"@radix-ui/react-tabs": "^1.0.4",
5354
"@radix-ui/react-toast": "^1.1.5",
5455
"@savvywombat/tailwindcss-grid-areas": "~4.0.0",

styles/markdown.css

+4-3
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,19 @@ main {
7575
dark:text-white;
7676
}
7777

78-
a {
78+
a,
79+
.anchor {
7980
@apply text-green-600
8081
dark:text-green-400
81-
xs:underline;
82+
xs:font-semibold;
8283

8384
&:hover {
8485
@apply text-green-900
8586
dark:text-green-300;
8687
}
8788

8889
&[role='button'] {
89-
@apply xs:no-underline;
90+
@apply xs:font-regular;
9091
}
9192

9293
&:has(code) {

0 commit comments

Comments
 (0)