Merge pull request #20 from ihororlovskyi/issue-13

add activeClassName in SiteNav component (issue #19)
This commit is contained in:
Alexander S 2016-12-09 16:58:04 +03:00 committed by GitHub
commit f84624c654

View File

@ -10,15 +10,15 @@ class SiteNav extends React.Component {
<nav className='blog-nav'> <nav className='blog-nav'>
<ul> <ul>
<li> <li>
<Link to="/" className={ location.pathname === prefixLink('/') ? "current" : null }> Articles <Link to="/" activeClassName="current" onlyActiveOnIndex> Articles
</Link> </Link>
</li> </li>
<li> <li>
<Link to="/about/" className={ location.pathname === prefixLink('/about/') ? "current" : null }> About me <Link to="/about/" activeClassName="current"> About me
</Link> </Link>
</li> </li>
<li> <li>
<Link to="/contact/" className={ location.pathname === prefixLink('/contact/') ? "current" : null }> Contact me <Link to="/contact/" activeClassName="current"> Contact me
</Link> </Link>
</li> </li>
</ul> </ul>
@ -31,4 +31,4 @@ SiteNav.propTypes = {
location: React.PropTypes.object, location: React.PropTypes.object,
} }
export default SiteNav export default SiteNav