Skip to content

Commit 4c41d91

Browse files
committed
markdown code styles -> atomOne
1 parent 1dd2bbf commit 4c41d91

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

frontends/tamagui/packages/app/components/tamagui_markdown.tsx

+11-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { useProvidedDispatch } from "app/hooks";
99
// import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
1010
// import { dark } from 'react-syntax-highlighter/dist/cjs/styles/prism';
1111
import SyntaxHighlighter from 'react-syntax-highlighter';
12-
import { dark, a11yDark } from 'react-syntax-highlighter/dist/cjs/styles/hljs';
12+
import { atomOneDark as darkCodeStyle, atomOneLight as lightCodeStyle } from 'react-syntax-highlighter/dist/cjs/styles/hljs';
1313

1414
export type MarkdownProps = {
1515
text?: string;
@@ -56,14 +56,16 @@ export const TamaguiMarkdown = ({ text = '', disableLinks, cleanContent = false,
5656
const match = /language-(\w+)/.exec(className || '')
5757
console.log('TamaguiMarkdown code match', match)
5858
return match ? (
59-
<SyntaxHighlighter
60-
{...rest}
61-
PreTag="div"
62-
children={String(children).replace(/\n$/, '')}
63-
language={match[1]}
64-
// style={{}}
65-
style={a11yDark}
66-
/>
59+
<XStack my='$3'>
60+
<SyntaxHighlighter
61+
{...rest}
62+
PreTag="div"
63+
children={String(children).replace(/\n$/, '')}
64+
language={match[1]}
65+
// style={{}}
66+
style={darkMode ? darkCodeStyle : lightCodeStyle}
67+
/>
68+
</XStack>
6769
) : (
6870
<code {...rest} className={className}>
6971
{children}

0 commit comments

Comments
 (0)