From c9f7baec490a11305bfa980f5cdabf1afadf6965 Mon Sep 17 00:00:00 2001 From: mheggelund Date: Thu, 25 Jan 2024 11:56:56 +0100 Subject: [PATCH] fix: Rename state, set dismissable on outside click. --- src/features/ModelTable/ModelTable.tsx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/features/ModelTable/ModelTable.tsx b/src/features/ModelTable/ModelTable.tsx index 64e1a32d..4387cf1f 100644 --- a/src/features/ModelTable/ModelTable.tsx +++ b/src/features/ModelTable/ModelTable.tsx @@ -29,7 +29,7 @@ export const ModelTable = ({ if (token) OpenAPI.TOKEN = token; const navigate = useNavigate(); - const [toggle, setToggle] = useState(false); + const [open, setOpen] = useState(false); const [activeModel, setActiveModel] = useState(); const { isLoading, data } = useQuery({ queryKey: ['analogue-models'], @@ -192,7 +192,7 @@ export const ModelTable = ({ disabled={isActiveModel(row.original.analogueModelId)} onClick={() => { setActiveModel(row.original.analogueModelId); - setToggle(!toggle); + setOpen(!open); }} > Set Areas @@ -202,13 +202,11 @@ export const ModelTable = ({ }, ]} /> - {activeModel && ( - - setToggle(!toggle)}> - - - - )} + + setOpen(!open)}> + {activeModel && } + + ); };