1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

New: Added more external links to add movie (#4603)

This commit is contained in:
nitsua 2020-07-29 21:33:49 -04:00 committed by GitHub
parent ca8f4acdaa
commit c9324bc357
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 76 additions and 20 deletions

View File

@ -47,18 +47,12 @@
color: $disabledColor; color: $disabledColor;
} }
.tmdbLink { .externalLink {
composes: link from '~Components/Link/Link.css'; margin-top: 5px;
margin-top: -4px;
margin-left: auto; margin-left: auto;
color: $textColor; color: $textColor;
} }
.tmdbLinkIcon {
margin-left: 10px;
}
.alreadyExistsIcon { .alreadyExistsIcon {
margin-left: 10px; margin-left: 10px;
color: #37bc9b; color: #37bc9b;

View File

@ -39,7 +39,7 @@ class AddNewMovieSearchResult extends Component {
this.setState({ isNewAddMovieModalOpen: false }); this.setState({ isNewAddMovieModalOpen: false });
} }
onTMDBLinkPress = (event) => { onExternalLinkPress = (event) => {
event.stopPropagation(); event.stopPropagation();
} }
@ -49,6 +49,7 @@ class AddNewMovieSearchResult extends Component {
render() { render() {
const { const {
tmdbId, tmdbId,
imdbId,
title, title,
titleSlug, titleSlug,
year, year,
@ -117,17 +118,41 @@ class AddNewMovieSearchResult extends Component {
/> />
} }
<Link {
className={styles.tmdbLink} isSmallScreen ?
to={`https://www.themoviedb.org/movie/${tmdbId}`} null :
onPress={this.onTMDBLinkPress} <div className={styles.externalLink}>
> <Link
<Icon to={`https://www.themoviedb.org/movie/${tmdbId}`}
className={styles.tmdbLinkIcon} onPress={this.onExternalLinkPress}
name={icons.EXTERNAL_LINK} >
size={28} <Label size={sizes.LARGE}>
/> TMDb
</Link> </Label>
</Link>
{
imdbId &&
<Link
to={`https://www.imdb.com/title/${imdbId}`}
onPress={this.onExternalLinkPress}
>
<Label size={sizes.LARGE}>
IMDb
</Label>
</Link>
}
<Link
to={`https://trakt.tv/search/tmdb/${tmdbId}?id_type=movie`}
onPress={this.onExternalLinkPress}
>
<Label size={sizes.LARGE}>
Trakt
</Label>
</Link>
</div>
}
</div> </div>
<div> <div>
@ -156,6 +181,42 @@ class AddNewMovieSearchResult extends Component {
} }
</div> </div>
{
isSmallScreen ?
<div className={styles.externalLink}>
<Link
to={`https://www.themoviedb.org/movie/${tmdbId}`}
onPress={this.onExternalLinkPress}
>
<Label size={sizes.LARGE}>
TMDb
</Label>
</Link>
{
imdbId &&
<Link
to={`https://www.imdb.com/title/${imdbId}`}
onPress={this.onExternalLinkPress}
>
<Label size={sizes.LARGE}>
IMDb
</Label>
</Link>
}
<Link
to={`https://trakt.tv/search/tmdb/${tmdbId}?id_type=movie`}
onPress={this.onExternalLinkPress}
>
<Label size={sizes.LARGE}>
Trakt
</Label>
</Link>
</div> :
null
}
<div className={styles.overview}> <div className={styles.overview}>
{overview} {overview}
</div> </div>
@ -179,6 +240,7 @@ class AddNewMovieSearchResult extends Component {
AddNewMovieSearchResult.propTypes = { AddNewMovieSearchResult.propTypes = {
tmdbId: PropTypes.number.isRequired, tmdbId: PropTypes.number.isRequired,
imdbId: PropTypes.string,
title: PropTypes.string.isRequired, title: PropTypes.string.isRequired,
titleSlug: PropTypes.string.isRequired, titleSlug: PropTypes.string.isRequired,
year: PropTypes.number.isRequired, year: PropTypes.number.isRequired,