File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /**
2+ * Wraps the original DocItem/TOC/Desktop to render the page-level
3+ * copy/AI dropdown above the "Contents" heading in the right sidebar.
4+ */
5+
6+ import React from 'react' ;
7+ import CopyPageButton from 'docusaurus-plugin-copy-page-button/react' ;
8+ import TOCDesktop from '@theme-original/DocItem/TOC/Desktop' ;
9+
10+ import styles from './styles.module.css' ;
11+
12+ export default function TOCDesktopWrapper ( ) : JSX . Element {
13+ return (
14+ < >
15+ < div className = { styles . copyPageAction } >
16+ < CopyPageButton
17+ customStyles = { {
18+ container : { className : styles . copyPageContainer } ,
19+ button : { className : styles . copyPageButton } ,
20+ dropdown : { className : styles . copyPageDropdown } ,
21+ } }
22+ />
23+ </ div >
24+ < TOCDesktop />
25+ </ >
26+ ) ;
27+ }
Original file line number Diff line number Diff line change 11.copyPageAction {
2- padding : 0 var ( --sidebar-spacing-horizontal ) 1rem ;
2+ margin-bottom : 1rem ;
33}
44
55.copyPageContainer {
Original file line number Diff line number Diff line change 88
99import React , { useEffect } from 'react' ;
1010import { useLocation } from '@docusaurus/router' ;
11- import CopyPageButton from 'docusaurus-plugin-copy-page-button/react' ;
1211import DocSidebar from '@theme-original/DocSidebar' ;
1312import type { Props } from '@theme/DocSidebar' ;
1413
1514import Logo from '@theme-original/Logo' ;
16- import styles from './styles.module.css' ;
1715
1816export default function DocSidebarWrapper ( props : Props ) : JSX . Element {
1917 const location = useLocation ( ) ;
@@ -30,15 +28,6 @@ export default function DocSidebarWrapper(props: Props): JSX.Element {
3028 return (
3129 < >
3230 < Logo />
33- < div className = { styles . copyPageAction } >
34- < CopyPageButton
35- customStyles = { {
36- container : { className : styles . copyPageContainer } ,
37- button : { className : styles . copyPageButton } ,
38- dropdown : { className : styles . copyPageDropdown } ,
39- } }
40- />
41- </ div >
4231 < DocSidebar { ...props } />
4332 </ >
4433 ) ;
You can’t perform that action at this time.
0 commit comments