1
0
Fork 0

Make navbar show what page you are on

This commit is contained in:
Amarpreet Minhas 2019-08-03 23:16:02 -04:00
parent 3e2172ac36
commit 6d2cdc44a8

View file

@ -1,17 +1,13 @@
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { NavLink } from 'react-router-dom';
class NavBar extends Component {
render() {
let classes= 'item';
if (this.props.isActive) {
classes += ' active';
}
return (
<div className="ui three item secondary menu">
<Link to="/" className='item'>sudoscientist:~#</Link>
<Link to="/posts/" className={classes}>Posts</Link>
<Link to="/about/" className={classes}>About</Link>
<NavLink exact to="/" className='item'>sudoscientist:~#</NavLink>
<NavLink to="/posts/" className='item' activeClassName='active'>Posts</NavLink>
<NavLink to="/about/" className='item' activeClassName='active'>About</NavLink>
</div>
);
}