diff --git a/app/components/BlurredCode.tsx b/app/components/BlurredCode.tsx index fd825f9..620927f 100644 --- a/app/components/BlurredCode.tsx +++ b/app/components/BlurredCode.tsx @@ -2,8 +2,10 @@ 'use client'; +import { useState, useEffect } from 'react'; +import { useTheme } from 'next-themes'; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; -import { vscDarkPlus } from 'react-syntax-highlighter/dist/esm/styles/prism'; +import { oneDark, oneLight } from 'react-syntax-highlighter/dist/esm/styles/prism'; const pythonCode = `import quantum_entanglement import neural_net_vibes @@ -44,16 +46,26 @@ if __name__ == "__main__": analyzer.check_is_sandwich(target="glizzy")`; export default function BlurredCode() { + const { resolvedTheme } = useTheme(); + const [mounted, setMounted] = useState(false); + + useEffect(() => { + const timer = setTimeout(() => setMounted(true), 0); + return () => clearTimeout(timer); + }, []); + return ( -