diff --git a/components/Header/Header.tsx b/components/Header/Header.tsx index 61c8d57dc..244e14f18 100644 --- a/components/Header/Header.tsx +++ b/components/Header/Header.tsx @@ -14,7 +14,7 @@ export const Header: FC = () => { return (
-
+
diff --git a/components/ThemeToggler/themeToggler.tsx b/components/ThemeToggler/themeToggler.tsx index 850abee07..21a8cbf66 100644 --- a/components/ThemeToggler/themeToggler.tsx +++ b/components/ThemeToggler/themeToggler.tsx @@ -1,21 +1,22 @@ -import { useState, useEffect } from 'react' -import { useTheme } from 'next-themes' -import { HiSun, HiMoon } from 'react-icons/hi' +import { useState, useEffect } from 'react'; +import { useTheme } from 'next-themes'; +import { HiSun, HiMoon } from 'react-icons/hi'; +import { Helmet, HelmetProvider } from 'react-helmet-async'; export function ThemeToggler() { - const { resolvedTheme, setTheme } = useTheme() - const [mounted, setMounted] = useState(false) + const { resolvedTheme, setTheme } = useTheme(); + const [mounted, setMounted] = useState(false); useEffect(() => { - setMounted(true) - }, []) + setMounted(true); + }, []); if (!mounted) { - return null + return null; } const handleThemeToggle = () => { - setTheme(resolvedTheme === 'dark' ? 'light' : 'dark') + setTheme(resolvedTheme === 'dark' ? 'light' : 'dark'); } const iconProps = { @@ -23,23 +24,36 @@ export function ThemeToggler() { size: '1.5rem', } + const themeColor = resolvedTheme === 'dark' ? '#0F172A' : '#F5F3FF'; + return ( - - ) + + + + ); } diff --git a/package.json b/package.json index c7a3b7f46..77e089fcf 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "react": "18.2.0", "react-autosuggest": "^10.1.0", "react-dom": "18.2.0", + "react-helmet-async": "^1.3.0", "react-icons": "^4.8.0", "react-spinners": "^0.13.8", "react-tooltip": "^5.20.0", diff --git a/pages/[subcategory]/index.tsx b/pages/[subcategory]/index.tsx index 55cc006f6..2c64e8ea2 100644 --- a/pages/[subcategory]/index.tsx +++ b/pages/[subcategory]/index.tsx @@ -27,7 +27,6 @@ const SubCategory = () => { <> {title} - - { <> {title} - = 0.4'} @@ -2212,6 +2225,25 @@ packages: scheduler: 0.23.0 dev: false + /react-fast-compare@3.2.2: + resolution: {integrity: sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==} + dev: false + + /react-helmet-async@1.3.0(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-9jZ57/dAn9t3q6hneQS0wukqC2ENOBgMNVEhb/ZG9ZSxUetzVIw4iAmEU38IaVg3QGYauQPhSeUTuIUtFglWpg==} + peerDependencies: + react: ^16.6.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.6.0 || ^17.0.0 || ^18.0.0 + dependencies: + '@babel/runtime': 7.21.0 + invariant: 2.2.4 + prop-types: 15.8.1 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-fast-compare: 3.2.2 + shallowequal: 1.1.0 + dev: false + /react-icons@4.8.0(react@18.2.0): resolution: {integrity: sha512-N6+kOLcihDiAnj5Czu637waJqSnwlMNROzVZMhfX68V/9bu9qHaMIJC4UdozWoOk57gahFCNHwVvWzm0MTzRjg==} peerDependencies: @@ -2363,6 +2395,10 @@ packages: resolution: {integrity: sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA==} dev: false + /shallowequal@1.1.0: + resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} + dev: false + /shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -2736,7 +2772,3 @@ packages: /zod@3.21.4: resolution: {integrity: sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==} dev: false - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false