File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change
1
+ import { useLocation } from "@docusaurus/router" ;
1
2
import type { WrapperProps } from "@docusaurus/types" ;
2
3
import DocSidebar from "@theme-original/DocSidebar" ;
3
4
import type DocSidebarType from "@theme/DocSidebar" ;
4
5
import React , { type ReactNode } from "react" ;
5
6
6
7
export function Carbon ( ) {
7
8
const ref = React . useRef < HTMLDivElement > ( null ! ) ;
9
+ const location = useLocation ( ) ;
10
+ if ( process . env . NODE_ENV === "development" ) {
11
+ return null ;
12
+ }
8
13
9
14
React . useEffect ( ( ) => {
10
15
const serve = "CW7IP27L" ;
@@ -14,7 +19,7 @@ export function Carbon() {
14
19
s . id = "_carbonads_js" ;
15
20
s . src = `//cdn.carbonads.com/carbon.js?serve=${ serve } &placement=${ placement } ` ;
16
21
ref . current . appendChild ( s ) ;
17
- } , [ ] ) ;
22
+ } , [ location ] ) ;
18
23
19
24
return (
20
25
< >
@@ -78,11 +83,10 @@ export function Carbon() {
78
83
}
79
84
` }
80
85
</ style >
81
- < div className = "ml-auto flex flex-col space-y-4 argos-ignore" >
82
- < div className = "bg-white dark:bg-black/40 border-gray-500/20 shadow-xl flex flex-col border-t border-l border-b p-4 space-y-2 rounded-l-lg" >
83
- < div ref = { ref } className = "carbon-outer" />
84
- </ div >
85
- </ div >
86
+ < div
87
+ ref = { ref }
88
+ className = "bg-background shadow-xl flex flex-col m-4 space-y-2 rounded-l-lg carbon-outer"
89
+ />
86
90
</ >
87
91
) ;
88
92
}
You can’t perform that action at this time.
0 commit comments