@@ -8,6 +8,8 @@ import { FaFacebook, FaFilePdf, FaLinkedin } from 'react-icons/fa'
8
8
import { DocTracingBeam } from './DocTracingBeam'
9
9
import { BASE_URL } from '@/lib/constants'
10
10
import { title } from 'radash'
11
+ import { Button } from '../ui/button'
12
+ import { GitHubIcon } from '../icons/GitHubIcon'
11
13
12
14
interface Props {
13
15
doc : Doc
@@ -24,30 +26,21 @@ const DocToC: React.FC<Props> = ({ doc }) => {
24
26
const articleRef = useRef < HTMLDivElement > ( null )
25
27
26
28
return (
27
- < div className = "h-full min-w-40 " ref = { articleRef } >
29
+ < div className = "h-full min-w-52 " ref = { articleRef } >
28
30
< aside className = "sticky top-[calc(var(--header-height)+1px+2rem)] hidden max-h-[calc(100vh-var(--header-height)-3rem)] min-w-40 space-y-6 md:block" >
29
- { /* <div className="flex flex-wrap gap-2">
30
- {post.categories.map((category) => (
31
- <Link key={category} href={`/blog/category/${category}`}>
32
- <Badge variant="outline" className="bg-zinc-600/10">
33
- {title(category)}
34
- </Badge>
35
- </Link>
36
- ))}
37
- </div> */ }
38
31
{ doc . toc . length ? (
39
32
< div className = "relative flex flex-col" >
40
- < p className = "mb-2 font-mono text-sm uppercase text-zinc-300" >
33
+ < p className = "mb-2 font-mono text-sm uppercase dark: text-zinc-300" >
41
34
On this page
42
35
</ p >
43
36
< DocTracingBeam targetRef = { articleRef } >
44
- < ol className = "flex flex-col gap-y-1 pl-4 text-sm font-medium text-zinc-300 " >
37
+ < ol className = "flex flex-col gap-y-1 pl-4 text-sm font-medium" >
45
38
{ doc . toc . map ( ( item : Toc , i : number ) => {
46
39
return (
47
40
< li key = { item . url + i } >
48
41
< Link
49
42
href = { item . url }
50
- className = "text-2xs transition-colors hover:text-zinc-200"
43
+ className = "text-2xs text-muted-foreground transition-colors hover:text-zinc-900 dark: hover:text-zinc-200"
51
44
>
52
45
{ item . value }
53
46
</ Link >
@@ -58,23 +51,19 @@ const DocToC: React.FC<Props> = ({ doc }) => {
58
51
</ DocTracingBeam >
59
52
</ div >
60
53
) : null }
61
-
62
- { /* <div>
63
- <p className="mb-2 text-sm">Share</p>
64
- <div className="flex gap-2">
65
- {socials.map((social) => (
66
- <Link
67
- rel="noopener noreferrer"
68
- target="_blank"
69
- key={social.href}
70
- aria-label={`Share on ${social.name}`}
71
- href={social.href}
72
- >
73
- <social.icon className="size-5 text-zinc-300 transition-colors hover:text-zinc-100" />
74
- </Link>
75
- ))}
76
- </div>
77
- </div> */ }
54
+ < div >
55
+ < Button asChild variant = "unstyled" >
56
+ < a
57
+ href = { doc . editUrl }
58
+ target = "_blank"
59
+ rel = "noopener noreferrer"
60
+ className = "group flex items-center gap-x-2 text-xs dark:text-zinc-300 dark:hover:text-white"
61
+ >
62
+ < GitHubIcon className = "h-5 w-5 fill-zinc-800 transition group-hover:fill-zinc-900 dark:fill-zinc-300 dark:group-hover:fill-white" />
63
+ Edit this page on GitHub
64
+ </ a >
65
+ </ Button >
66
+ </ div >
78
67
</ aside >
79
68
</ div >
80
69
)
0 commit comments