diff --git a/src/components/ApiMenu/ApiMenu.tsx b/src/components/ApiMenu/ApiMenu.tsx index 0f7d1c8..12a3b5d 100644 --- a/src/components/ApiMenu/ApiMenu.tsx +++ b/src/components/ApiMenu/ApiMenu.tsx @@ -2,8 +2,12 @@ import React, { useEffect, useState } from 'react'; import { useTranslation, Trans } from 'react-i18next'; import useStore from '@store/store'; +import useHideOnOutsideClick from '@hooks/useHideOnOutsideClick'; + import PopupModal from '@components/PopupModal'; + import { availableEndpoints, defaultAPIEndpoint } from '@constants/auth'; + import DownChevronArrow from '@icon/DownChevronArrow'; const ApiMenu = ({ @@ -121,7 +125,7 @@ const ApiEndpointSelector = ({ _apiEndpoint: string; _setApiEndpoint: React.Dispatch>; }) => { - const [dropDown, setDropDown] = useState(false); + const [dropDown, setDropDown, dropDownRef] = useHideOnOutsideClick(); return (
@@ -135,6 +139,7 @@ const ApiEndpointSelector = ({