mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-18 18:55:54 +08:00
(ui): Reduce bundle size by using light syntax-highlighter
This commit is contained in:
parent
d0a8b6b691
commit
bb26dda300
@ -1,6 +1,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTheme, Theme } from "@material-ui/core/styles";
|
import { useTheme, Theme } from "@material-ui/core/styles";
|
||||||
import ReactSyntaxHighlighter from "react-syntax-highlighter";
|
import { Light as ReactSyntaxHighlighter } from "react-syntax-highlighter";
|
||||||
|
import json from "react-syntax-highlighter/dist/esm/languages/hljs/json";
|
||||||
import styleDark from "react-syntax-highlighter/dist/esm/styles/hljs/atom-one-dark";
|
import styleDark from "react-syntax-highlighter/dist/esm/styles/hljs/atom-one-dark";
|
||||||
import styleLight from "react-syntax-highlighter/dist/esm/styles/hljs/atom-one-light";
|
import styleLight from "react-syntax-highlighter/dist/esm/styles/hljs/atom-one-light";
|
||||||
import { isDarkTheme } from "../theme";
|
import { isDarkTheme } from "../theme";
|
||||||
@ -11,6 +12,8 @@ interface Props {
|
|||||||
customStyle?: object;
|
customStyle?: object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReactSyntaxHighlighter.registerLanguage("json", json);
|
||||||
|
|
||||||
// Theme aware syntax-highlighter component.
|
// Theme aware syntax-highlighter component.
|
||||||
export default function SyntaxHighlighter(props: Props) {
|
export default function SyntaxHighlighter(props: Props) {
|
||||||
const theme = useTheme<Theme>();
|
const theme = useTheme<Theme>();
|
||||||
|
Loading…
Reference in New Issue
Block a user