Add show next up episode

This commit is contained in:
Zoe Roux 2023-12-04 02:12:31 +01:00
parent bd48032a50
commit fe155898bb
5 changed files with 37 additions and 6 deletions

View File

@ -27,7 +27,7 @@ import { StudioP } from "./studio";
import { BaseEpisodeP } from "./episode.base"; import { BaseEpisodeP } from "./episode.base";
import { CollectionP } from "./collection"; import { CollectionP } from "./collection";
import { MetadataP } from "./metadata"; import { MetadataP } from "./metadata";
import { ShowWatchStatusP, WatchStatusP } from "./watch-status"; import { ShowWatchStatusP } from "./watch-status";
/** /**
* The enum containing show's status. * The enum containing show's status.

View File

@ -28,7 +28,7 @@ import {
import { Container, H2, ImageBackground, Link, P, focusReset, ts } from "@kyoo/primitives"; import { Container, H2, ImageBackground, Link, P, focusReset, ts } from "@kyoo/primitives";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Theme, useYoshiki } from "yoshiki/native"; import { Theme, useYoshiki } from "yoshiki/native";
import { ErrorView, Fetch } from "../fetch"; import { ErrorView } from "../fetch";
export const PartOf = ({ export const PartOf = ({
name, name,

View File

@ -47,6 +47,8 @@ import {
ts, ts,
Chip, Chip,
DottedSeparator, DottedSeparator,
focusReset,
SwitchVariant,
} from "@kyoo/primitives"; } from "@kyoo/primitives";
import { Fragment } from "react"; import { Fragment } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
@ -68,9 +70,9 @@ import { Fetch } from "../fetch";
import PlayArrow from "@material-symbols/svg-400/rounded/play_arrow-fill.svg"; import PlayArrow from "@material-symbols/svg-400/rounded/play_arrow-fill.svg";
import Theaters from "@material-symbols/svg-400/rounded/theaters-fill.svg"; import Theaters from "@material-symbols/svg-400/rounded/theaters-fill.svg";
import { Rating } from "../components/rating"; import { Rating } from "../components/rating";
import { displayRuntime } from "./episode"; import { EpisodeLine, displayRuntime, episodeDisplayNumber } from "./episode";
import { WatchListInfo } from "../components/watchlist-info"; import { WatchListInfo } from "../components/watchlist-info";
import { WatchStatusV } from "@kyoo/models/src/resources/watch-status"; import { ShowWatchStatus, WatchStatusV } from "@kyoo/models/src/resources/watch-status";
export const TitleLine = ({ export const TitleLine = ({
isLoading, isLoading,
@ -474,6 +476,33 @@ export const Header = ({
</Chip> </Chip>
))} ))}
</Container> </Container>
{type === "show" && (data.watchStatus as ShowWatchStatus)?.nextEpisode && (
<SwitchVariant>
{({ css }) => (
<Container
{...css({
marginY: ts(2),
borderRadius: 16,
overflow: "hidden",
borderWidth: ts(0.5),
borderStyle: "solid",
borderColor: (theme) => theme.background,
backgroundColor: (theme) => theme.background,
fover: {
self: { ...focusReset, borderColor: (theme: Theme) => theme.accent },
},
})}
>
<H2 {...css({ marginLeft: ts(2) })}>{t("show.nextUp")}</H2>
<EpisodeLine
isLoading={false}
{...(data.watchStatus as ShowWatchStatus).nextEpisode!}
displayNumber={episodeDisplayNumber((data.watchStatus as ShowWatchStatus).nextEpisode!)!}
/>
</Container>
)}
</SwitchVariant>
)}
</> </>
)} )}
</Fetch> </Fetch>

View File

@ -30,7 +30,8 @@
"watching": "Mark as watching", "watching": "Mark as watching",
"droped": "Mark as dropped", "droped": "Mark as dropped",
"null": "Mark as not seen" "null": "Mark as not seen"
} },
"nextUp": "Next up"
}, },
"browse": { "browse": {
"sortby": "Sort by {{key}}", "sortby": "Sort by {{key}}",

View File

@ -30,7 +30,8 @@
"watching": "Marquer en cours de visionnage", "watching": "Marquer en cours de visionnage",
"droped": "Marquer comme abandonné", "droped": "Marquer comme abandonné",
"null": "Marquer comme non vu" "null": "Marquer comme non vu"
} },
"nextUp": "Continuer"
}, },
"browse": { "browse": {
"sortby": "Trier par {{key}}", "sortby": "Trier par {{key}}",