1
1
mirror of https://github.com/primer/css.git synced 2024-12-25 15:14:59 +03:00
css/docs/src/Header.js

52 lines
1.7 KiB
JavaScript
Raw Normal View History

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'
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} />
))
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>
<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">Whats New</NavLink>
</Box>
<Box display={['block', 'block', 'none']}>
2018-12-05 03:14:33 +03:00
<Link href="#sidenav">
<BorderBox
border={1}
2018-12-05 03:14:33 +03:00
borderColor="gray.6"
borderRadius={3}
color="white"
display="inline-block"
2018-12-05 03:14:33 +03:00
px="12px"
py="6px"
>
<Text fontWeight="bold" fontSize={1}>
Menu
</Text>
2018-12-05 03:14:33 +03:00
</BorderBox>
</Link>
</Box>
</Flex>
</BoxShadow>
</Sticky>
)
export default Header