mirror of
https://github.com/wavetermdev/docusaurus-og.git
synced 2026-08-05 13:46:35 -07:00
fix: use lsd's default theme in landing page
This commit is contained in:
@@ -1,23 +1,33 @@
|
||||
import { defaultThemes, ThemeProvider } from '@acid-info/lsd-react'
|
||||
import { useActivePlugin } from '@docusaurus/plugin-content-docs/lib/client/index.js'
|
||||
import {
|
||||
ColorModeProvider,
|
||||
useColorMode,
|
||||
} from '@docusaurus/theme-common/internal'
|
||||
import React from 'react'
|
||||
import { darkTheme, lightTheme } from '../lib/themes'
|
||||
import { useDocThemeOptions } from '../lib/useThemeOptions'
|
||||
import styles from './style.module.css'
|
||||
import { lightTheme, darkTheme } from '../lib/themes'
|
||||
|
||||
const docThemes = {
|
||||
light: lightTheme,
|
||||
dark: darkTheme,
|
||||
}
|
||||
|
||||
const useTheme = () => {
|
||||
const colorMode = useColorMode()
|
||||
const activePlugin = useActivePlugin()
|
||||
|
||||
return (activePlugin ? docThemes : defaultThemes)[colorMode.colorMode]
|
||||
}
|
||||
|
||||
const Content = ({ children }) => {
|
||||
const colorMode = useColorMode()
|
||||
|
||||
const theme = useTheme()
|
||||
const options = useDocThemeOptions()
|
||||
const hideDocSidebar = options?.sidebar?.hide
|
||||
|
||||
return (
|
||||
<ThemeProvider
|
||||
theme={colorMode.colorMode === 'dark' ? darkTheme : lightTheme}
|
||||
>
|
||||
<ThemeProvider theme={theme}>
|
||||
<div className={styles.root} data-hidden-doc-sidebar={hideDocSidebar}>
|
||||
{children}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user