Webpack优化动态主题加载

This commit is contained in:
tangly1024
2023-06-20 14:20:43 +08:00
parent 16bdf3a745
commit c92fbafc39
29 changed files with 127 additions and 391 deletions

View File

@@ -1,5 +1,5 @@
import { useGlobal } from '@/lib/global'
import { saveDarkModeToCookies } from '@/lib/theme'
import { saveDarkModeToCookies } from '@/themes/theme'
const DarkModeButton = () => {
const { isDarkMode, updateDarkMode } = useGlobal()

View File

@@ -1,13 +1,14 @@
import { useGlobal } from '@/lib/global'
import { saveDarkModeToCookies } from '@/lib/theme'
import { saveDarkModeToCookies } from '@/themes/theme'
import CONFIG_NEXT from '../config_next'
export default function FloatDarkModeButton () {
const { isDarkMode, updateDarkMode } = useGlobal()
if (!CONFIG_NEXT.WIDGET_DARK_MODE) {
return <></>
}
const { isDarkMode, updateDarkMode } = useGlobal()
// 用户手动设置主题
const handleChangeDarkMode = () => {
const newStatus = !isDarkMode