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 | 40b3a4dc706849492123e41e57b0207cb95b9312 (patch) | |
tree | 4c365753d702750cab5bca4eecaa5a163fef7f5d /extension/react-app/src/components | |
parent | c873c511cd148b8e80044671dcd47d0da8374d3a (diff) | |
download | sncontinue-40b3a4dc706849492123e41e57b0207cb95b9312.tar.gz sncontinue-40b3a4dc706849492123e41e57b0207cb95b9312.tar.bz2 sncontinue-40b3a4dc706849492123e41e57b0207cb95b9312.zip |
initial code
Diffstat (limited to 'extension/react-app/src/components')
-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 |