fix: 3 erros React — next/script p/ tema, 'use client' Footer+donate, remover metadata incompatível

This commit is contained in:
2026-05-27 11:05:30 +01:00
parent c9f4faf0a7
commit 7be9d5131f
8 changed files with 52 additions and 28 deletions

View File

@@ -1,5 +1,6 @@
import type { Metadata } from 'next';
import { Playfair_Display, Lora, Fragment_Mono } from 'next/font/google';
import Script from 'next/script';
import './globals.css';
const playfair = Playfair_Display({
@@ -58,20 +59,11 @@ export default function RootLayout({
suppressHydrationWarning
>
<head>
<script
<Script
id="theme-init"
strategy="beforeInteractive"
dangerouslySetInnerHTML={{
__html: `
(function() {
try {
var theme = localStorage.getItem('pawlink-theme');
var prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
if (theme === 'dark' || (!theme && prefersDark)) {
document.documentElement.classList.add('dark');
document.documentElement.setAttribute('data-theme', 'dark');
}
} catch(e) {}
})();
`,
__html: `(function(){try{var t=localStorage.getItem('petlink-theme');var d=window.matchMedia('(prefers-color-scheme: dark)').matches;if(t==='dark'||(!t&&d)){document.documentElement.classList.add('dark');document.documentElement.setAttribute('data-theme','dark');}}catch(e){}})();`,
}}
/>
</head>