rickvanlieshout.com/components/BlogNav/index.jsx

35 lines
1.0 KiB
React
Raw Normal View History

2016-03-11 23:28:19 +01:00
import React from 'react'
import { RouteHandler, Link } from 'react-router'
2016-06-03 01:32:38 +02:00
import { prefixLink } from 'gatsby-helpers'
2016-03-11 23:28:19 +01:00
2016-06-03 01:32:38 +02:00
import './style.css'
2016-03-11 23:28:19 +01:00
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>
2016-06-03 01:32:38 +02:00
<Link to="/" className={ location.pathname === prefixLink('/') ? "current" : null }> Articles
2016-03-21 18:03:01 +01:00
</Link>
</li>
<li>
2016-06-03 01:32:38 +02:00
<Link to="/about" className={ location.pathname === prefixLink('/about') ? "current" : null }> About me
2016-03-21 18:03:01 +01:00
</Link>
</li>
<li>
2016-06-03 01:32:38 +02:00
<Link to="/contact" className={ location.pathname === prefixLink('/contact') ? "current" : null }> Contact me
2016-03-21 18:03:01 +01:00
</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