From 282fe1a36c8f6a5a3e367c3f8e440a1267fea3c2 Mon Sep 17 00:00:00 2001 From: K <774162+kaseea@users.noreply.github.com> Date: Tue, 25 Jun 2019 18:08:24 -0700 Subject: [PATCH] displays (poorly) the selected customer and movie, although, no way to deselect other than pick a new customer, WHICH COULD BE A FEATURE NOT A BUG --- src/components/NavBar.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/components/NavBar.js b/src/components/NavBar.js index 640c1d332..2ff47ca16 100644 --- a/src/components/NavBar.js +++ b/src/components/NavBar.js @@ -29,6 +29,7 @@ class NavBar extends Component { this.setState({ selectedCustomer: customer }); + console.log(customer.name) } onSelectMovie = (movieId) => { @@ -80,6 +81,16 @@ class NavBar extends Component { render() { + const customerSelected = (this.state.selectedCustomer) ? + ( + selected customer is: {this.state.selectedCustomer.name} + ) : null; + + const movieSelected = (this.state.selectedMovie) ? + ( + selected movie is: {this.state.selectedMovie.title} + ) : null; + return ( @@ -87,6 +98,10 @@ class NavBar extends Component { {this.props.allCustomers} {this.props.search} + + { customerSelected } + { movieSelected } + (
selected customer is: {this.state.selectedCustomer.name}
selected movie is: {this.state.selectedMovie.title}