Add year to MovieTitleLink

pull/8842/head
Bogdan 1 year ago
parent faaef80a80
commit a2216f23ec

@ -7,7 +7,8 @@ class MovieTitleLink extends PureComponent {
render() { render() {
const { const {
titleSlug, titleSlug,
title title,
year
} = this.props; } = this.props;
const link = `/movie/${titleSlug}`; const link = `/movie/${titleSlug}`;
@ -17,7 +18,7 @@ class MovieTitleLink extends PureComponent {
to={link} to={link}
title={title} title={title}
> >
{title} {title}{year > 0 ? ` (${year})` : ''}
</Link> </Link>
); );
} }
@ -25,7 +26,8 @@ class MovieTitleLink extends PureComponent {
MovieTitleLink.propTypes = { MovieTitleLink.propTypes = {
titleSlug: PropTypes.string.isRequired, titleSlug: PropTypes.string.isRequired,
title: PropTypes.string.isRequired title: PropTypes.string.isRequired,
year: PropTypes.number
}; };
export default MovieTitleLink; export default MovieTitleLink;

@ -130,7 +130,11 @@ function ParseResult(props: ParseResultProps) {
title={translate('MatchedToMovie')} title={translate('MatchedToMovie')}
data={ data={
movie ? ( movie ? (
<MovieTitleLink titleSlug={movie.titleSlug} title={movie.title} /> <MovieTitleLink
titleSlug={movie.titleSlug}
title={movie.title}
year={movie.year}
/>
) : ( ) : (
'-' '-'
) )

Loading…
Cancel
Save