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