Open ZacCrumpton opened 4 years ago
Nav
, NavItem
and NavLink
example for buildNavbar
function
const buildNavbar = () => {
const { authed } = this.props;
if (authed) {
return (
<Nav className="ml-auto" navbar>
<NavItem>
<NavLink tag={RRNavLink} to='/home'>Home</NavLink>
</NavItem>
<NavItem>
<NavLink tag={RRNavLink} to='/stuff'>My Stuff</NavLink>
</NavItem>
<NavItem>
<NavLink tag={RRNavLink} to='/new'>New Item</NavLink>
</NavItem>
<NavItem>
<NavLink onClick={this.logMeOut}>Logout</NavLink>
</NavItem>
</Nav>
);
}
Navbar
and NavbarToggler
example:
<Navbar color="light" light expand="md">
<NavbarBrand href="/">React Hoarder</NavbarBrand>
<NavbarToggler onClick={this.toggle} />
<Collapse isOpen={isOpen} navbar>
{buildNavbar()}
</Collapse>
</Navbar>
USER STORY
as a user, no matter what page i'm on i should see a navbar
AC
WHEN on page load THEN I should be able to click the links AND navigate between pages
DEV NOTES
shared
folder.NavBar
js
andscss
file of the same namereact-router-dom
install{ NavLink as RRNavLink }
from'react-router-dom
{ Collapse, Navbar, NavbarToggler, NavbarBrand, Nav, NavItem, NavLink, }
firebase
, will needapp
andauth
PropTypes
buildNavbar
{ authed }
thats set tothis.props;
if statement
that returnsNavItem
's andNavLink
'sHome
,My Lists
andNew List
single view
on lists or anime, orNew Anime
. these will be "hidden" pages that prompt on a button click