Skip to content

Commit

Permalink
#110 change to more user friendly theme (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonatai committed Dec 18, 2023
1 parent fd5af75 commit 16e2be4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/shared/SyntaxHighlighter.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
import { Prism } from 'react-syntax-highlighter';
import { dracula } from 'react-syntax-highlighter/dist/esm/styles/prism';
import { gruvboxDark } from 'react-syntax-highlighter/dist/esm/styles/prism';

interface ISyntaxHighlighter {
code: string;
language: string;
}

/**
* Have no accessibility problems:
* a11yDark
* coldarkDark
* gruvboxDark
*/

export const SyntaxHighlighter = (props: ISyntaxHighlighter): JSX.Element => {
const { code, language } = props;

return (
<Prism language={language} style={dracula} showLineNumbers>
<Prism language={language} style={gruvboxDark} showLineNumbers>
{code.replace(/\n$/, '')}
</Prism>
);
Expand Down

0 comments on commit 16e2be4

Please sign in to comment.