2018-11-30 22:54:49 +03:00
|
|
|
|
import React from 'react'
|
|
|
|
|
import {withRouter} from 'next/router'
|
|
|
|
|
import Octicon, {MarkGithub} from '@githubprimer/octicons-react'
|
|
|
|
|
import BoxShadow from './BoxShadow'
|
2018-12-05 02:59:11 +03:00
|
|
|
|
import Link from './Link'
|
2018-12-05 03:14:33 +03:00
|
|
|
|
import {Text, Flex, Sticky, BorderBox, Box} from '@primer/components'
|
2018-11-30 22:54:49 +03:00
|
|
|
|
|
|
|
|
|
const NavLink = withRouter(({href, router, ...rest}) => (
|
2018-12-05 02:59:11 +03:00
|
|
|
|
<Link color="white" href={href} px={4} fontWeight={router.pathname === href ? 'bold' : null} {...rest} />
|
2018-11-30 22:54:49 +03:00
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
const Header = props => (
|
|
|
|
|
<Sticky zIndex={100}>
|
|
|
|
|
<BoxShadow py={3} bg="gray.9" color="white" {...props}>
|
|
|
|
|
<Flex className="p-responsive" alignItems="center" justifyContent="space-between">
|
2018-12-05 02:59:11 +03:00
|
|
|
|
<Link ml={3} color="white" href="/css">
|
|
|
|
|
<Flex alignItems="center" justifyContent="center">
|
|
|
|
|
<Octicon icon={MarkGithub} size="medium" />
|
|
|
|
|
<Text ml={3}>Primer CSS</Text>
|
|
|
|
|
</Flex>
|
|
|
|
|
</Link>
|
2018-11-30 22:54:49 +03:00
|
|
|
|
<Box display={['none', 'none', 'block']}>
|
|
|
|
|
<NavLink href="/css">Docs</NavLink>
|
2018-12-05 02:53:54 +03:00
|
|
|
|
<NavLink href="/css/getting-started">Getting Started</NavLink>
|
|
|
|
|
<NavLink href="/css/principles">Principles</NavLink>
|
|
|
|
|
<NavLink href="/css/tools">Tools</NavLink>
|
|
|
|
|
<NavLink href="/css/whats-new">What’s New</NavLink>
|
2018-11-30 22:54:49 +03:00
|
|
|
|
</Box>
|
|
|
|
|
<Box display={['block', 'block', 'none']}>
|
2018-12-05 03:14:33 +03:00
|
|
|
|
<Link href="#sidenav">
|
|
|
|
|
<BorderBox
|
2018-11-30 22:54:49 +03:00
|
|
|
|
border={1}
|
2018-12-05 03:14:33 +03:00
|
|
|
|
borderColor="gray.6"
|
2018-11-30 22:54:49 +03:00
|
|
|
|
borderRadius={3}
|
|
|
|
|
color="white"
|
|
|
|
|
display="inline-block"
|
2018-12-05 03:14:33 +03:00
|
|
|
|
px="12px"
|
|
|
|
|
py="6px"
|
2018-11-30 22:54:49 +03:00
|
|
|
|
>
|
|
|
|
|
<Text fontWeight="bold" fontSize={1}>
|
|
|
|
|
Menu
|
|
|
|
|
</Text>
|
2018-12-05 03:14:33 +03:00
|
|
|
|
</BorderBox>
|
2018-11-30 22:54:49 +03:00
|
|
|
|
</Link>
|
|
|
|
|
</Box>
|
|
|
|
|
</Flex>
|
|
|
|
|
</BoxShadow>
|
|
|
|
|
</Sticky>
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
export default Header
|