diff --git a/src/app/AppRouter.tsx b/src/app/AppRouter.tsx index 8532425..712135d 100644 --- a/src/app/AppRouter.tsx +++ b/src/app/AppRouter.tsx @@ -20,14 +20,14 @@ function AppRouter() { useEffect(() => { // Apply theme to document and save preference - document.documentElement.setAttribute('data-theme', theme); + document.documentElement.dataset.theme = theme; localStorage.setItem('theme', theme); }, [theme]); useEffect(() => { // Handle hash-based navigation for sections const handleHashChange = () => { - const hash = window.location.hash.substring(1); + const hash = globalThis.location.hash.substring(1); if (hash) { setTimeout(() => { const element = document.getElementById(hash); @@ -42,10 +42,10 @@ function AppRouter() { handleHashChange(); // Listen for hash changes - window.addEventListener('hashchange', handleHashChange); + globalThis.addEventListener('hashchange', handleHashChange); return () => { - window.removeEventListener('hashchange', handleHashChange); + globalThis.removeEventListener('hashchange', handleHashChange); }; }, []); diff --git a/src/components/ThemeToggle.tsx b/src/components/ThemeToggle.tsx index fd48ede..70d698d 100644 --- a/src/components/ThemeToggle.tsx +++ b/src/components/ThemeToggle.tsx @@ -1,10 +1,10 @@ import React from 'react'; import { getTexts } from '../config/texts'; -type Props = { +type Props = Readonly<{ theme: 'light' | 'dark'; setTheme: React.Dispatch>; -}; +}>; export default function ThemeToggle({ theme, diff --git a/src/components/layout/MobileMenu.tsx b/src/components/layout/MobileMenu.tsx index addcf49..e1f798c 100644 --- a/src/components/layout/MobileMenu.tsx +++ b/src/components/layout/MobileMenu.tsx @@ -1,9 +1,9 @@ import { useEffect, useRef } from 'react'; type Props = { - menuItems: string[]; - isOpen: boolean; - onItemClick: (section: string) => void; + readonly menuItems: string[]; + readonly isOpen: boolean; + readonly onItemClick: (section: string) => void; }; export default function MobileMenu({ menuItems, isOpen, onItemClick }: Props) { diff --git a/src/pages/ImprintPage.tsx b/src/pages/ImprintPage.tsx index f8adc79..cf21317 100644 --- a/src/pages/ImprintPage.tsx +++ b/src/pages/ImprintPage.tsx @@ -16,7 +16,7 @@ export default function ImprintPage() { return () => { const existingMeta = document.querySelector('meta[name="robots"]'); if (existingMeta) { - document.head.removeChild(existingMeta); + existingMeta.remove(); } }; }, []); @@ -63,8 +63,8 @@ export default function ImprintPage() {

{texts.contentLiabilityTitle}

- {texts.contentLiabilityText.map((text, index) => ( -

+ {texts.contentLiabilityText.map((text) => ( +

{text}

))} @@ -72,8 +72,8 @@ export default function ImprintPage() {

{texts.copyrightTitle}

- {texts.copyrightText.map((text, index) => ( -

+ {texts.copyrightText.map((text) => ( +

{text}

))} @@ -101,8 +101,8 @@ export default function ImprintPage() {

{texts.detailedPrivacyPolicy.responsibleTitle}

{texts.detailedPrivacyPolicy.responsibleText}

- {texts.detailedPrivacyPolicy.responsibleContact.split('\n').map((line, index) => ( -

{line}

+ {texts.detailedPrivacyPolicy.responsibleContact.split('\n').map((line) => ( +

{line}

))}
@@ -118,8 +118,8 @@ export default function ImprintPage() {

{texts.detailedPrivacyPolicy.rightsTitle}

{texts.detailedPrivacyPolicy.rightsIntro}