>,
@@ -76,7 +76,7 @@ export const LI = ({ children, ...props }: TextProps) => {
const { css } = useYoshiki();
return (
-
+
{t("show.genre")}:{" "}
{(isLoading ? [...Array(3)] : genres!).map((genre, i) => (
- <>
- {i !== 0 && ", "}
+
+ {i !== 0 && ", "}
{isLoading ? (
-
+
) : (
-
- {genre.name}
-
+ {genre.name}
)}
- >
+
))}
@@ -278,65 +277,52 @@ const Description = ({
);
};
-export const ShowHeader = ({
- query,
- slug,
-}: {
- query: QueryIdentifier;
- slug: string;
-}) => {
- /* const scroll = useScroll(); */
+export const Header = ({ query, slug }: { query: QueryIdentifier; slug: string }) => {
const { css } = useYoshiki();
- // TODO: tweek the navbar color with the theme.
return (
- <>
-
-
- {({ isLoading, ...data }) => (
-
-
- {/* TODO: Add a shadow on navbar items */}
- {/* TODO: Put the navbar outside of the scrollbox */}
-
-
-
-
+ {({ isLoading, ...data }) => (
+
+
+
+
-
- )}
-
- >
+
+
+
+ )}
+
);
};
diff --git a/front/packages/ui/src/details/index.tsx b/front/packages/ui/src/details/index.tsx
index f99e1951..becc4444 100644
--- a/front/packages/ui/src/details/index.tsx
+++ b/front/packages/ui/src/details/index.tsx
@@ -19,7 +19,10 @@
*/
import { Movie, MovieP, QueryIdentifier, QueryPage } from "@kyoo/models";
-import { ShowHeader } from "./header";
+import { Navbar } from "../navbar";
+import { DefaultLayout } from "../layout";
+import { Header } from "./header";
+import { Staff } from "./staff";
const query = (slug: string): QueryIdentifier => ({
parser: MovieP,
@@ -32,16 +35,16 @@ const query = (slug: string): QueryIdentifier => ({
export const MovieDetails: QueryPage<{ slug: string }> = ({ slug }) => {
return (
<>
- {/* */}
- {/* {makeTitle(data?.name)} */}
- {/* */}
- {/* */}
-
- {/* */}
+
+ {/* */}
>
);
};
-MovieDetails.getFetchUrls = ({ slug }) => [//query(slug),
- // ShowStaff.query(slug), Navbar.query()
+MovieDetails.getFetchUrls = ({ slug }) => [
+ query(slug),
+ // ShowStaff.query(slug),
+ Navbar.query(),
];
+
+MovieDetails.getLayout = DefaultLayout;
diff --git a/front/packages/ui/src/details/staff.tsx b/front/packages/ui/src/details/staff.tsx
index 1976b648..ec4f44ba 100644
--- a/front/packages/ui/src/details/staff.tsx
+++ b/front/packages/ui/src/details/staff.tsx
@@ -18,30 +18,40 @@
* along with Kyoo. If not, see .
*/
-export {}
-// export const ShowStaff = ({ slug }: { slug: string }) => {
-// const { items, isError, error } = useInfiniteFetch(ShowStaff.query(slug));
-// const { t } = useTranslation("browse");
+import { Person, PersonP, QueryIdentifier } from "@kyoo/models";
+import { useTranslation } from "react-i18next";
+import { InfiniteFetch } from "../fetch-infinite";
+import { PersonAvatar } from "./person";
-// // TODO: handle infinite scroll
+export const Staff = ({ slug }: { slug: string }) => {
+ const { t } = useTranslation();
-// if (isError) return ;
+ // TODO: handle infinite scroll
-// return (
-//
-// {(items ?? [...Array(20)]).map((x, i) => (
-//
-// ))}
-//
-// );
-// };
+ return (
+
+ {/* */}
+ {(item, key) => (
+
+ )}
+
+ );
+};
-// ShowStaff.query = (slug: string): QueryIdentifier => ({
-// parser: PersonP,
-// path: ["shows", slug, "people"],
-// infinite: true,
-// });
+Staff.query = (slug: string): QueryIdentifier => ({
+ parser: PersonP,
+ path: ["shows", slug, "people"],
+ infinite: true,
+});
diff --git a/front/packages/ui/src/fetch.tsx b/front/packages/ui/src/fetch.tsx
index 5718726a..efd3ad26 100644
--- a/front/packages/ui/src/fetch.tsx
+++ b/front/packages/ui/src/fetch.tsx
@@ -20,6 +20,7 @@
import { Page, QueryIdentifier, useFetch, KyooErrors } from "@kyoo/models";
import { Breakpoint, P } from "@kyoo/primitives";
+import { Fragment } from "react";
import { View } from "react-native";
import { useYoshiki } from "yoshiki/native";
@@ -47,14 +48,12 @@ export const Fetch = ({
const { data, error } = useFetch(query);
if (error) return ;
+ if (placeholderCount === 1 || !isPage