整理修改

This commit is contained in:
tangly1024.com
2023-11-02 14:10:46 +08:00
parent a6cc5a11f3
commit 5ccf8823a6
34 changed files with 101 additions and 80 deletions

View File

@@ -17,12 +17,11 @@ const GlobalContext = createContext()
*/
export function GlobalContextProvider(props) {
const { children, siteInfo, categoryOptions, tagOptions, NOTION_CONFIG } = props
console.log('config', NOTION_CONFIG)
const router = useRouter()
const [lang, updateLang] = useState(NOTION_CONFIG.LANG || BLOG.LANG) // 默认语言
const [locale, updateLocale] = useState(generateLocaleDict(NOTION_CONFIG.LANG || BLOG.LANG)) // 默认语言
const [theme, setTheme] = useState(NOTION_CONFIG.THEME || BLOG.THEME) // 默认博客主题
const [isDarkMode, updateDarkMode] = useState(NOTION_CONFIG.APPEARANCE || BLOG.APPEARANCE === 'dark') // 默认深色模式
const [lang, updateLang] = useState(NOTION_CONFIG?.LANG || BLOG.LANG) // 默认语言
const [locale, updateLocale] = useState(generateLocaleDict(NOTION_CONFIG?.LANG || BLOG.LANG)) // 默认语言
const [theme, setTheme] = useState(NOTION_CONFIG?.THEME || BLOG.THEME) // 默认博客主题
const [isDarkMode, updateDarkMode] = useState(NOTION_CONFIG?.APPEARANCE || BLOG.APPEARANCE === 'dark') // 默认深色模式
const [onLoading, setOnLoading] = useState(false) // 抓取文章数据
// 切换主题
@@ -98,7 +97,6 @@ export function GlobalContextProvider(props) {
/**
* 切换主题时的特殊处理
* @param {*} setTheme
*/
const checkThemeDOM = () => {
if (isBrowser) {