New: Added Running Years into the shows details

This commit is contained in:
Robin Dadswell 2021-05-25 20:03:01 +01:00 committed by Mark McDowall
parent c30ce3580a
commit 98e5442f24
3 changed files with 19 additions and 1 deletions

View File

@ -2,3 +2,7 @@
margin-right: 5px;
color: $themeRed;
}
.rating {
margin-right: 15px;
}

View File

@ -6,7 +6,7 @@ import styles from './HeartRating.css';
function HeartRating({ rating, iconSize }) {
return (
<span>
<span className={styles.rating}>
<Icon
className={styles.heart}
name={icons.HEART}

View File

@ -57,6 +57,11 @@ function getExpandedState(newState) {
};
}
function getDateYear(date) {
const dateDate = new Date(date);
return dateDate.getFullYear();
}
class SeriesDetails extends Component {
//
@ -192,6 +197,8 @@ class SeriesDetails extends Component {
seasons,
alternateTitles,
tags,
year,
previousAiring,
isSaving,
isRefreshing,
isSearching,
@ -229,6 +236,7 @@ class SeriesDetails extends Component {
} = this.state;
const statusDetails = getSeriesStatusDetails(status);
const runningYears = statusDetails.title === 'Ended' ? `${year}-${getDateYear(previousAiring)}` : `${year}-`;
let episodeFilesCountMessage = 'No episode files';
@ -414,6 +422,10 @@ class SeriesDetails extends Component {
rating={ratings.value}
iconSize={20}
/>
<span>
{runningYears}
</span>
</div>
</div>
@ -706,6 +718,8 @@ SeriesDetails.propTypes = {
seasons: PropTypes.arrayOf(PropTypes.object).isRequired,
alternateTitles: PropTypes.arrayOf(PropTypes.object).isRequired,
tags: PropTypes.arrayOf(PropTypes.number).isRequired,
year: PropTypes.number.isRequired,
previousAiring: PropTypes.string,
isSaving: PropTypes.bool.isRequired,
saveError: PropTypes.object,
isRefreshing: PropTypes.bool.isRequired,