Don't render all the movies at once
This commit is contained in:
parent
6b93ee5900
commit
11b7c08722
@ -84,6 +84,7 @@ ReactDOM.render((
|
|||||||
<Route path="/users/edit" component={UserIsAuthenticated(UserEdit)} />
|
<Route path="/users/edit" component={UserIsAuthenticated(UserEdit)} />
|
||||||
<Route path="/movies/popular" component={UserIsAuthenticated(MovieListPopular)} />
|
<Route path="/movies/popular" component={UserIsAuthenticated(MovieListPopular)} />
|
||||||
<Route path="/movies/polochon" component={UserIsAuthenticated(MovieListPolochon)} />
|
<Route path="/movies/polochon" component={UserIsAuthenticated(MovieListPolochon)} />
|
||||||
|
<Route path="/movies/polochon/:page" component={UserIsAuthenticated(MovieListPolochon)} />
|
||||||
</Route>
|
</Route>
|
||||||
</Router>
|
</Router>
|
||||||
</Provider>
|
</Provider>
|
||||||
|
@ -2,7 +2,17 @@ import React from 'react'
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
function MoviePosters(props) {
|
function MoviePosters(props) {
|
||||||
const movies = props.movies;
|
// TODO handle the limit from the url
|
||||||
|
const perPage = 30;
|
||||||
|
|
||||||
|
let movies;
|
||||||
|
// Let's limit the number for now
|
||||||
|
if (props.movies.length > perPage) {
|
||||||
|
movies = props.movies.slice(0, perPage);
|
||||||
|
} else {
|
||||||
|
movies = props.movies;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="col-xs-5 col-md-8">
|
<div className="col-xs-5 col-md-8">
|
||||||
<div className="row">
|
<div className="row">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user