Skip to content

Commit

Permalink
Use modal on dropdowns for mobile only (#11993)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkeye217 committed Jun 16, 2024
1 parent f1bb797 commit 89a478c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion web/src/components/filter/CameraGroupSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ export function CameraGroupRow({

{isMobile && (
<>
<DropdownMenu modal={false}>
<DropdownMenu modal={!isDesktop}>
<DropdownMenuTrigger>
<HiOutlineDotsVertical className="size-5" />
</DropdownMenuTrigger>
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/player/VideoControls.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCallback, useMemo, useRef, useState } from "react";
import { isMobileOnly, isSafari } from "react-device-detect";
import { isDesktop, isMobileOnly, isSafari } from "react-device-detect";
import { LuPause, LuPlay } from "react-icons/lu";
import {
DropdownMenu,
Expand Down Expand Up @@ -242,7 +242,7 @@ export default function VideoControls({
)}
{features.playbackRate && (
<DropdownMenu
modal={false}
modal={!isDesktop}
onOpenChange={(open) => {
if (setControlsOpen) {
setControlsOpen(open);
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/settings/PolygonItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { LuCopy, LuPencil } from "react-icons/lu";
import { FaDrawPolygon, FaObjectGroup } from "react-icons/fa";
import { BsPersonBoundingBox } from "react-icons/bs";
import { HiOutlineDotsVertical, HiTrash } from "react-icons/hi";
import { isMobile } from "react-device-detect";
import { isDesktop, isMobile } from "react-device-detect";
import {
flattenPoints,
parseCoordinates,
Expand Down Expand Up @@ -266,7 +266,7 @@ export default function PolygonItem({

{isMobile && (
<>
<DropdownMenu modal={false}>
<DropdownMenu modal={!isDesktop}>
<DropdownMenuTrigger>
<HiOutlineDotsVertical className="size-5" />
</DropdownMenuTrigger>
Expand Down
2 changes: 1 addition & 1 deletion web/src/views/live/LiveCameraView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ function PtzControlPanel({
</>
)}
{(ptz?.presets?.length ?? 0) > 0 && (
<DropdownMenu modal={false}>
<DropdownMenu modal={!isDesktop}>
<DropdownMenuTrigger asChild>
<Button>
<BsThreeDotsVertical />
Expand Down

0 comments on commit 89a478c

Please sign in to comment.