commit
e2fa98f7c3
@ -10,6 +10,7 @@ export default function ListDetails(props) {
|
||||
<div className="show-detail affix">
|
||||
<h1 className="hidden-xs">{props.data.title}</h1>
|
||||
<h3 className="visible-xs">{props.data.title}</h3>
|
||||
<h4>{props.data.year}</h4>
|
||||
{props.data.runtime &&
|
||||
<p>
|
||||
<i className="fa fa-clock-o"></i>
|
||||
|
@ -2,6 +2,10 @@ import React from 'react'
|
||||
import { Control, Form } from 'react-redux-form';
|
||||
|
||||
export default function ListFilter(props) {
|
||||
if (props.listSize === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="row">
|
||||
<div className="col-xs-12 col-md-12 list-filter">
|
||||
|
@ -50,6 +50,8 @@ export default class ListPosters extends React.Component {
|
||||
|
||||
render() {
|
||||
let elmts = this.props.data.slice();
|
||||
const listSize = elmts.length;
|
||||
const colSize = (listSize !== 0) ? "col-xs-5 col-md-8" : "col-xs-12";
|
||||
|
||||
// Filter the list of elements
|
||||
if (this.props.filter !== "") {
|
||||
@ -60,8 +62,9 @@ export default class ListPosters extends React.Component {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="col-xs-5 col-md-8">
|
||||
<div className={colSize}>
|
||||
<ListFilter
|
||||
listSize={listSize}
|
||||
formModel={this.props.formModel}
|
||||
controlModel={this.props.controlModel}
|
||||
controlPlaceHolder={this.props.controlPlaceHolder}
|
||||
|
@ -18,6 +18,8 @@ export default function movieStore(state = defaultState, action) {
|
||||
let selectedImdbId = "";
|
||||
// Select the first movie
|
||||
if (action.payload.data.length > 0) {
|
||||
// Sort by year
|
||||
action.payload.data.sort((a,b) => b.year - a.year);
|
||||
selectedImdbId = action.payload.data[0].imdb_id;
|
||||
}
|
||||
return Object.assign({}, state, {
|
||||
|
Loading…
x
Reference in New Issue
Block a user