-
Notifications
You must be signed in to change notification settings - Fork 35
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
react-cinema #17
Open
jay9044
wants to merge
9
commits into
constructorlabs:master
Choose a base branch
from
jay9044:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
react-cinema #17
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7054b4a
search working, hero working, need to fix hero showing at bottom
jay9044 0df9c6b
latest
jay9044 30bb5bd
latest
jay9044 06f666b
desktop fixed
jay9044 c9c7008
pagination working
jay9044 2a3730b
pagination working and buttons styled
jay9044 ba98c01
latest
jay9044 6f0935b
styles and favourites added but not working
jay9044 0fe8351
latest and working video autoplay
jay9044 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
latest
- Loading branch information
commit 30bb5bd3da137e59e432a299b0866ebd0b6be09e
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React from 'react'; | ||
|
||
class Displayresults extends React.Component { | ||
constructor(){ | ||
super() | ||
this.fetchFilmInfo = this.fetchFilmInfo.bind(this) | ||
|
||
this.state ={ | ||
info: {}, | ||
MovieInfoHeading: '' | ||
} | ||
} | ||
|
||
|
||
|
||
fetchFilmInfo(){ | ||
|
||
fetch(`http://www.omdbapi.com/?apikey=8d5ab09&i=${this.props.movie.imdbID}`) | ||
.then(response => response.json()) | ||
.then(body => | ||
this.setState({ | ||
info: body, | ||
MovieInfoHeading: 'Movie Information:', | ||
Plot: `Plot: ${body.Plot}`, | ||
imdbRating: `Rating: ${body.imdbRating}`, | ||
Director: `Director: ${body.Director}`, | ||
Genre: `Genre: ${body.Genre}`, | ||
Runtime: `Runtime: ${body.Runtime}`, | ||
|
||
|
||
})) | ||
} | ||
|
||
render(){ | ||
return ( | ||
|
||
<div className='results' > | ||
<h1 className='scroll-heading'>{this.props.movie.Title} ({this.props.movie.Year})</h1> | ||
<span>Click For Movie Info</span> | ||
<img onClick={this.fetchFilmInfo} className='posters' src={this.props.movie.Poster} /> | ||
<p>{this.state.Plot} </p> | ||
<p>{this.state.imdbRating}</p> | ||
<p>{this.state.Director}</p> | ||
<p>{this.state.Genre}</p> | ||
<p>{this.state.Runtime}</p> | ||
|
||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Displayresults; | ||
|
||
|
||
|
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,49 @@ | ||
import React from 'react'; | ||
|
||
|
||
class Hero extends React.Component { | ||
constructor(){ | ||
super(); | ||
this.fetchHero = this.fetchHero.bind(this) | ||
this.state ={ | ||
movie: [] | ||
} | ||
} | ||
|
||
fetchHero(){ | ||
fetch("http://www.omdbapi.com/?apikey=8d5ab09&i=tt1270797") | ||
.then(response => response.json()) | ||
.then(body => {(console.log(body)) | ||
this.setState({ | ||
movie: body | ||
}) | ||
}) | ||
} | ||
|
||
componentDidMount(){ | ||
this.fetchHero() | ||
} | ||
|
||
|
||
|
||
render(){ | ||
return ( | ||
|
||
<div> | ||
<h2 className='hero-heading'>Today's Featured Film </h2> | ||
<p className='scroll-heading'>VENOM</p> | ||
<p className='scroll-heading'>In Theatres Soon!</p> | ||
<h3 className='scroll-heading'>Scroll down to watch the trailer</h3> | ||
<div className='hero-landing'> | ||
<img onClick={this.handleClick} className='hero-image' src={this.state.movie.Poster} /> | ||
</div> | ||
<div className='hero-video'> | ||
<iframe width="560" height="315" src="https://www.youtube.com/embed/xLCn88bfW1o?autoplay=1" frameBorder="0" allowFullScreen></iframe> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Hero; | ||
|
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 Displayresults from './Displayresults' | ||
class Results extends React.Component { | ||
render(){ | ||
return ( | ||
<div> | ||
{this.props.moviesArray.map(movie => { | ||
return <Displayresults key={movie.imdbID} movie={movie}/> | ||
})} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Results; |
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,38 @@ | ||
import React from 'react'; | ||
import Displayresults from './Displayresults' | ||
class Search extends React.Component { | ||
constructor(){ | ||
super() | ||
this.state = { | ||
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. It looks like the search query is stored both in |
||
text: "" | ||
} | ||
this.handleSubmit = this.handleSubmit.bind(this) | ||
this.handleChange = this.handleChange.bind(this) | ||
} | ||
|
||
handleChange(event){ | ||
this.setState({ | ||
text:event.target.value | ||
}) | ||
} | ||
|
||
handleSubmit(event){ | ||
//capture user input submit | ||
event.preventDefault() | ||
this.props.receiver(this.state.text) | ||
|
||
} | ||
|
||
|
||
render(){ | ||
return ( | ||
|
||
<form onSubmit={this.handleSubmit}> | ||
<input type='text' placeholder='Search For A Movie..' onChange={this.handleChange}/> | ||
<button type='submit'>Search..</button> | ||
</form> | ||
); | ||
} | ||
} | ||
|
||
export default Search; |
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.
It would be better to store the returned movie object in state and generate the strings to display to user in render method