Skip to content
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

Merged
merged 9 commits into from
Dec 4, 2020
Merged

Display single movie #12

merged 9 commits into from
Dec 4, 2020

Conversation

demaceo
Copy link
Owner

@demaceo demaceo commented Dec 4, 2020

What does this PR do?

  • When a movie poster is clicked in the Catalogue, it will render the App, displaying only that selected movie's poster & title (& our mockMovie data).
  • When a user clicks the NavBar button, the App will re-render back to displaying only the Catalogue component.

Where should the reviewer start?

App.js, MovieCard.js, SelectedMovie.js, NavBar.js

How should this be manually tested?

  • Click on any poster to only view that movie's details.
  • Click the button at the top to return back home.

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 .

@demaceo demaceo added the enhancement New feature or request label Dec 4, 2020
Comment on lines +1 to +22
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>
);
}
Copy link
Collaborator

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
Copy link
Collaborator

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

Comment on lines +16 to +28

returnToHome = event => {
this.setState({
selectedMovie: 0
})
}

handleClick = event => {
this.setState({
selectedMovie: event.target
})
}

Copy link
Collaborator

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

Copy link
Collaborator

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

@CalebCyphers CalebCyphers merged commit 25bd978 into main Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return to movie list
2 participants