diff options
author | Ty Dunn <ty@tydunn.com> | 2023-06-18 16:28:52 -0700 |
---|---|---|
committer | Ty Dunn <ty@tydunn.com> | 2023-06-18 16:28:52 -0700 |
commit | 130e2ea946ee52b9327fd37c76fc7cebfb15e64b (patch) | |
tree | 6ca49eeeb49b2c0b5db9da5758bf4266e6807370 /extension/react-app/src | |
parent | 9e37328557a348ebf1ba37f7a3f3e86832492007 (diff) | |
download | sncontinue-130e2ea946ee52b9327fd37c76fc7cebfb15e64b.tar.gz sncontinue-130e2ea946ee52b9327fd37c76fc7cebfb15e64b.tar.bz2 sncontinue-130e2ea946ee52b9327fd37c76fc7cebfb15e64b.zip |
initial code
Diffstat (limited to 'extension/react-app/src')
-rw-r--r-- | extension/react-app/src/components/CodeBlock.tsx | 4 | ||||
-rw-r--r-- | extension/react-app/src/components/StyledCode.tsx | 14 |
2 files changed, 16 insertions, 2 deletions
diff --git a/extension/react-app/src/components/CodeBlock.tsx b/extension/react-app/src/components/CodeBlock.tsx index c4524a51..a720a6ce 100644 --- a/extension/react-app/src/components/CodeBlock.tsx +++ b/extension/react-app/src/components/CodeBlock.tsx @@ -5,6 +5,8 @@ import { defaultBorderRadius, secondaryDark, vscBackground } from "."; import { Clipboard, CheckCircle } from "@styled-icons/heroicons-outline"; +import StyledCode from "./StyledCode"; + const StyledPre = styled.pre` overflow-y: scroll; word-wrap: normal; @@ -16,8 +18,6 @@ const StyledPre = styled.pre` padding-bottom: 16px; `; -const StyledCode = styled.code``; - const StyledCopyButton = styled.button<{ visible: boolean }>` /* position: relative; */ float: right; diff --git a/extension/react-app/src/components/StyledCode.tsx b/extension/react-app/src/components/StyledCode.tsx new file mode 100644 index 00000000..16183e7f --- /dev/null +++ b/extension/react-app/src/components/StyledCode.tsx @@ -0,0 +1,14 @@ +import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; +import { synthwave84 } from "react-syntax-highlighter/dist/esm/styles/prism"; + +interface StyledCodeProps { + children: string; +} + +const StyledCode = (props: (StyledCodeProps)) => ( + <SyntaxHighlighter language="auto" style={synthwave84}> + {props.children} + </SyntaxHighlighter> +); + +export default StyledCode;
\ No newline at end of file |