1
1
mirror of https://github.com/primer/css.git synced 2024-11-30 19:53:11 +03:00
css/docs/SectionLink.js
2019-04-02 22:59:01 -07:00

13 lines
373 B
JavaScript

import React from 'react'
import {withRouter} from 'next/router'
import {Box} from '@primer/components'
import PageLink from './PageLink'
const SectionLink = withRouter(({href, router, ...rest}) => (
<Box {...rest}>
<PageLink href={href} {...rest} fontSize={2} fontWeight={router.pathname.startsWith(href) ? 'bold' : null} />
</Box>
))
export default SectionLink