aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dev-tools-pages/ts/components/Code.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/dev-tools-pages/ts/components/Code.tsx')
-rw-r--r--packages/dev-tools-pages/ts/components/Code.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/dev-tools-pages/ts/components/Code.tsx b/packages/dev-tools-pages/ts/components/Code.tsx
index 44d1cb99c..72b3e1af7 100644
--- a/packages/dev-tools-pages/ts/components/Code.tsx
+++ b/packages/dev-tools-pages/ts/components/Code.tsx
@@ -69,8 +69,8 @@ class Code extends React.Component<CodeProps, CodeState> {
const { language, children } = this.props;
if (language !== undefined) {
- const { highlight } = await import(/* webpackChunkName: 'highlight.js' */ 'highlight.js');
- const { value: hlCode } = highlight(language, children as string);
+ const { default: hljs } = await System.import(/* webpackChunkName: 'highlightjs' */ 'ts/highlight');
+ const { value: hlCode } = hljs.highlight(language, children as string);
this.setState({ hlCode });
}
}
@@ -103,7 +103,7 @@ class Code extends React.Component<CodeProps, CodeState> {
<StyledCode>{this.props.children}</StyledCode>
)}
</StyledPre>
- <Button onClick={this.handleCopy}>Copy</Button>
+ {navigator.userAgent !== 'ReactSnap' ? <Button onClick={this.handleCopy}>Copy</Button> : null}
{!('clipboard' in navigator) ? (
<CopyInput readOnly aria-hidden="true" ref={this.code} value={children} />
) : null}