Don't display the movies/shows menu if not logged

This commit is contained in:
Grégoire Delattre 2017-03-22 14:36:13 +01:00
parent 6db5b15ea5
commit 2811c4fa16

View File

@ -17,9 +17,9 @@ export default function NavBar(props) {
<Navbar.Toggle />
</Navbar.Header>
<Navbar.Collapse>
<MoviesDropdown />
<ShowsDropdown />
<WishlistDropdown />
<MoviesDropdown username={props.userStore.username} />
<ShowsDropdown username={props.userStore.username} />
<WishlistDropdown username={props.userStore.username} />
<UserDropdown
username={props.userStore.username}
logout={props.userLogout}
@ -79,6 +79,9 @@ class Search extends React.Component {
}
function MoviesDropdown(props) {
if (props.username === "") {
return null;
}
return(
<Nav>
<NavDropdown title="Movies" id="navbar-movies-dropdown">
@ -94,6 +97,9 @@ function MoviesDropdown(props) {
}
function ShowsDropdown(props) {
if (props.username === "") {
return null;
}
return(
<Nav>
<NavDropdown title="Shows" id="navbar-shows-dropdown">
@ -137,6 +143,9 @@ function UserDropdown(props) {
}
function WishlistDropdown(props) {
if (props.username === "") {
return null;
}
return(
<Nav>
<NavDropdown title="Wishlist" id="navbar-wishlit-dropdown">