Skip to content

Commit 0ae7c89

Browse files
committed
emotion: SyntaxHighlighter
1 parent 5a49ded commit 0ae7c89

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

site/src/components/SyntaxHighlighter/SyntaxHighlighter.tsx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { ComponentProps, FC } from "react";
1+
import { type ComponentProps, type FC } from "react";
22
import Editor, { DiffEditor, loader } from "@monaco-editor/react";
33
import * as monaco from "monaco-editor";
44
import { useCoderTheme } from "./coderTheme";
5-
import { makeStyles } from "@mui/styles";
65

76
loader.config({ monaco });
87

@@ -13,7 +12,6 @@ export const SyntaxHighlighter: FC<{
1312
ComponentProps<typeof DiffEditor>;
1413
compareWith?: string;
1514
}> = ({ value, compareWith, language, editorProps }) => {
16-
const styles = useStyles();
1715
const hasDiff = compareWith && value !== compareWith;
1816
const coderTheme = useCoderTheme();
1917
const commonProps = {
@@ -35,7 +33,13 @@ export const SyntaxHighlighter: FC<{
3533
}
3634

3735
return (
38-
<div className={styles.wrapper}>
36+
<div
37+
css={(theme) => ({
38+
padding: theme.spacing(1, 0),
39+
background: theme.palette.background.paper,
40+
height: "100%",
41+
})}
42+
>
3943
{hasDiff ? (
4044
<DiffEditor original={compareWith} modified={value} {...commonProps} />
4145
) : (
@@ -44,11 +48,3 @@ export const SyntaxHighlighter: FC<{
4448
</div>
4549
);
4650
};
47-
48-
const useStyles = makeStyles((theme) => ({
49-
wrapper: {
50-
padding: theme.spacing(1, 0),
51-
background: theme.palette.background.paper,
52-
height: "100%",
53-
},
54-
}));

0 commit comments

Comments
 (0)