fix: 3 erros React — next/script p/ tema, 'use client' Footer+donate, remover metadata incompatível
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user