rickvanlieshout.com/components/BlogNav/index.jsx

35 lines
1004 B
React
Raw Normal View History

2016-03-11 23:28:19 +01:00
import React from 'react'
import { RouteHandler, Link } from 'react-router'
import { link } from 'gatsby-helpers'
import './style.sss'
class BlogNav extends React.Component {
2016-03-21 18:03:01 +01:00
render() {
const {location} = this.props
return (
<nav className='blog-nav'>
<ul>
<li>
<Link to="/" className={ location.pathname === link('/') ? "current" : null }> Articles
</Link>
</li>
<li>
<Link to="/about" className={ location.pathname === link('/about') ? "current" : null }> About me
</Link>
</li>
<li>
<Link to="/contact" className={ location.pathname === link('/contact') ? "current" : null }> Contact me
</Link>
</li>
</ul>
</nav>
);
}
2016-03-11 23:28:19 +01:00
}
2016-03-21 18:03:01 +01:00
BlogNav.propTypes = {
location: React.PropTypes.object,
2016-03-11 23:28:19 +01:00
}
export default BlogNav