Compare commits

...

2 commits

Author SHA1 Message Date
f25ad2d6a7 fix: make the copy icon in the copy button for code blocks visible
Some checks failed
Deploy Next.js application / deploy (push) Failing after 10m3s
2024-09-22 07:28:42 +02:00
d32e6826b5 fix: suppress No grammar found for language: "none" messages while building 2024-09-22 07:25:55 +02:00
2 changed files with 2 additions and 2 deletions

View file

@ -126,7 +126,7 @@ const customPortableTextComponents: PortableTextComponents = {
const language = value.language || "none"; const language = value.language || "none";
const grammar = Prism.languages[language]; const grammar = Prism.languages[language];
if (!grammar) { if (language != "none" && !grammar) {
console.error(`No grammar found for language: "${language}"`); console.error(`No grammar found for language: "${language}"`);
} }

View file

@ -20,7 +20,7 @@ export default function CopyButton({ code }: { code: string }) {
return ( return (
<Button <Button
onClick={copyCode} onClick={copyCode}
className="absolute top-2 right-2 bg-accent hover:bg-muted p-2 rounded" className="absolute top-2 right-2 bg-accent hover:bg-muted text-black dark:text-white p-2 rounded"
size={"icon"} size={"icon"}
> >
{copied ? <Check className="w-5 h-5" /> : <Copy className="w-5 h-5" />} {copied ? <Check className="w-5 h-5" /> : <Copy className="w-5 h-5" />}