mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 20:24:27 -04:00
Front: EpisodeLine: Add Release date
This commit is contained in:
parent
df451f56b1
commit
9a55262856
@ -62,6 +62,10 @@ export const displayRuntime = (runtime: number) => {
|
|||||||
return `${Math.floor(runtime / 60)}h${runtime % 60}`;
|
return `${Math.floor(runtime / 60)}h${runtime % 60}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const displayAirDate = (airDate: Date) => {
|
||||||
|
return airDate.toLocaleDateString("en-US");
|
||||||
|
};
|
||||||
|
|
||||||
export const EpisodeBox = ({
|
export const EpisodeBox = ({
|
||||||
slug,
|
slug,
|
||||||
showSlug,
|
showSlug,
|
||||||
@ -248,9 +252,6 @@ export const EpisodeLine = ({
|
|||||||
props,
|
props,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<P {...css({ width: rem(4), flexShrink: 0, m: ts(1), textAlign: "center" })}>
|
|
||||||
{isLoading ? <Skeleton variant="filltext" /> : displayNumber}
|
|
||||||
</P>
|
|
||||||
<ImageBackground
|
<ImageBackground
|
||||||
src={thumbnail}
|
src={thumbnail}
|
||||||
quality="low"
|
quality="low"
|
||||||
@ -298,7 +299,7 @@ export const EpisodeLine = ({
|
|||||||
<Skeleton>
|
<Skeleton>
|
||||||
{isLoading || (
|
{isLoading || (
|
||||||
<H6 aria-level={undefined} {...css([{ flexShrink: 1 }, "title"])}>
|
<H6 aria-level={undefined} {...css([{ flexShrink: 1 }, "title"])}>
|
||||||
{name ?? t("show.episodeNoMetadata")}
|
{[displayNumber, name ?? t("show.episodeNoMetadata")].join(" · ")}
|
||||||
</H6>
|
</H6>
|
||||||
)}
|
)}
|
||||||
</Skeleton>
|
</Skeleton>
|
||||||
@ -306,7 +307,13 @@ export const EpisodeLine = ({
|
|||||||
{isLoading ||
|
{isLoading ||
|
||||||
(runtime && (
|
(runtime && (
|
||||||
<Skeleton>
|
<Skeleton>
|
||||||
{isLoading || <SubP {...css({ flexShrink: 0 })}>{displayRuntime(runtime)}</SubP>}
|
{isLoading || (
|
||||||
|
<SubP {...css({ flexShrink: 0 })}>
|
||||||
|
{[releaseDate ? displayAirDate(releaseDate) : null, displayRuntime(runtime)]
|
||||||
|
.filter((item) => item != null)
|
||||||
|
.join(" · ")}
|
||||||
|
</SubP>
|
||||||
|
)}
|
||||||
</Skeleton>
|
</Skeleton>
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user