mirror of
https://github.com/explosion/spaCy.git
synced 2025-03-24 03:44:26 +03:00
Fix default value for theme
This commit is contained in:
parent
ab4b6cc1dc
commit
a2fc7ecb27
|
@ -25,11 +25,11 @@ export default function Main({
|
|||
sidebar = false,
|
||||
asides = false,
|
||||
wrapContent = false,
|
||||
theme = 'blue',
|
||||
theme,
|
||||
footer,
|
||||
children,
|
||||
}) {
|
||||
const pattern = patterns[theme]
|
||||
const pattern = patterns[theme ?? 'blue']
|
||||
const mainClassNames = classNames(classes.root, {
|
||||
[classes['with-sidebar']]: sidebar,
|
||||
[classes['with-asides']]: asides,
|
||||
|
@ -50,6 +50,6 @@ Main.propTypes = {
|
|||
sidebar: PropTypes.bool,
|
||||
asides: PropTypes.bool,
|
||||
wrapContent: PropTypes.bool,
|
||||
theme: PropTypes.string.isRequired,
|
||||
theme: PropTypes.string,
|
||||
footer: PropTypes.node,
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ const Docs = ({ pageContext, children }) => {
|
|||
{sidebar && <Sidebar items={sidebar.items} pageMenu={pageMenu} slug={slug} />}
|
||||
<Main
|
||||
section={section}
|
||||
theme={nightly ? 'nightly' : legacy ? 'legacy' : theme}
|
||||
theme={nightly ? 'nightly' : legacy ? 'legacy' : theme ?? 'blue'}
|
||||
sidebar
|
||||
asides
|
||||
wrapContent
|
||||
|
|
|
@ -96,8 +96,8 @@ class Layout extends React.Component {
|
|||
|
||||
render() {
|
||||
const { location, children } = this.props
|
||||
const { title, section, sectionTitle, teaser, theme = 'blue', searchExclude } = this.props
|
||||
const uiTheme = nightly ? 'nightly' : legacy ? 'legacy' : theme
|
||||
const { title, section, sectionTitle, teaser, theme, searchExclude } = this.props
|
||||
const uiTheme = nightly ? 'nightly' : legacy ? 'legacy' : theme ?? 'blue'
|
||||
const bodyClass = classNames(`theme-${uiTheme}`, { 'search-exclude': !!searchExclude })
|
||||
const isDocs = ['usage', 'models', 'api', 'styleguide'].includes(section)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user