diff --git a/biome.json b/biome.json index cc2a5da5..51efdf38 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.0.0/schema.json", + "$schema": "https://biomejs.dev/schemas/2.2.4/schema.json", "formatter": { "enabled": true, "formatWithErrors": true, diff --git a/front/src/components/entries/entry-box.tsx b/front/src/components/entries/entry-box.tsx index 7095ef55..c7d3d857 100644 --- a/front/src/components/entries/entry-box.tsx +++ b/front/src/components/entries/entry-box.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; import { useTranslation } from "react-i18next"; -import { Platform, View } from "react-native"; +import { View } from "react-native"; import { percent, rem, @@ -8,14 +8,11 @@ import { type Theme, useYoshiki, } from "yoshiki/native"; -import { EntryContext } from "~/components/items/context-menus"; -import { ItemProgress } from "~/components/items/item-grid"; -import type { KImage, WatchStatusV } from "~/models"; +import type { KImage } from "~/models"; import { focusReset, Image, ImageBackground, - important, Link, P, Skeleton, @@ -31,7 +28,7 @@ export const EntryBox = ({ thumbnail, href, watchedPercent, - watchedStatus, + // watchedStatus, ...props }: Stylable & { slug: string; @@ -42,7 +39,7 @@ export const EntryBox = ({ href: string; thumbnail: KImage | null; watchedPercent: number | null; - watchedStatus: WatchStatusV | null; + // watchedStatus: WatchStatusV | null; }) => { const [moreOpened, setMoreOpened] = useState(false); const { css } = useYoshiki("episodebox"); @@ -89,27 +86,27 @@ export const EntryBox = ({ layout={{ width: percent(100), aspectRatio: 16 / 9 }} {...(css("poster") as any)} > - {(watchedPercent || watchedStatus === "completed") && ( - - )} - setMoreOpened(v)} - {...css([ - { - position: "absolute", - top: 0, - right: 0, - bg: (theme) => theme.darkOverlay, - }, - "more", - Platform.OS === "web" && - moreOpened && { display: important("flex") }, - ])} - /> + {/* {(watchedPercent || watchedStatus === "completed") && ( */} + {/* */} + {/* )} */} + {/* setMoreOpened(v)} */} + {/* {...css([ */} + {/* { */} + {/* position: "absolute", */} + {/* top: 0, */} + {/* right: 0, */} + {/* bg: (theme) => theme.darkOverlay, */} + {/* }, */} + {/* "more", */} + {/* Platform.OS === "web" && */} + {/* moreOpened && { display: important("flex") }, */} + {/* ])} */} + {/* /> */}

{name ?? t("show.episodeNoMetadata")} diff --git a/front/src/components/items/context-menus.tsx b/front/src/components/items/context-menus.tsx index b3d6875b..0d80fdd3 100644 --- a/front/src/components/items/context-menus.tsx +++ b/front/src/components/items/context-menus.tsx @@ -12,7 +12,7 @@ import { HR, IconButton, Menu, tooltip } from "~/primitives"; import { useAccount } from "~/providers/account-context"; import { useMutation } from "~/query"; import { watchListIcon } from "./watchlist-info"; -// import { useDownloader } from "../../packages/ui/src/downloadses/ui/src/downloads"; +// import { useDownloader } from "../../packages/ui/src/downloads/ui/src/downloads"; export const EntryContext = ({ slug, @@ -27,32 +27,30 @@ export const EntryContext = ({ const { t } = useTranslation(); return ( - <> -

- {serieSlug && ( - - )} - {/* downloader(type, slug)} */} - {/* /> */} + + {serieSlug && ( - - + )} + {/* downloader(type, slug)} */} + {/* /> */} + + ); }; @@ -87,60 +85,58 @@ export const ItemContext = ({ }); return ( - <> - + - - {Object.values(WatchStatusV).map((x) => ( - }`, - )} - onSelect={() => mutation.mutate(x)} - selected={x === status} - /> - ))} - {status !== null && ( - mutation.mutate(null)} - /> - )} - - {kind === "movie" && ( - <> - {/* downloader(type, slug)} */} - {/* /> */} - - + {Object.values(WatchStatusV).map((x) => ( + }`, + )} + onSelect={() => mutation.mutate(x)} + selected={x === status} + /> + ))} + {status !== null && ( + mutation.mutate(null)} + /> )} - {account?.isAdmin === true && ( - <> -
- metadataRefreshMutation.mutate()} - /> - - )} -
- + + {kind === "movie" && ( + <> + {/* downloader(type, slug)} */} + {/* /> */} + + + )} + {account?.isAdmin === true && ( + <> +
+ metadataRefreshMutation.mutate()} + /> + + )} + ); }; diff --git a/front/src/components/items/item-helpers.tsx b/front/src/components/items/item-helpers.tsx index d3c6d5d5..da2c48fe 100644 --- a/front/src/components/items/item-helpers.tsx +++ b/front/src/components/items/item-helpers.tsx @@ -1,7 +1,7 @@ import Done from "@material-symbols/svg-400/rounded/check-fill.svg"; import { View } from "react-native"; import { max, rem, useYoshiki } from "yoshiki/native"; -import { WatchStatusV } from "~/models"; +import type { WatchStatusV } from "~/models"; import { Icon, P, ts } from "~/primitives"; export const ItemWatchStatus = ({ @@ -14,8 +14,7 @@ export const ItemWatchStatus = ({ }) => { const { css } = useYoshiki(); - if (watchStatus !== WatchStatusV.Completed && !unseenEpisodesCount) - return null; + if (watchStatus !== "completed" && !unseenEpisodesCount) return null; return ( - {watchStatus === WatchStatusV.Completed ? ( + {watchStatus === "completed" ? ( ) : (

; - } & TextInputProps ->(function Input( - { placeholderTextColor, variant = "small", right, containerStyle, ...props }, +export const Input = ({ + placeholderTextColor, + variant = "small", + right, + containerStyle, ref, -) { + ...props +}: { + variant?: "small" | "big"; + right?: ReactNode; + containerStyle?: YoshikiEnhanced; + ref?: Ref; +} & TextInputProps) => { const [focused, setFocused] = useState(false); const { css, theme } = useYoshiki(); @@ -64,4 +66,4 @@ export const Input = forwardRef< {right} ); -}); +}; diff --git a/front/src/ui/player/controls/misc.tsx b/front/src/ui/player/controls/misc.tsx index e551823d..f3b18cc6 100644 --- a/front/src/ui/player/controls/misc.tsx +++ b/front/src/ui/player/controls/misc.tsx @@ -69,10 +69,11 @@ export const VolumeSlider = ({ player, ...props }: { player: VideoPlayer }) => { const { t } = useTranslation(); const [volume, setVolume] = useState(player.volume); - useEvent(player, "onVolumeChange", setVolume); - // TODO: listen to `player.muted` changes (currently hook does not exists - // const [muted, setMuted] = useState(player.muted); - const muted = player.muted; + const [muted, setMuted] = useState(player.muted); + useEvent(player, "onVolumeChange", (info) => { + setVolume(info.volume); + setMuted(info.muted); + }); return ( { if (!isTouch) { - player.toggleFullscreen(); + // player.toggleFullscreen(); return; }