mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-02 15:10:16 +00:00
example主题支持fullwidth
This commit is contained in:
@@ -12,7 +12,7 @@ const GlobalContext = createContext()
|
||||
* @constructor
|
||||
*/
|
||||
export function GlobalContextProvider(props) {
|
||||
const { children, siteInfo, categoryOptions, tagOptions, NOTION_CONFIG } = props
|
||||
const { post, children, siteInfo, categoryOptions, tagOptions, NOTION_CONFIG } = props
|
||||
const router = useRouter()
|
||||
const [lang, updateLang] = useState(NOTION_CONFIG?.LANG || LANG) // 默认语言
|
||||
const [locale, updateLocale] = useState(generateLocaleDict(NOTION_CONFIG?.LANG || LANG)) // 默认语言
|
||||
@@ -20,6 +20,9 @@ export function GlobalContextProvider(props) {
|
||||
const [isDarkMode, updateDarkMode] = useState(NOTION_CONFIG?.APPEARANCE || APPEARANCE === 'dark') // 默认深色模式
|
||||
const [onLoading, setOnLoading] = useState(false) // 抓取文章数据
|
||||
|
||||
// 是否全屏
|
||||
const fullWidth = post?.fullWidth ?? false
|
||||
|
||||
// 切换主题
|
||||
function switchTheme() {
|
||||
const currentIndex = THEMES.indexOf(theme)
|
||||
@@ -82,6 +85,7 @@ export function GlobalContextProvider(props) {
|
||||
|
||||
return (
|
||||
<GlobalContext.Provider value={{
|
||||
fullWidth,
|
||||
NOTION_CONFIG,
|
||||
toggleDarkMode,
|
||||
onLoading,
|
||||
|
||||
Reference in New Issue
Block a user