mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-30 22:23:00 +00:00
fix(v2): do not render sidebar logo if used sticky navbar (#2483)
This commit is contained in:
parent
4539055de6
commit
005eb07a32
|
|
@ -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 (
|
||||
<div className={styles.sidebar}>
|
||||
<Link className={styles.sidebarLogo} to={logoLink} {...logoLinkProps}>
|
||||
{logoImageUrl != null && (
|
||||
<img key={isClient} src={logoImageUrl} alt={logoAlt} />
|
||||
)}
|
||||
{title != null && <strong>{title}</strong>}
|
||||
</Link>
|
||||
{hideOnScroll && (
|
||||
<Link className={styles.sidebarLogo} to={logoLink} {...logoLinkProps}>
|
||||
{logoImageUrl != null && (
|
||||
<img key={isClient} src={logoImageUrl} alt={logoAlt} />
|
||||
)}
|
||||
{title != null && <strong>{title}</strong>}
|
||||
</Link>
|
||||
)}
|
||||
<div
|
||||
className={classnames('menu', 'menu--responsive', styles.menu, {
|
||||
'menu--show': showResponsiveSidebar,
|
||||
|
|
|
|||
Loading…
Reference in New Issue