-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display single movie #12
Conversation
import React from 'react' | ||
import './SelectedMovie.css' | ||
import mockMovie from '../../mockMovie.js' | ||
|
||
function SelectedMovie(props) { | ||
return ( | ||
<section className="selectedMovie"> | ||
<h1>{props.title}</h1> | ||
<img src={props.poster} alt={props.title} /> | ||
<h1>{mockMovie.movie.title}</h1> | ||
<h2>{mockMovie.movie.tagline}</h2> | ||
<img src={mockMovie.movie.backdrop_path} /> | ||
<p>Overview: {mockMovie.movie.overview}</p> | ||
<p>Release Date: {mockMovie.movie.release_date}</p> | ||
<p>Rating: {mockMovie.movie.average_rating}</p> | ||
<p>Genre: {mockMovie.movie.genres[0].name}</p> | ||
<p>Budget: ${mockMovie.movie.budget}</p> | ||
<p>Revenue: ${mockMovie.movie.revenue}</p> | ||
<p>Duration: {mockMovie.movie.runtime} minutes</p> | ||
</section> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to have this all coded up - will need to refactor eventually
<button | ||
className="nav-bar" | ||
onClick={props.returnToHome}> | ||
imma DINGUS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't forget to fix this
|
||
returnToHome = event => { | ||
this.setState({ | ||
selectedMovie: 0 | ||
}) | ||
} | ||
|
||
handleClick = event => { | ||
this.setState({ | ||
selectedMovie: event.target | ||
}) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps eventually we can make these one function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also event.target should resolve to an id, insted of setting the state to the full target
What does this PR do?
Catalogue
, it will render theApp
, displaying only that selected movie's poster & title (& ourmockMovie
data).NavBar
button, theApp
will re-render back to displaying only theCatalogue
component.Where should the reviewer start?
App.js, MovieCard.js, SelectedMovie.js, NavBar.js
How should this be manually tested?
Any background context you want to provide?
Still need to add CSS stylings to the Components as well as Testing suites.
What are the relevant tickets?
Closes #10 #9 #8 .