From 005eb07a327ca95e1e8c4d27af454f4ec1d5ff16 Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Sun, 29 Mar 2020 18:37:48 +0300 Subject: [PATCH] fix(v2): do not render sidebar logo if used sticky navbar (#2483) --- .../src/theme/DocSidebar/index.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/docusaurus-theme-classic/src/theme/DocSidebar/index.js b/packages/docusaurus-theme-classic/src/theme/DocSidebar/index.js index 7e292115e5..219c7b8cfe 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocSidebar/index.js +++ b/packages/docusaurus-theme-classic/src/theme/DocSidebar/index.js @@ -115,7 +115,9 @@ function mutateSidebarCollapsingState(item, path) { function DocSidebar(props) { const [showResponsiveSidebar, setShowResponsiveSidebar] = useState(false); const { - siteConfig: {themeConfig: {navbar: {title} = {}}} = {}, + siteConfig: { + themeConfig: {navbar: {title, hideOnScroll = false} = {}}, + } = {}, isClient, } = useDocusaurusContext(); const {logoLink, logoLinkProps, logoImageUrl, logoAlt} = useLogo(); @@ -149,12 +151,14 @@ function DocSidebar(props) { return (
- - {logoImageUrl != null && ( - {logoAlt} - )} - {title != null && {title}} - + {hideOnScroll && ( + + {logoImageUrl != null && ( + {logoAlt} + )} + {title != null && {title}} + + )}