engines json

This commit is contained in:
andres alcocer
2018-11-19 16:09:41 -05:00
parent 35a583a42f
commit a4637e3093
3 changed files with 12 additions and 6 deletions

View File

@@ -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": {

View File

@@ -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;
}

View File

@@ -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 });