-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cbbf87f
Rearranged file structure
demaceo 4d8621b
Create SelectedMovie component
demaceo 032c203
Create boilerplate for SelectedMovie component
demaceo dd5c3e3
Added conditional rendering to App
demaceo beef2e4
Create conditional rendering with handleClick
demaceo 47df9fb
Display SelectedMovie onClick
demaceo acecb6e
Create NavBar component
demaceo 79a974c
Add functionality to NavBar component
demaceo 6bd0b0d
Display mockMovie data on SelectedMovie page
demaceo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[{"/Users/demaceovincent/rantom/src/index.js":"1","/Users/demaceovincent/rantom/src/App.js":"2","/Users/demaceovincent/rantom/src/Catalogue.js":"3","/Users/demaceovincent/rantom/src/mockData.js":"4","/Users/demaceovincent/rantom/src/MovieCard.js":"5"},{"size":198,"mtime":1606864998007,"results":"6","hashOfConfig":"7"},{"size":491,"mtime":1606867876048,"results":"8","hashOfConfig":"7"},{"size":460,"mtime":1606869592955,"results":"9","hashOfConfig":"7"},{"size":6976,"mtime":1606866733423,"results":"10","hashOfConfig":"7"},{"size":262,"mtime":1606870041064,"results":"11","hashOfConfig":"7"},{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"dy5e4r",{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"20","messages":"21","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/demaceovincent/rantom/src/index.js",[],"/Users/demaceovincent/rantom/src/App.js",[],"/Users/demaceovincent/rantom/src/Catalogue.js",[],"/Users/demaceovincent/rantom/src/mockData.js",[],"/Users/demaceovincent/rantom/src/MovieCard.js",[]] | ||
[{"/Users/demaceovincent/rantom/src/index.js":"1","/Users/demaceovincent/rantom/src/App.js":"2","/Users/demaceovincent/rantom/src/mockData.js":"3","/Users/demaceovincent/rantom/src/Components/Catalogue/Catalogue.js":"4","/Users/demaceovincent/rantom/src/Components/MovieCard/MovieCard.js":"5","/Users/demaceovincent/rantom/src/Components/SelectedMovie/SelectedMovie.js":"6","/Users/demaceovincent/rantom/src/Components/NavBar/NavBar.js":"7","/Users/demaceovincent/rantom/src/mockMovie.js":"8"},{"size":198,"mtime":1606864998007,"results":"9","hashOfConfig":"10"},{"size":1347,"mtime":1607035648950,"results":"11","hashOfConfig":"10"},{"size":6976,"mtime":1606952951770,"results":"12","hashOfConfig":"10"},{"size":601,"mtime":1607036459347,"results":"13","hashOfConfig":"10"},{"size":334,"mtime":1607034302631,"results":"14","hashOfConfig":"10"},{"size":843,"mtime":1607036765134,"results":"15","hashOfConfig":"10"},{"size":246,"mtime":1607035750849,"results":"16","hashOfConfig":"10"},{"size":630,"mtime":1607036058744,"results":"17","hashOfConfig":"10"},{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},"dy5e4r",{"filePath":"21","messages":"22","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"23","messages":"24","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},{"filePath":"25","messages":"26","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"27","messages":"28","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},{"filePath":"29","messages":"30","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"31","messages":"32","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/demaceovincent/rantom/src/index.js",[],["35","36"],"/Users/demaceovincent/rantom/src/App.js",[],"/Users/demaceovincent/rantom/src/mockData.js",[],"/Users/demaceovincent/rantom/src/Components/Catalogue/Catalogue.js",[],"/Users/demaceovincent/rantom/src/Components/MovieCard/MovieCard.js",[],"/Users/demaceovincent/rantom/src/Components/SelectedMovie/SelectedMovie.js",["37"],"/Users/demaceovincent/rantom/src/Components/NavBar/NavBar.js",[],"/Users/demaceovincent/rantom/src/mockMovie.js",[],{"ruleId":"38","replacedBy":"39"},{"ruleId":"40","replacedBy":"41"},{"ruleId":"42","severity":1,"message":"43","line":12,"column":9,"nodeType":"44","endLine":12,"endColumn":52},"no-native-reassign",["45"],"no-negated-in-lhs",["46"],"jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","JSXOpeningElement","no-global-assign","no-unsafe-negation"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//it should display movies | ||
|
||
//it should display all movies | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react' | ||
import './MovieCard.css' | ||
|
||
function MovieCard(props) { | ||
return ( | ||
<section className="card" onClick={props.handleClick}> | ||
<img src={props.poster} alt={props.title} id={props.id} onClick={props.handleClick} /> | ||
<h3>{props.title}</h3> | ||
</section> | ||
); | ||
|
||
} | ||
|
||
|
||
export default MovieCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//it should display a movie poster | ||
|
||
//it should display a movie title | ||
|
||
// should be able to click on a movie card |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from "react"; | ||
import "./NavBar.css"; | ||
|
||
function NavBar(props) { | ||
return ( | ||
<button | ||
className="nav-bar" | ||
onClick={props.returnToHome}> | ||
imma DINGUS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't forget to fix this |
||
</button> | ||
) | ||
} | ||
|
||
export default NavBar; |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
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> | ||
); | ||
} | ||
Comment on lines
+1
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Happy to have this all coded up - will need to refactor eventually |
||
|
||
export default SelectedMovie |
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const mockMovie = { | ||
"movie": { | ||
id: 1, | ||
title: "Fake Movie Title", | ||
poster_path: "https://image.tmdb.org/t/p/original//7G2VvG1lU8q758uOqU6z2Ds0qpA.jpg", | ||
backdrop_path: "https://image.tmdb.org/t/p/original//oazPqs1z78LcIOFslbKtJLGlueo.jpg", | ||
release_date: "2019-12-04", | ||
overview: "Some overview that is full of buzzwords to attempt to entice you to watch this movie! Explosions! Drama! True love! Robots! A cute dog!", | ||
average_rating: 6, | ||
genres: [{id: 18, name:"Drama"}], | ||
budget:63000000, revenue:100853753, | ||
runtime:139, | ||
tagline: "It's a movie!" | ||
} | ||
} | ||
|
||
export default mockMovie; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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