File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ import type { WrapperProps } from "@docusaurus/types" ;
2
+ import DocSidebar from "@theme-original/DocSidebar" ;
3
+ import type DocSidebarType from "@theme/DocSidebar" ;
4
+ import React , { type ReactNode } from "react" ;
5
+
6
+ function Carbon ( ) {
7
+ const ref = React . useRef < HTMLDivElement > ( null ! ) ;
8
+
9
+ React . useEffect ( ( ) => {
10
+ const serve = "CW7IP27L" ;
11
+ const placement = "homarrdev" ;
12
+ ref . current . innerHTML = "" ;
13
+ const s = document . createElement ( "script" ) ;
14
+ s . id = "_carbonads_js" ;
15
+ s . src = `//cdn.carbonads.com/carbon.js?serve=${ serve } &placement=${ placement } ` ;
16
+ ref . current . appendChild ( s ) ;
17
+ } , [ ] ) ;
18
+
19
+ return < div ref = { ref } className = "carbon-outer h-[299px]" /> ;
20
+ }
21
+
22
+ type Props = WrapperProps < typeof DocSidebarType > ;
23
+
24
+ export default function DocSidebarWrapper ( props : Props ) : ReactNode {
25
+ return (
26
+ < div >
27
+ < DocSidebar { ...props } />
28
+ < Carbon />
29
+ </ div >
30
+ ) ;
31
+ }
You can’t perform that action at this time.
0 commit comments