Add year to MovieTitleLink

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

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

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

Loading…
Cancel
Save