fix(ui): hide null dates in episodes list (#3035)

pull/3033/head
Danshil Kokil Mungur 2 years ago committed by GitHub
parent 16cb53f703
commit 7404d68143
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -191,7 +191,7 @@ export interface TmdbVideo {
export interface TmdbTvEpisodeResult { export interface TmdbTvEpisodeResult {
id: number; id: number;
air_date: string; air_date: string | null;
episode_number: number; episode_number: number;
name: string; name: string;
overview: string; overview: string;

@ -29,7 +29,7 @@ import type { Video } from './Movie';
interface Episode { interface Episode {
id: number; id: number;
name: string; name: string;
airDate: string; airDate: string | null;
episodeNumber: number; episodeNumber: number;
overview: string; overview: string;
productionCode: string; productionCode: string;

@ -41,7 +41,9 @@ const Season = ({ seasonNumber, tvId }: SeasonProps) => {
<div className="flex-1"> <div className="flex-1">
<div className="flex flex-col space-y-2 xl:flex-row xl:items-center xl:space-y-0 xl:space-x-2"> <div className="flex flex-col space-y-2 xl:flex-row xl:items-center xl:space-y-0 xl:space-x-2">
<h3 className="text-lg">{episode.name}</h3> <h3 className="text-lg">{episode.name}</h3>
<AirDateBadge airDate={episode.airDate} /> {episode.airDate && (
<AirDateBadge airDate={episode.airDate} />
)}
</div> </div>
{episode.overview && <p>{episode.overview}</p>} {episode.overview && <p>{episode.overview}</p>}
</div> </div>

@ -829,6 +829,7 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
</div> </div>
)} )}
{data.nextEpisodeToAir && {data.nextEpisodeToAir &&
data.nextEpisodeToAir.airDate &&
data.nextEpisodeToAir.airDate !== data.firstAirDate && ( data.nextEpisodeToAir.airDate !== data.firstAirDate && (
<div className="media-fact"> <div className="media-fact">
<span>{intl.formatMessage(messages.nextAirDate)}</span> <span>{intl.formatMessage(messages.nextAirDate)}</span>

Loading…
Cancel
Save