engines json
This commit is contained in:
@@ -7,6 +7,10 @@
|
||||
"start": "webpack-dev-server --open --mode development",
|
||||
"build": "webpack -p"
|
||||
},
|
||||
"engines": {
|
||||
"node": "10.1.0",
|
||||
"npm": "6.4.1"
|
||||
},
|
||||
"author": "Andres Alcocer",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
|
||||
@@ -6,6 +6,7 @@ import MovieDetails from '../../components/Movie/MovieDetails/MovieDetails';
|
||||
|
||||
class MovieGenreRow extends Component {
|
||||
|
||||
/** Hold each genre movie row in an array */
|
||||
state = {
|
||||
trendingMovieRow: [],
|
||||
netflixOriginalsRow: [],
|
||||
@@ -16,10 +17,11 @@ class MovieGenreRow extends Component {
|
||||
animatedMovieRow: [],
|
||||
documentaryRow: [],
|
||||
romanceMovieRow: [],
|
||||
toggle: false,
|
||||
movieDetails: {},
|
||||
toggleModal: false,
|
||||
}
|
||||
|
||||
/** Make all API calls as soon as our MovieGenreRow component mounts. */
|
||||
componentWillMount() {
|
||||
this.getTrending();
|
||||
this.getTopRated();
|
||||
@@ -37,16 +39,16 @@ class MovieGenreRow extends Component {
|
||||
@param {object} movieObject - A single movie object
|
||||
*/
|
||||
getMovieDetails = (movieObject) => {
|
||||
this.setState({toggle: true})
|
||||
this.setState({toggleModal: true})
|
||||
this.setState({ movieDetails: movieObject });
|
||||
}
|
||||
|
||||
closeModal = () => {
|
||||
this.setState({toggle: false})
|
||||
this.setState({toggleModal: false})
|
||||
}
|
||||
|
||||
|
||||
/** Extract our movie data */
|
||||
/** Extract our movie data and pass it to our MovieGenre Component. */
|
||||
getMovieRows = (res, url) => {
|
||||
const results = res.data.results;
|
||||
let movieRows = [];
|
||||
@@ -67,9 +69,8 @@ class MovieGenreRow extends Component {
|
||||
movie={movie} />
|
||||
movieRows.push(movieComponent);
|
||||
}
|
||||
|
||||
})
|
||||
// update state
|
||||
|
||||
return movieRows;
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ class navigation extends Component {
|
||||
window.removeEventListener('scroll', this.handleScroll);
|
||||
}
|
||||
|
||||
/** changes the scrolling state depending on the Y-position */
|
||||
handleScroll = (event) => {
|
||||
if (window.scrollY === 0 ) {
|
||||
this.setState({ scrolling: false });
|
||||
|
||||
Reference in New Issue
Block a user