Skip to content

Commit

Permalink
displays (poorly) the selected customer and movie, although, no way t…
Browse files Browse the repository at this point in the history
…o deselect other than pick a new customer, WHICH COULD BE A FEATURE NOT A BUG
  • Loading branch information
kaseea committed Jun 26, 2019
1 parent 32ae56f commit 282fe1a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/components/NavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class NavBar extends Component {
this.setState({
selectedCustomer: customer
});
console.log(customer.name)
}

onSelectMovie = (movieId) => {
Expand Down Expand Up @@ -80,13 +81,27 @@ class NavBar extends Component {


render() {
const customerSelected = (this.state.selectedCustomer) ?
(<section>
<p>selected customer is: {this.state.selectedCustomer.name}</p>
</section>) : null;

const movieSelected = (this.state.selectedMovie) ?
(<section>
<p>selected movie is: {this.state.selectedMovie.title}</p>
</section>) : null;

return (
<Router>
<div>
<li>{this.props.allMovies} </li>
<li>{this.props.allCustomers}</li>
<li>{this.props.search}</li>
</div>
<div>
{ customerSelected }
{ movieSelected }
</div>
<Route path="/customers/" render={(props) => (
<CustomerCollection
onSelectCustomerCallback={this.onSelectCustomer}
Expand Down

0 comments on commit 282fe1a

Please sign in to comment.