feat: make current docs page active

This commit is contained in:
Jean-Philippe Sirois
2019-07-27 05:07:19 -04:00
parent e97b7925f9
commit 1447f35439
2 changed files with 9 additions and 1 deletions
+5 -1
View File
@@ -131,7 +131,11 @@ const ALL_DOCS = graphql`
const plantTree = (item: IFileOrFolder) => {
if (item.type === "file") {
return <SC.PageLink to={item.path}>{item.title}</SC.PageLink>
return (
<SC.PageLink to={item.path} activeClassName="active">
{item.title}
</SC.PageLink>
)
}
return <Folder item={item} />
+4
View File
@@ -11,4 +11,8 @@ export const PageLink = styled(Link)`
display: block;
padding: 4px 0;
color: #1c61df;
&.active {
font-weight: 700;
}
`