@@ -17,6 +17,7 @@ import CodeSandboxIcon from '../../common/CodeSandboxIcon';
17
17
import EditButton from '../../common/EditButton' ;
18
18
import ExternalLinkIcon from '../../common/ExternalLinkIcon' ;
19
19
import RiddleIcon from '../../common/RiddleIcon' ;
20
+ import DemoContext from '../../slots/DemoContext' ;
20
21
import type { SiteContextProps } from '../../slots/SiteContext' ;
21
22
import SiteContext from '../../slots/SiteContext' ;
22
23
import { ping } from '../../utils' ;
@@ -107,6 +108,7 @@ const CodePreviewer: React.FC<AntdPreviewerProps> = (props) => {
107
108
clientOnly,
108
109
pkgDependencyList,
109
110
} = props ;
111
+ const { showDebug } = useContext ( DemoContext ) ;
110
112
111
113
const { pkg } = useSiteData ( ) ;
112
114
const location = useLocation ( ) ;
@@ -469,26 +471,28 @@ createRoot(document.getElementById('container')).render(<Demo />);
469
471
< CodePenIcon className = "code-box-codepen" />
470
472
</ Tooltip >
471
473
</ form >
472
- < form
473
- className = "code-box-code-action"
474
- action = "https://codesandbox.io/api/v1/sandboxes/define"
475
- method = "POST"
476
- target = "_blank"
477
- ref = { codeSandboxIconRef }
478
- onClick = { ( ) => {
479
- track ( { type : 'codesandbox' , demo : asset . id } ) ;
480
- codeSandboxIconRef . current ?. submit ( ) ;
481
- } }
482
- >
483
- < input
484
- type = "hidden"
485
- name = "parameters"
486
- value = { compress ( JSON . stringify ( codesanboxPrefillConfig ) ) }
487
- />
488
- < Tooltip title = { < FormattedMessage id = "app.demo.codesandbox" /> } >
489
- < CodeSandboxIcon className = "code-box-codesandbox" />
490
- </ Tooltip >
491
- </ form >
474
+ { showDebug && (
475
+ < form
476
+ className = "code-box-code-action"
477
+ action = "https://codesandbox.io/api/v1/sandboxes/define"
478
+ method = "POST"
479
+ target = "_blank"
480
+ ref = { codeSandboxIconRef }
481
+ onClick = { ( ) => {
482
+ track ( { type : 'codesandbox' , demo : asset . id } ) ;
483
+ codeSandboxIconRef . current ?. submit ( ) ;
484
+ } }
485
+ >
486
+ < input
487
+ type = "hidden"
488
+ name = "parameters"
489
+ value = { compress ( JSON . stringify ( codesanboxPrefillConfig ) ) }
490
+ />
491
+ < Tooltip title = { < FormattedMessage id = "app.demo.codesandbox" /> } >
492
+ < CodeSandboxIcon className = "code-box-codesandbox" />
493
+ </ Tooltip >
494
+ </ form >
495
+ ) }
492
496
< Tooltip title = { < FormattedMessage id = "app.demo.separate" /> } >
493
497
< a
494
498
className = "code-box-code-action"
0 commit comments