This repository was archived by the owner on May 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -45,10 +45,7 @@ export function CodeTabs(props: {
45
45
value = { tab . meta }
46
46
className = "m-0 border-t border-zinc-300/10"
47
47
>
48
- < Pre
49
- highlighted = { highlighted [ i ] }
50
- showPanel = { ! ! highlighted [ i ] . meta }
51
- />
48
+ < Pre highlighted = { highlighted [ i ] } copyButtonClassName = "top-12" />
52
49
</ TabsContent >
53
50
) ) }
54
51
</ Tabs >
Original file line number Diff line number Diff line change @@ -7,9 +7,11 @@ import { ClipboardIcon } from '../icons/ClipboardIcon'
7
7
export function CopyButton ( {
8
8
code,
9
9
showPanel,
10
+ className,
10
11
} : {
11
12
code : string
12
13
showPanel ?: boolean
14
+ className ?: string
13
15
} ) {
14
16
const [ copyCount , setCopyCount ] = useState ( 0 )
15
17
const copied = copyCount > 0
@@ -34,6 +36,7 @@ export function CopyButton({
34
36
: 'bg-white/5 ring-1 ring-inset ring-zinc-300/10 hover:bg-white/7.5 dark:bg-white/2.5 dark:hover:bg-white/5' ,
35
37
! showPanel &&
36
38
'opacity-0 focus:opacity-100 group-hover:opacity-100 group-focus:opacity-100' ,
39
+ className ,
37
40
) }
38
41
onClick = { ( ) => {
39
42
window . navigator . clipboard . writeText ( code ) . then ( ( ) => {
Original file line number Diff line number Diff line change @@ -20,13 +20,15 @@ type Props = {
20
20
highlighted : HighlightedCode
21
21
showPanel ?: boolean
22
22
className ?: string
23
+ copyButtonClassName ?: string
23
24
} & HandlerProps
24
25
25
26
const Pre : React . FC < Props > = ( {
26
27
highlighted,
27
28
showPanel,
28
29
enableTransitions,
29
30
className,
31
+ copyButtonClassName,
30
32
} ) => {
31
33
const fileName = highlighted . meta
32
34
@@ -46,7 +48,11 @@ const Pre: React.FC<Props> = ({
46
48
</ span >
47
49
</ div >
48
50
) }
49
- < CopyButton code = { highlighted . code } showPanel = { showPanel } />
51
+ < CopyButton
52
+ code = { highlighted . code }
53
+ showPanel = { showPanel }
54
+ className = { copyButtonClassName }
55
+ />
50
56
< CodeHikePre
51
57
code = { highlighted }
52
58
handlers = { handlers }
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export function NavigationGroup({
20
20
21
21
return (
22
22
< li className = { cn ( 'relative mt-6' , className ) } >
23
- < h2 className = "pl-2 text-xs font-semibold text-zinc-900 dark:text-white" >
23
+ < h2 className = "pl-2 text-2xs font-semibold text-zinc-900 dark:text-white" >
24
24
{ group . title }
25
25
</ h2 >
26
26
< div className = "relative mt-3" >
You can’t perform that action at this time.
0 commit comments