Update formating of detailed infos

This commit is contained in:
Grégoire Delattre 2017-04-14 22:53:02 +02:00
parent 04ef01995e
commit b8e55ec498

View File

@ -3,8 +3,12 @@ import React from 'react'
export default function ListDetails(props) { export default function ListDetails(props) {
let genres; let genres;
if (props.data.genres) { if (props.data.genres) {
genres = props.data.genres.join(', '); // Uppercase first genres
genres = props.data.genres.map(
(word) => word[0].toUpperCase() + word.substr(1)
).join(', ');
} }
return ( return (
<div className="col-xs-7 col-md-4"> <div className="col-xs-7 col-md-4">
<div className="show-detail affix"> <div className="show-detail affix">
@ -25,7 +29,10 @@ export default function ListDetails(props) {
} }
<p> <p>
<i className="fa fa-star-o"></i> <i className="fa fa-star-o"></i>
&nbsp;{props.data.rating} <small>({props.data.votes} counts)</small> &nbsp;{Number(props.data.rating).toFixed(1)}&nbsp;
{props.data.votes &&
<small>({props.data.votes} counts)</small>
}
</p> </p>
<p className="plot">{props.data.plot}</p> <p className="plot">{props.data.plot}</p>
</div> </div>