2018-12-01 03:20:19 +03:00
|
|
|
import React from 'react'
|
|
|
|
import {withRouter} from 'next/router'
|
|
|
|
import {default as NextLink} from 'next/link'
|
|
|
|
import {BorderBox, Link, Flex, Relative} from '@primer/components'
|
2018-11-30 22:54:49 +03:00
|
|
|
|
|
|
|
const NavLink = withRouter(({href, router, ...rest}) => (
|
|
|
|
<NextLink href={href}>
|
2018-12-01 03:20:19 +03:00
|
|
|
<Link color="gray.9" href={href} m={0} mb={4} fontWeight={router.pathname === href ? 'bold' : null} {...rest} />
|
2018-11-30 22:54:49 +03:00
|
|
|
</NextLink>
|
2018-12-01 03:20:19 +03:00
|
|
|
))
|
2018-11-30 22:54:49 +03:00
|
|
|
|
|
|
|
const SideNav = props => (
|
|
|
|
<Relative is="nav">
|
|
|
|
<BorderBox
|
|
|
|
{...props}
|
|
|
|
width={['100%', '100%', 256, 256]}
|
|
|
|
height="100%"
|
|
|
|
bg="gray.0"
|
|
|
|
display="inline-block"
|
|
|
|
borderTop={[1, 1, 0, 0]}
|
|
|
|
borderRight={1}
|
|
|
|
borderColor="gray.2"
|
2018-12-01 03:20:19 +03:00
|
|
|
id="sidenav"
|
|
|
|
>
|
|
|
|
<BorderBox border="none" borderBottom={1} borderRadius={0} borderColor="gray.2" bg="gray.0">
|
2018-11-30 22:54:49 +03:00
|
|
|
<Flex flexDirection="column" alignItems="start" p={5}>
|
2018-12-05 00:57:37 +03:00
|
|
|
<NavLink href="/css/support">Support</NavLink>
|
|
|
|
<NavLink href="/css/utilities">Utilities</NavLink>
|
|
|
|
<NavLink href="/css/objects">Objects</NavLink>
|
|
|
|
<NavLink href="/css/components">Components</NavLink>
|
2018-11-30 22:54:49 +03:00
|
|
|
</Flex>
|
|
|
|
</BorderBox>
|
|
|
|
</BorderBox>
|
|
|
|
</Relative>
|
2018-12-01 03:20:19 +03:00
|
|
|
)
|
2018-11-30 22:54:49 +03:00
|
|
|
|
2018-12-01 03:20:19 +03:00
|
|
|
export default withRouter(SideNav)
|