Skip to content

Commit

Permalink
style: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaquinOlivero committed Sep 13, 2024
1 parent 6c6e395 commit acfb7be
Show file tree
Hide file tree
Showing 3 changed files with 217 additions and 211 deletions.
84 changes: 44 additions & 40 deletions src/components/ManageSlideOver/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,36 +211,36 @@ const ManageSlideOver = ({
<div className="space-y-6">
{((data?.mediaInfo?.downloadStatus ?? []).length > 0 ||
(data?.mediaInfo?.downloadStatus4k ?? []).length > 0) && (
<div>
<h3 className="mb-2 text-xl font-bold">
{intl.formatMessage(messages.downloadstatus)}
</h3>
<div className="overflow-hidden rounded-md border border-gray-700 shadow">
<ul>
{data.mediaInfo?.downloadStatus?.map((status, index) => (
<Tooltip
key={`dl-status-${status.externalId}-${index}`}
content={status.title}
>
<li className="border-b border-gray-700 last:border-b-0">
<DownloadBlock downloadItem={status} />
</li>
</Tooltip>
))}
{data.mediaInfo?.downloadStatus4k?.map((status, index) => (
<Tooltip
key={`dl-status-${status.externalId}-${index}`}
content={status.title}
>
<li className="border-b border-gray-700 last:border-b-0">
<DownloadBlock downloadItem={status} is4k />
</li>
</Tooltip>
))}
</ul>
</div>
<div>
<h3 className="mb-2 text-xl font-bold">
{intl.formatMessage(messages.downloadstatus)}
</h3>
<div className="overflow-hidden rounded-md border border-gray-700 shadow">
<ul>
{data.mediaInfo?.downloadStatus?.map((status, index) => (
<Tooltip
key={`dl-status-${status.externalId}-${index}`}
content={status.title}
>
<li className="border-b border-gray-700 last:border-b-0">
<DownloadBlock downloadItem={status} />
</li>
</Tooltip>
))}
{data.mediaInfo?.downloadStatus4k?.map((status, index) => (
<Tooltip
key={`dl-status-${status.externalId}-${index}`}
content={status.title}
>
<li className="border-b border-gray-700 last:border-b-0">
<DownloadBlock downloadItem={status} is4k />
</li>
</Tooltip>
))}
</ul>
</div>
)}
</div>
)}
{hasPermission([Permission.MANAGE_ISSUES, Permission.VIEW_ISSUES], {
type: 'or',
}) &&
Expand Down Expand Up @@ -312,10 +312,11 @@ const ManageSlideOver = ({
<div>
{!!watchData?.data && (
<div
className={`grid grid-cols-1 divide-y divide-gray-700 overflow-hidden border-gray-700 text-sm text-gray-300 shadow ${data.mediaInfo?.tautulliUrl
className={`grid grid-cols-1 divide-y divide-gray-700 overflow-hidden border-gray-700 text-sm text-gray-300 shadow ${
data.mediaInfo?.tautulliUrl
? 'rounded-t-md border-x border-t'
: 'rounded-md border'
}`}
}`}
>
<div className="grid grid-cols-3 divide-x divide-gray-700">
<div className="px-4 py-3">
Expand Down Expand Up @@ -390,8 +391,9 @@ const ManageSlideOver = ({
>
<Button
buttonType="ghost"
className={`w-full ${watchData?.data ? 'rounded-t-none' : ''
}`}
className={`w-full ${
watchData?.data ? 'rounded-t-none' : ''
}`}
>
<Bars4Icon />
<span>
Expand Down Expand Up @@ -469,10 +471,11 @@ const ManageSlideOver = ({
<div>
{watchData?.data4k && (
<div
className={`grid grid-cols-1 divide-y divide-gray-700 overflow-hidden border-gray-700 text-sm text-gray-300 shadow ${data.mediaInfo?.tautulliUrl4k
className={`grid grid-cols-1 divide-y divide-gray-700 overflow-hidden border-gray-700 text-sm text-gray-300 shadow ${
data.mediaInfo?.tautulliUrl4k
? 'rounded-t-md border-x border-t'
: 'rounded-md border'
}`}
}`}
>
<div className="grid grid-cols-3 divide-x divide-gray-700">
<div className="px-4 py-3">
Expand Down Expand Up @@ -549,8 +552,9 @@ const ManageSlideOver = ({
>
<Button
buttonType="ghost"
className={`w-full ${watchData?.data4k ? 'rounded-t-none' : ''
}`}
className={`w-full ${
watchData?.data4k ? 'rounded-t-none' : ''
}`}
>
<Bars4Icon />
<span>
Expand Down Expand Up @@ -673,12 +677,12 @@ const ManageSlideOver = ({
),
mediaServerName:
settings.currentSettings.mediaServerType ===
MediaServerType.EMBY
MediaServerType.EMBY
? 'Emby'
: settings.currentSettings.mediaServerType ===
MediaServerType.PLEX
? 'Plex'
: 'Jellyfin',
? 'Plex'
: 'Jellyfin',
})}
</div>
</div>
Expand Down
110 changes: 55 additions & 55 deletions src/components/MovieDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => {
const region = user?.settings?.region
? user.settings.region
: settings.currentSettings.region
? settings.currentSettings.region
: 'US';
? settings.currentSettings.region
: 'US';

const releases = data.releases.results.find(
(r) => r.iso_3166_1 === region
Expand Down Expand Up @@ -775,75 +775,75 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => {
(ratingData?.rt?.audienceRating &&
!!ratingData?.rt?.audienceScore) ||
ratingData?.imdb?.criticsScore) && (
<div className="media-ratings">
{ratingData?.rt?.criticsRating &&
!!ratingData?.rt?.criticsScore && (
<Tooltip
content={intl.formatMessage(messages.rtcriticsscore)}
>
<a
href={ratingData.rt.url}
className="media-rating"
target="_blank"
rel="noreferrer"
>
{ratingData.rt.criticsRating === 'Rotten' ? (
<RTRotten className="w-6" />
) : (
<RTFresh className="w-6" />
)}
<span>{ratingData.rt.criticsScore}%</span>
</a>
</Tooltip>
)}
{ratingData?.rt?.audienceRating &&
!!ratingData?.rt?.audienceScore && (
<Tooltip
content={intl.formatMessage(messages.rtaudiencescore)}
>
<a
href={ratingData.rt.url}
className="media-rating"
target="_blank"
rel="noreferrer"
>
{ratingData.rt.audienceRating === 'Spilled' ? (
<RTAudRotten className="w-6" />
) : (
<RTAudFresh className="w-6" />
)}
<span>{ratingData.rt.audienceScore}%</span>
</a>
</Tooltip>
)}
{ratingData?.imdb?.criticsScore && (
<Tooltip content={intl.formatMessage(messages.imdbuserscore)}>
<div className="media-ratings">
{ratingData?.rt?.criticsRating &&
!!ratingData?.rt?.criticsScore && (
<Tooltip
content={intl.formatMessage(messages.rtcriticsscore)}
>
<a
href={ratingData.imdb.url}
href={ratingData.rt.url}
className="media-rating"
target="_blank"
rel="noreferrer"
>
<ImdbLogo className="mr-1 w-6" />
<span>{ratingData.imdb.criticsScore}</span>
{ratingData.rt.criticsRating === 'Rotten' ? (
<RTRotten className="w-6" />
) : (
<RTFresh className="w-6" />
)}
<span>{ratingData.rt.criticsScore}%</span>
</a>
</Tooltip>
)}
{!!data.voteCount && (
<Tooltip content={intl.formatMessage(messages.tmdbuserscore)}>
{ratingData?.rt?.audienceRating &&
!!ratingData?.rt?.audienceScore && (
<Tooltip
content={intl.formatMessage(messages.rtaudiencescore)}
>
<a
href={`https://www.themoviedb.org/movie/${data.id}?language=${locale}`}
href={ratingData.rt.url}
className="media-rating"
target="_blank"
rel="noreferrer"
>
<TmdbLogo className="mr-1 w-6" />
<span>{Math.round(data.voteAverage * 10)}%</span>
{ratingData.rt.audienceRating === 'Spilled' ? (
<RTAudRotten className="w-6" />
) : (
<RTAudFresh className="w-6" />
)}
<span>{ratingData.rt.audienceScore}%</span>
</a>
</Tooltip>
)}
</div>
)}
{ratingData?.imdb?.criticsScore && (
<Tooltip content={intl.formatMessage(messages.imdbuserscore)}>
<a
href={ratingData.imdb.url}
className="media-rating"
target="_blank"
rel="noreferrer"
>
<ImdbLogo className="mr-1 w-6" />
<span>{ratingData.imdb.criticsScore}</span>
</a>
</Tooltip>
)}
{!!data.voteCount && (
<Tooltip content={intl.formatMessage(messages.tmdbuserscore)}>
<a
href={`https://www.themoviedb.org/movie/${data.id}?language=${locale}`}
className="media-rating"
target="_blank"
rel="noreferrer"
>
<TmdbLogo className="mr-1 w-6" />
<span>{Math.round(data.voteAverage * 10)}%</span>
</a>
</Tooltip>
)}
</div>
)}
{data.originalTitle &&
data.originalLanguage !== locale.slice(0, 2) && (
<div className="media-fact">
Expand Down
Loading

0 comments on commit acfb7be

Please sign in to comment.