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 "../polyfill";
import { HydrationBoundary, QueryClientProvider } from "@tanstack/react-query"; 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 { HiddenIfNoJs, SkeletonCss, ThemeSelector } from "@kyoo/primitives";
import { WebTooltip } from "@kyoo/primitives/src/tooltip.web"; import { WebTooltip } from "@kyoo/primitives/src/tooltip.web";
import { import {

View File

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

View File

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

View File

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

View File

@ -89,7 +89,11 @@ export const WatchlistList = () => {
) : ( ) : (
<View {...css({ justifyContent: "center", alignItems: "center" })}> <View {...css({ justifyContent: "center", alignItems: "center" })}>
<P>{t("home.watchlistLogin")}</P> <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>
)} )}
</> </>

View File

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