Format front

This commit is contained in:
Zoe Roux 2023-12-06 23:38:31 +01:00
parent f438e80d3a
commit f536713f04
6 changed files with 16 additions and 15 deletions

View File

@ -21,7 +21,7 @@
import "../polyfill";
import { HydrationBoundary, QueryClientProvider } from "@tanstack/react-query";
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import { HiddenIfNoJs, SkeletonCss, ThemeSelector } from "@kyoo/primitives";
import { WebTooltip } from "@kyoo/primitives/src/tooltip.web";
import {

View File

@ -36,8 +36,8 @@ const kyooUrl =
Platform.OS !== "web"
? process.env.PUBLIC_BACK_URL
: typeof window === "undefined"
? process.env.KYOO_URL ?? "http://localhost:5000"
: "/api";
? process.env.KYOO_URL ?? "http://localhost:5000"
: "/api";
export let kyooApiUrl: string | null = kyooUrl || null;
@ -71,8 +71,8 @@ export const queryFn = async <Data,>(
"path" in context
? (context.path.filter((x) => x) as string[])
: "pageParam" in context && context.pageParam
? [context.pageParam as string]
: (context.queryKey.filter((x) => x) as string[]),
? [context.pageParam as string]
: (context.queryKey.filter((x) => x) as string[]),
)
.join("/")
.replace("/?", "?");

View File

@ -499,7 +499,9 @@ export const Header = ({
{...(data.watchStatus as ShowWatchStatus).nextEpisode!}
watchedPercent={data.watchStatus?.watchedPercent || null}
watchedStatus={data.watchStatus?.status || null}
displayNumber={episodeDisplayNumber((data.watchStatus as ShowWatchStatus).nextEpisode!)!}
displayNumber={
episodeDisplayNumber((data.watchStatus as ShowWatchStatus).nextEpisode!)!
}
/>
</Container>
)}

View File

@ -83,12 +83,7 @@ export const GenreGrid = ({ genre }: { genre: Genre }) => {
{(x, i) => {
// only display empty list if a loading as been displayed (not durring ssr)
if (x.isLoading) displayEmpty.current = true;
return (
<ItemGrid
key={x.id ?? i}
{...itemMap(x)}
/>
);
return <ItemGrid key={x.id ?? i} {...itemMap(x)} />;
}}
</InfiniteFetchList>
</>

View File

@ -89,7 +89,11 @@ export const WatchlistList = () => {
) : (
<View {...css({ justifyContent: "center", alignItems: "center" })}>
<P>{t("home.watchlistLogin")}</P>
<Button text={t("login.login")} href={"/login"} {...css({ minWidth: ts(24), margin: ts(2) })}/>
<Button
text={t("login.login")}
href={"/login"}
{...css({ minWidth: ts(24), margin: ts(2) })}
/>
</View>
)}
</>

View File

@ -68,7 +68,7 @@ export const WatchStatusObserver = ({
// update watch status when play status change (and on mount).
const isPlaying = useAtomValue(playAtom);
useEffect(() => {
mutate(readProgress())
}, [type, slug, isPlaying, readProgress, mutate])
mutate(readProgress());
}, [type, slug, isPlaying, readProgress, mutate]);
return null;
};