mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-06 23:16:52 +00:00
整理修改
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user