Fix weird menus click via a weird hack

This commit is contained in:
Zoe Roux 2023-12-14 14:55:31 +01:00
parent 10924e2410
commit c67a11b8b6
4 changed files with 8 additions and 8 deletions

View File

@ -32,7 +32,7 @@ export const EpisodesContext = ({
slug,
status,
...props
}: { showSlug?: string; slug: string; status: WatchStatusV | null } & Partial<
}: { showSlug?: string | null; slug: string; status: WatchStatusV | null } & Partial<
ComponentProps<typeof Menu<typeof IconButton>>
>) => {
const account = useAccount();
@ -50,11 +50,6 @@ export const EpisodesContext = ({
return (
<Menu Trigger={IconButton} icon={MoreVert} {...tooltip(t("misc.more"))} {...(props as any)}>
<Menu.Item
label={t("home.episodeMore.goToShow")}
icon={Info}
onSelect={() => console.log("tot")}
/>
{showSlug && (
<Menu.Item label={t("home.episodeMore.goToShow")} icon={Info} href={`/show/${showSlug}`} />
)}

View File

@ -158,11 +158,13 @@ export const EpisodeLine = ({
runtime,
watchedPercent,
watchedStatus,
href,
...props
}: WithLoading<{
id: string;
slug: string;
showSlug: string;
// if show slug is null, disable "Go to show" in the context menu
showSlug: string | null;
displayNumber: string;
name: string | null;
overview: string | null;
@ -174,6 +176,7 @@ export const EpisodeLine = ({
runtime: number | null;
watchedPercent: number | null;
watchedStatus: WatchStatusV | null;
href: string;
}> &
Partial<PressableProps>) => {
const [moreOpened, setMoreOpened] = useState(false);
@ -182,7 +185,7 @@ export const EpisodeLine = ({
return (
<Link
href={slug ? `/watch/${slug}` : ""}
href={moreOpened ? undefined : href}
onLongPress={() => setMoreOpened(true)}
{...css(
{

View File

@ -147,6 +147,7 @@ export const EpisodeList = <Props,>({
)}
<EpisodeLine
{...item}
showSlug={null}
displayNumber={item.isLoading ? undefined! : episodeDisplayNumber(item)!}
watchedPercent={item.watchStatus?.watchedPercent ?? null}
watchedStatus={item.watchStatus?.status ?? null}

View File

@ -75,6 +75,7 @@ export const ShowWatchStatusCard = ({ watchedPercent, status, nextEpisode }: Sho
<EpisodeLine
isLoading={false}
{...nextEpisode}
showSlug={null}
watchedPercent={watchedPercent || null}
watchedStatus={status || null}
displayNumber={episodeDisplayNumber(nextEpisode, "???")!}