Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions src/components/Sidenav/Sidenav.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import GuidesTOCTree from './GuidesTOCTree';
import IA from './IA';
import IATransition from './IATransition';
import ProductsList from './ProductsList';
import SidenavBackButton from './SidenavBackButton';
import { SidenavContext } from './sidenav-context';
import SidenavMobileTransition from './SidenavMobileTransition';
import Toctree from './Toctree';
Expand Down Expand Up @@ -92,6 +91,19 @@ const titleStyle = LeafyCSS`
}
`;

const homeLinkStyle = LeafyCSS`
span {
color: ${palette.gray.dark1};
font-weight: 400;
display: flex;
gap: 6px;
align-items: center;
svg {
color: ${palette.gray.dark2}
}
}
`;

// Prevent content scrolling when the side nav is open on mobile and tablet screen sizes
const disableScroll = (shouldDisableScroll) => css`
body {
Expand Down Expand Up @@ -260,21 +272,11 @@ const Sidenav = ({ chapters, guides, page, pageTitle, repoBranches, siteTitle, s
<IATransition back={back} hasIA={!!ia} slug={slug} isMobile={isMobile}>
<NavTopContainer>
<ArtificialPadding />
<SideNavItem className={cx(titleStyle, sideNavItemBasePadding)} as={Link} to={baseUrl()}>
MongoDB Documentation
<SideNavItem className={cx(titleStyle, sideNavItemBasePadding, homeLinkStyle)} as={Link} to={baseUrl()}>
<Icon glyph="Home"></Icon>
Docs Home
</SideNavItem>
<Border />
<SidenavBackButton
handleClick={() => {
setBack(true);
hideMobileSidenav();
}}
project={project}
currentSlug={slug}
target={isGuidesTemplate ? '/' : ''}
titleOverride={isGuidesTemplate ? siteTitle : ''}
eol={eol}
/>
{ia && (
<IA
header={!isLanding && <span className={cx([titleStyle])}>{formatText(pageTitle)}</span>}
Expand Down