Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/components/ExternalLinkBlock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import useSettings from '@app/hooks/useSettings';
import { MediaType } from '@server/constants/media';
import { MediaServerType } from '@server/constants/server';

type ExternalLinkType = 'movie' | 'tv' | 'person';

interface ExternalLinkBlockProps {
mediaType: 'movie' | 'tv';
mediaType: ExternalLinkType;
tmdbId?: number;
tvdbId?: number;
imdbId?: string;
Expand Down Expand Up @@ -71,7 +73,7 @@ const ExternalLinkBlock = ({
<TvdbLogo />
</a>
)}
{imdbId && (
{imdbId && mediaType !== 'person' && (
<a
href={`https://www.imdb.com/title/${imdbId}`}
className="w-8 opacity-50 transition duration-300 hover:opacity-100"
Expand All @@ -81,6 +83,16 @@ const ExternalLinkBlock = ({
<ImdbLogo />
</a>
)}
{imdbId && mediaType === 'person' && (
<a
href={`https://www.imdb.com/name/${imdbId}`}
className="w-8 opacity-50 transition duration-300 hover:opacity-100"
target="_blank"
rel="noreferrer"
>
<ImdbLogo />
</a>
)}
{rtUrl && (
<a
href={rtUrl}
Expand All @@ -91,7 +103,7 @@ const ExternalLinkBlock = ({
<RTLogo />
</a>
)}
{tmdbId && (
{tmdbId && mediaType !== 'person' && (
<a
href={`https://trakt.tv/search/tmdb/${tmdbId}?id_type=${
mediaType === 'movie' ? 'movie' : 'show'
Expand Down
10 changes: 10 additions & 0 deletions src/components/PersonDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import CachedImage from '@app/components/Common/CachedImage';
import ImageFader from '@app/components/Common/ImageFader';
import LoadingSpinner from '@app/components/Common/LoadingSpinner';
import PageTitle from '@app/components/Common/PageTitle';
import ExternalLinkBlock from '@app/components/ExternalLinkBlock';
import TitleCard from '@app/components/TitleCard';
import globalMessages from '@app/i18n/globalMessages';
import Error from '@app/pages/_error';
Expand Down Expand Up @@ -277,6 +278,15 @@ const PersonDetails = () => {
{mediaTypePicker}
</div>
</div>
<div className="flex w-full items-center justify-center lg:justify-between">
<div className="mt-3 mb-3">
<ExternalLinkBlock
mediaType="person"
tmdbId={data.id}
imdbId={data.imdbId}
/>
</div>
</div>
<div className="mt-1 mb-2 space-y-1 text-xs text-white sm:text-sm lg:text-base">
<div>{personAttributes.join(' | ')}</div>
{(data.alsoKnownAs ?? []).length > 0 && (
Expand Down
Loading