Skip to content

Commit

Permalink
fix: use lsd's default theme in landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
jeangovil committed Jun 5, 2023
1 parent 8a93a03 commit 4859e36
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions packages/logos-docusaurus-theme/src/client/theme/Root.tsx
Original file line number Diff line number Diff line change
@@ -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 Content = ({ children }) => {
const docThemes = {
light: lightTheme,
dark: darkTheme,
}

const useTheme = () => {
const colorMode = useColorMode()
const activePlugin = useActivePlugin()

return (activePlugin ? docThemes : defaultThemes)[colorMode.colorMode]
}

const Content = ({ children }) => {
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>
Expand Down

0 comments on commit 4859e36

Please sign in to comment.