From 42869cb28f6145613ab2768b694677fd09c23462 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 30 Oct 2023 01:49:01 +0100 Subject: [PATCH] Style episodes in the news list --- front/packages/ui/src/browse/grid.tsx | 2 +- front/packages/ui/src/details/episode.tsx | 57 ++++++++++++++++++++--- front/packages/ui/src/home/news.tsx | 10 ++-- 3 files changed, 59 insertions(+), 10 deletions(-) diff --git a/front/packages/ui/src/browse/grid.tsx b/front/packages/ui/src/browse/grid.tsx index 3d4deee1..03106289 100644 --- a/front/packages/ui/src/browse/grid.tsx +++ b/front/packages/ui/src/browse/grid.tsx @@ -20,7 +20,7 @@ import { KyooImage } from "@kyoo/models"; import { Link, Skeleton, Poster, ts, focusReset, P, SubP } from "@kyoo/primitives"; -import { ImageStyle, Platform } from "react-native"; +import { ImageStyle } from "react-native"; import { percent, px, Stylable, Theme, useYoshiki } from "yoshiki/native"; import { Layout, WithLoading } from "../fetch"; diff --git a/front/packages/ui/src/details/episode.tsx b/front/packages/ui/src/details/episode.tsx index 0483e34b..8cfc6c9d 100644 --- a/front/packages/ui/src/details/episode.tsx +++ b/front/packages/ui/src/details/episode.tsx @@ -18,7 +18,7 @@ * along with Kyoo. If not, see . */ -import { focusReset, H6, Image, ImageProps, Link, P, Skeleton, ts } from "@kyoo/primitives"; +import { focusReset, H6, Image, ImageProps, Link, P, Skeleton, SubP, ts } from "@kyoo/primitives"; import { useTranslation } from "react-i18next"; import { ImageStyle, View } from "react-native"; import { Layout, WithLoading } from "../fetch"; @@ -44,26 +44,71 @@ export const EpisodeBox = ({ overview, thumbnail, isLoading, + href, ...props }: Stylable & WithLoading<{ name: string | null; - overview: string; + overview: string | null; + href: string; thumbnail?: ImageProps["src"] | null; }>) => { + const { css } = useYoshiki("episodebox"); const { t } = useTranslation(); return ( - + theme.background, + borderWidth: ts(0.5), + borderStyle: "solid", + }, + }, + fover: { + self: focusReset, + poster: { + borderColor: (theme: Theme) => theme.accent, + }, + title: { + textDecorationLine: "underline", + }, + }, + }, + props, + )} + > - {isLoading ||

{name ?? t("show.episodeNoMetadata")}

}
- {isLoading ||

{overview}

}
-
+ + {isLoading || ( +

+ {name ?? t("show.episodeNoMetadata")} +

+ )} +
+ + {isLoading || ( + + {overview} + + )} + + ); }; diff --git a/front/packages/ui/src/home/news.tsx b/front/packages/ui/src/home/news.tsx index 75ece79a..9fb2f5e6 100644 --- a/front/packages/ui/src/home/news.tsx +++ b/front/packages/ui/src/home/news.tsx @@ -37,7 +37,7 @@ import ChevronRight from "@material-symbols/svg-400/rounded/chevron_right-fill.s import { InfiniteFetch, InfiniteFetchList } from "../fetch-infinite"; import { useTranslation } from "react-i18next"; import { Header } from "./genre"; -import { EpisodeBox } from "../details/episode"; +import { EpisodeBox, episodeDisplayNumber } from "../details/episode"; export const NewsList = () => { const { t } = useTranslation(); @@ -62,8 +62,12 @@ export const NewsList = () => { ) : ( )