mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-18 00:54:27 +03:00
context menu on container ref
This commit is contained in:
parent
19abcb9e2f
commit
cd82e220b1
@ -1,4 +1,4 @@
|
||||
import { useMemo } from "react";
|
||||
import { useMemo, useRef } from "react";
|
||||
import { useApiHost } from "@/api";
|
||||
import { getIconForLabel } from "@/utils/iconUtil";
|
||||
import useSWR from "swr";
|
||||
@ -27,10 +27,11 @@ export default function SearchThumbnail({
|
||||
const apiHost = useApiHost();
|
||||
const { data: config } = useSWR<FrigateConfig>("config");
|
||||
const [imgRef, imgLoaded, onImgLoad] = useImageLoaded();
|
||||
const containerRef = useRef<HTMLDivElement | null>(null);
|
||||
|
||||
// interactions
|
||||
|
||||
useContextMenu(imgRef, () => {
|
||||
useContextMenu(containerRef, () => {
|
||||
onClick(searchResult, true, false);
|
||||
});
|
||||
|
||||
@ -53,6 +54,7 @@ export default function SearchThumbnail({
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={containerRef}
|
||||
className="relative size-full cursor-pointer"
|
||||
{...bindClickAndLongPress}
|
||||
>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user