From ccce801dc44edfbed7c0053f3416f642b382e852 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Sun, 6 Mar 2022 21:57:40 -0800 Subject: [PATCH] Add missing TGO click handlers. Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2056 --- client/src/components/tgos/Tgo.tsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/client/src/components/tgos/Tgo.tsx b/client/src/components/tgos/Tgo.tsx index c9ce13fa..0aac5800 100644 --- a/client/src/components/tgos/Tgo.tsx +++ b/client/src/components/tgos/Tgo.tsx @@ -1,3 +1,7 @@ +import { + useOpenNewTgoPackageDialogMutation, + useOpenTgoInfoDialogMutation, +} from "../../api/liberationApi"; import { Tgo as TgoModel } from "../../api/tgo"; import SplitLines from "../splitlines/SplitLines"; import { Icon, Point } from "leaflet"; @@ -20,8 +24,21 @@ interface TgoProps { } export default function Tgo(props: TgoProps) { + const [openNewPackageDialog] = useOpenNewTgoPackageDialogMutation(); + const [openInfoDialog] = useOpenTgoInfoDialogMutation(); return ( - + { + openInfoDialog({ tgoId: props.tgo.id }); + }, + contextmenu: () => { + openNewPackageDialog({ tgoId: props.tgo.id }); + }, + }} + > {`${props.tgo.name} (${props.tgo.control_point_name})`}