Files
transform/components/Navigator.tsx
T
Ritesh Kumar 9f67f97573 2.1.0 (#128)
* HTML to Pug converter (#127)

* feat(pug): add HTML to pug converter

* fix(pug): added package details

* feat(analyze): added webpack bundle analyzer

*  fix(rust): handle special characters and duplicate keys (#131)

* remove duplicate google tag manager (#122)

* Update _app.tsx (#124)

* docs: add timneutkens as a contributor (#125)

* docs: update README.md

* docs: update .all-contributorsrc

* Upgrade Next.js to 9 (#126)

* Upgrade Next.js to 9

* Add back engines key

* Add globalObject

Brings in suggestion from https://github.com/zeit/next.js/issues/7873#issuecomment-512795482

* Add temporary fix for window issue

* fix(font): add fallback font for non mac browsers (#130)

closes #129

* fix(rust): handle special characters and duplicate keys

closes #97

* fix(rust): handle special chars

closes #97, closes #95, closes #89, closes #62

* chore(rust): remove settings

* feat(kotlin): added JSON to kotlin and json schema

* fixes

* fixes

* fixes

* fixes

* fixes

* added favicon

* social media tags
2019-07-25 00:38:09 +05:30

88 lines
2.6 KiB
TypeScript

import React, { Fragment } from "react";
import { Heading, Pane, Text } from "evergreen-ui";
import { categorizedRoutes, Route } from "@utils/routes";
import Link from "next/link";
import { useRouter } from "next/router";
import SearchBox from "@components/Searchbox";
export default function() {
const router = useRouter();
return (
<Pane
width={240}
height={"calc(100vh - 40px)"}
borderRight
display="flex"
flexDirection="column"
paddingTop={20}
>
<Pane paddingX={15}>
<SearchBox />
</Pane>
<Pane
display="flex"
flex={1}
overflowY="scroll"
flexDirection="column"
paddingBottom={10}
>
{categorizedRoutes.map(route => {
return (
<Fragment key={route.category}>
<Pane paddingX={10} marginTop={15} marginBottom={2}>
<Heading marginLeft={5} size={400}>
{route.category}
</Heading>
</Pane>
{(route.content as Route[])
.sort((a, b) => a.label.localeCompare(b.label))
.map((a: Route) => {
const isActive = router.pathname === a.path;
return (
<Link key={a.label} href={a.path}>
<a
style={{
textDecoration: "none"
}}
>
<Pane
paddingLeft={16}
paddingY={3}
backgroundColor={isActive ? "#f3f3f3" : undefined}
borderLeft={
isActive
? "3px solid #009688"
: "3px solid transparent"
}
css={{
"&:hover": {
backgroundColor: "#f5f5f5"
}
}}
>
<Text fontSize={13}>{a.label}</Text>
</Pane>
</a>
</Link>
);
})}
</Fragment>
);
})}
</Pane>
<Pane paddingY={15} background="#f6f6f6" borderTop>
<Heading size={400} textAlign="center">
Created by{" "}
<Link href="https://twitter.com/ritz078">
<a target="_blank">@ritz078</a>
</Link>
</Heading>
</Pane>
</Pane>
);
}