rickvanlieshout.com/components/BlogNav/index.jsx
2016-06-03 02:32:38 +03:00

35 lines
1.0 KiB
JavaScript

import React from 'react'
import { RouteHandler, Link } from 'react-router'
import { prefixLink } from 'gatsby-helpers'
import './style.css'
class BlogNav extends React.Component {
render() {
const {location} = this.props
return (
<nav className='blog-nav'>
<ul>
<li>
<Link to="/" className={ location.pathname === prefixLink('/') ? "current" : null }> Articles
</Link>
</li>
<li>
<Link to="/about" className={ location.pathname === prefixLink('/about') ? "current" : null }> About me
</Link>
</li>
<li>
<Link to="/contact" className={ location.pathname === prefixLink('/contact') ? "current" : null }> Contact me
</Link>
</li>
</ul>
</nav>
);
}
}
BlogNav.propTypes = {
location: React.PropTypes.object,
}
export default BlogNav