Sticky sidebar

pull/1331/head
Kamran Ahmed 5 years ago
parent dec3e992b3
commit 74433cd0d3
  1. 5
      components/detailed-roadmap/index.js
  2. 12
      components/detailed-roadmap/style.js

@ -13,6 +13,7 @@ import {
SidebarButton, SidebarButton,
MobileSidebar, MobileSidebar,
MobileSidebarWrap, MobileSidebarWrap,
DesktopSidebarWrap,
PageTitle, PageTitle,
PageDetail PageDetail
} from './style'; } from './style';
@ -106,9 +107,11 @@ const DetailedRoadmap = ({ roadmap }) => {
</MobileNavHeader> </MobileNavHeader>
<Summary className="container"> <Summary className="container">
<Sidebar className="sidebar d-none d-md-block"> <DesktopSidebarWrap className="d-none d-md-block">
<Sidebar>
{ roadmapPages } { roadmapPages }
</Sidebar> </Sidebar>
</DesktopSidebarWrap>
<PageDetail> <PageDetail>
<PageTitle>{ currentPage.title }</PageTitle> <PageTitle>{ currentPage.title }</PageTitle>
<MdRenderer> <MdRenderer>

@ -80,7 +80,6 @@ export const PageTitle = styled.h1`
`; `;
export const Sidebar = styled.div` export const Sidebar = styled.div`
border-left: 1px solid #efefef;
padding-bottom: 150px; padding-bottom: 150px;
ul { ul {
@ -146,6 +145,16 @@ export const Sidebar = styled.div`
} }
`; `;
export const DesktopSidebarWrap = styled.div`
border-left: 1px solid #efefef;
${Sidebar} {
position: sticky;
top: 0;
background: white;
}
`;
export const MobileSidebarWrap = styled.div` export const MobileSidebarWrap = styled.div`
position: absolute; position: absolute;
z-index: 999; z-index: 999;
@ -164,6 +173,7 @@ export const MobileSidebarWrap = styled.div`
`; `;
export const MobileSidebar = styled(Sidebar)` export const MobileSidebar = styled(Sidebar)`
border-left: 1px solid #efefef;
margin-left: 12px; margin-left: 12px;
padding-bottom: 20px; padding-bottom: 20px;

Loading…
Cancel
Save