diff --git a/src/public/js/components/navbar.js b/src/public/js/components/navbar.js
index a21ec94..3f9bbab 100644
--- a/src/public/js/components/navbar.js
+++ b/src/public/js/components/navbar.js
@@ -6,102 +6,128 @@ import { Nav, Navbar, NavItem, NavDropdown, MenuItem } from 'react-bootstrap'
import { LinkContainer } from 'react-router-bootstrap'
import { Control, Form } from 'react-redux-form';
-export default class NavBar extends React.Component {
+export default function NavBar(props) {
+ return (
+
+
+
+
+ Canapé
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
+
+class Search extends React.Component {
constructor(props) {
super(props);
- this.handleMovieSearch = this.handleMovieSearch.bind(this);
- this.handleShowSearch = this.handleShowSearch.bind(this);
+ this.handleSearch = this.handleSearch.bind(this);
}
- handleMovieSearch() {
- this.props.router.push(`/movies/search/${encodeURI(this.props.movieStore.search)}`)
- }
- handleShowSearch() {
- this.props.router.push(`/shows/search/${encodeURI(this.props.showStore.search)}`)
+ handleSearch() {
+ this.props.router.push(`${this.props.path}/${encodeURI(this.props.search)}`)
}
render() {
- const username = this.props.userStore.username;
- const isLoggedIn = username !== "" ? true : false;
const location = this.props.router.getCurrentLocation().pathname;
- let displayMovieSearch = false;
- let displayShowSearch = false;
- if (isLoggedIn && location.indexOf("movies") > -1)
+ if (location.indexOf(this.props.pathMatch) === -1)
{
- displayMovieSearch = true;
+ return null;
}
- if (isLoggedIn && location.indexOf("shows") > -1)
- {
- displayShowSearch = true;
- }
- return (
-
-
-
-
- Canapé
-
-
-
-
-
-
- {displayMovieSearch &&
-
-
-
- }
- {displayShowSearch &&
-
-
-
- }
-
-
-
+
+ return(
+
+
+
+ );
+ }
+}
+
+function MoviesDropdown(props) {
+ return(
+
+ );
+}
+
+function ShowsDropdown(props) {
+ return(
+
+ );
+}
+
+function UserDropdown(props) {
+ if (props.username !== "") {
+ return (
+
+ );
+ } else {
+ return(
+
);
}
}