From 9b85e66608de656b93da2d2e9035740b689eb5ad Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 9 Dec 2025 14:41:56 -0600 Subject: [PATCH] only allow admins to save annotation offset --- .../overlay/detail/AnnotationOffsetSlider.tsx | 14 +++++--- .../overlay/detail/AnnotationSettingsPane.tsx | 36 ++++++++++--------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/web/src/components/overlay/detail/AnnotationOffsetSlider.tsx b/web/src/components/overlay/detail/AnnotationOffsetSlider.tsx index 9f4851d42..fbc587413 100644 --- a/web/src/components/overlay/detail/AnnotationOffsetSlider.tsx +++ b/web/src/components/overlay/detail/AnnotationOffsetSlider.tsx @@ -10,6 +10,7 @@ import { Trans, useTranslation } from "react-i18next"; import { LuInfo } from "react-icons/lu"; import { cn } from "@/lib/utils"; import { isMobile } from "react-device-detect"; +import { useIsAdmin } from "@/hooks/use-is-admin"; type Props = { className?: string; @@ -17,6 +18,7 @@ type Props = { export default function AnnotationOffsetSlider({ className }: Props) { const { annotationOffset, setAnnotationOffset, camera } = useDetailStream(); + const isAdmin = useIsAdmin(); const { mutate } = useSWRConfig(); const { t } = useTranslation(["views/explore"]); const [isSaving, setIsSaving] = useState(false); @@ -101,11 +103,13 @@ export default function AnnotationOffsetSlider({ className }: Props) { - + {isAdmin && ( + + )}
{t("button.apply", { ns: "common" })} - + {isAdmin && ( + + )}