touched file

This commit is contained in:
andres alcocer
2021-10-06 11:08:48 -04:00
parent ddc766288c
commit 4eb5b6f8b3

View File

@@ -10,18 +10,17 @@ class Home extends Component {
toggleModal: false, toggleModal: false,
/** Holds the movie information for a single movie. */ /** Holds the movie information for a single movie. */
movieOverview: {}, movieOverview: {},
} };
/* Get the appropriate details for a specific movie that was clicked */ /* Get the appropriate details for a specific movie that was clicked */
selectMovieHandler = async (movie) => { selectMovieHandler = async (movie) => {
this.setState({ toggleModal: true }); this.setState({ toggleModal: true });
await this.setState({ movieOverview: movie }); await this.setState({ movieOverview: movie });
} };
closeModal = () => { closeModal = () => {
this.setState({ toggleModal: false }); this.setState({ toggleModal: false });
} };
render() { render() {
return ( return (
@@ -29,9 +28,11 @@ class Home extends Component {
<div className="main-content"> <div className="main-content">
<MainContent selectMovieHandler={this.selectMovieHandler} /> <MainContent selectMovieHandler={this.selectMovieHandler} />
</div> </div>
<Modal show={this.state.toggleModal} <Modal
show={this.state.toggleModal}
modalClosed={this.closeModal} modalClosed={this.closeModal}
movie={this.state.movieOverview}> movie={this.state.movieOverview}
>
<MovieDetails movie={this.state.movieOverview} /> <MovieDetails movie={this.state.movieOverview} />
</Modal> </Modal>
</> </>