Skip to content

Commit

Permalink
feat: modify CodeBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
axnir committed May 7, 2023
1 parent 2ee0787 commit 23ef102
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions app/components/ui/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,22 @@ export default async function CodeBlock(

// TODOsupport dark mode
const lightHtml = renderToHTML('light');
// const darkHtml = renderToHTML('dark');
const darkHtml = renderToHTML('dark');

return (
<div
dangerouslySetInnerHTML={{
__html: lightHtml,
}}
/>
<>
<div
className="dark:hidden"
dangerouslySetInnerHTML={{
__html: lightHtml,
}}
></div>
<div
className="hidden dark:block"
dangerouslySetInnerHTML={{
__html: darkHtml,
}}
></div>
</>
);
}

0 comments on commit 23ef102

Please sign in to comment.