From a3611610a7a623226e4c05776f20af7071a4ffcc Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 8 Feb 2024 15:57:25 +0800 Subject: [PATCH] =?UTF-8?q?landing-2=20=E5=AF=BC=E8=88=AA=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E9=80=82=E9=85=8D=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/global.js | 1 - themes/landing-2/components/DarkModeButton.js | 5 +- themes/landing-2/components/Logo.js | 51 +++---- themes/landing-2/components/MadeWithButton.js | 1 + themes/landing-2/components/MenuList.js | 135 ++++-------------- themes/landing-2/components/NavBar.js | 6 +- themes/landing-2/components/SVG404.js | 33 +++++ themes/landing-2/index.js | 48 ++++++- themes/landing-2/style.js | 12 +- 9 files changed, 141 insertions(+), 151 deletions(-) create mode 100644 themes/landing-2/components/SVG404.js diff --git a/lib/global.js b/lib/global.js index fc4cfa10..4eadfa19 100644 --- a/lib/global.js +++ b/lib/global.js @@ -39,7 +39,6 @@ export function GlobalContextProvider(props) { const toggleDarkMode = () => { const newStatus = !isDarkMode saveDarkModeToLocalStorage(newStatus) - console.log('切换中', isDarkMode, newStatus) updateDarkMode(newStatus) const htmlElement = document.getElementsByTagName('html')[0] htmlElement.classList?.remove(newStatus ? 'light' : 'dark') diff --git a/themes/landing-2/components/DarkModeButton.js b/themes/landing-2/components/DarkModeButton.js index 4038349e..0a89e7a0 100644 --- a/themes/landing-2/components/DarkModeButton.js +++ b/themes/landing-2/components/DarkModeButton.js @@ -1,8 +1,9 @@ import { useGlobal } from '@/lib/global'; +import { useRouter } from 'next/router'; export const DarkModeButton = () => { const { toggleDarkMode } = useGlobal() - + const router = useRouter() return <>