mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-08 20:25:26 +03:00
Just use multiselect for mobile
This commit is contained in:
parent
a49e1bbc64
commit
54877a5598
@ -13,7 +13,7 @@ import { getIconForLabel, getIconForSubLabel } from "@/utils/iconUtil";
|
||||
import TimeAgo from "../dynamic/TimeAgo";
|
||||
import useSWR from "swr";
|
||||
import { FrigateConfig } from "@/types/frigateConfig";
|
||||
import { isFirefox, isMobile, isSafari } from "react-device-detect";
|
||||
import { isDesktop, isFirefox, isMobile, isSafari } from "react-device-detect";
|
||||
import Chip from "../Chip";
|
||||
import {
|
||||
ContextMenu,
|
||||
@ -166,13 +166,19 @@ export default function PreviewThumbnailPlayer({
|
||||
config?.ui.time_format == "24hour" ? "%b %-d, %H:%M" : "%b %-d, %I:%M %p",
|
||||
);
|
||||
|
||||
return (
|
||||
<ContextMenu>
|
||||
<ContextMenuTrigger asChild>
|
||||
const previewContent = (
|
||||
<div
|
||||
className="relative size-full cursor-pointer"
|
||||
onMouseEnter={isMobile ? undefined : () => onPlayback(true)}
|
||||
onMouseLeave={isMobile ? undefined : () => onPlayback(false)}
|
||||
onContextMenu={
|
||||
isDesktop
|
||||
? undefined
|
||||
: (e) => {
|
||||
e.preventDefault();
|
||||
onClick(review.id, true);
|
||||
}
|
||||
}
|
||||
onClick={handleOnClick}
|
||||
{...swipeHandlers}
|
||||
>
|
||||
@ -195,10 +201,7 @@ export default function PreviewThumbnailPlayer({
|
||||
className={`w-full h-full transition-opacity ${
|
||||
playingBack ? "opacity-0" : "opacity-100"
|
||||
}`}
|
||||
src={`${apiHost}${review.thumb_path.replace(
|
||||
"/media/frigate/",
|
||||
"",
|
||||
)}`}
|
||||
src={`${apiHost}${review.thumb_path.replace("/media/frigate/", "")}`}
|
||||
loading={isSafari ? "eager" : "lazy"}
|
||||
onLoad={() => {
|
||||
onImgLoad();
|
||||
@ -238,7 +241,12 @@ export default function PreviewThumbnailPlayer({
|
||||
<div className="absolute inset-0 z-10 bg-black bg-opacity-60" />
|
||||
)}
|
||||
</div>
|
||||
</ContextMenuTrigger>
|
||||
);
|
||||
|
||||
if (isDesktop) {
|
||||
return (
|
||||
<ContextMenu>
|
||||
<ContextMenuTrigger asChild>{previewContent}</ContextMenuTrigger>
|
||||
<PreviewContextItems
|
||||
review={review}
|
||||
onSelect={() => onClick(review.id, true)}
|
||||
@ -249,6 +257,9 @@ export default function PreviewThumbnailPlayer({
|
||||
);
|
||||
}
|
||||
|
||||
return previewContent;
|
||||
}
|
||||
|
||||
type PreviewContentProps = {
|
||||
review: ReviewSegment;
|
||||
relevantPreview: Preview | undefined;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user