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

pull/4667/head
nitsua 4 years ago committed by GitHub
parent ca8f4acdaa
commit c9324bc357
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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;

@ -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,18 +118,42 @@ class AddNewMovieSearchResult extends Component {
/> />
} }
{
isSmallScreen ?
null :
<div className={styles.externalLink}>
<Link <Link
className={styles.tmdbLink}
to={`https://www.themoviedb.org/movie/${tmdbId}`} to={`https://www.themoviedb.org/movie/${tmdbId}`}
onPress={this.onTMDBLinkPress} onPress={this.onExternalLinkPress}
> >
<Icon <Label size={sizes.LARGE}>
className={styles.tmdbLinkIcon} TMDb
name={icons.EXTERNAL_LINK} </Label>
size={28} </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> </Link>
</div> </div>
}
</div>
<div> <div>
<Label size={sizes.LARGE}> <Label size={sizes.LARGE}>
@ -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,

Loading…
Cancel
Save