From f9edab8f3636945896ee084215ec0bddf1ab27ce Mon Sep 17 00:00:00 2001 From: Loewy Date: Mon, 19 Feb 2024 14:01:44 -0800 Subject: [PATCH] rename isOpen to isDropdownOpen --- src/component/video/use-video-details.tsx | 16 ++++++++-------- src/screens/video-stack/video-details.tsx | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/component/video/use-video-details.tsx b/src/component/video/use-video-details.tsx index 855c035..df09bf7 100644 --- a/src/component/video/use-video-details.tsx +++ b/src/component/video/use-video-details.tsx @@ -32,25 +32,25 @@ function useDropdown( options: Array<{ label: string; value: T }>, closeOthers: () => void, ) { - const [isOpen, setIsOpen] = useState(false); + const [isDropdownOpen, setIsDropdownOpen] = useState(false); const [value, setValue] = useState(initialValue); const [optionsList, setOptionsList] = useState(options); const toggleOpen = useCallback(() => { - if (!isOpen) { + if (!isDropdownOpen) { closeOthers(); } - setIsOpen(!isOpen); - }, [isOpen, closeOthers]); + setIsDropdownOpen(!isDropdownOpen); + }, [isDropdownOpen, closeOthers]); return { - isOpen, + isDropdownOpen, toggleOpen, value, setValue, optionsList, setOptionsList, - setIsOpen, + setIsDropdownOpen, }; } @@ -76,8 +76,8 @@ export const useVideoDetails = ({ ); const closeAllDropdowns = useCallback(() => { - gameType.setIsOpen(false); - tableSize.setIsOpen(false); + gameType.setIsDropdownOpen(false); + tableSize.setIsDropdownOpen(false); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); diff --git a/src/screens/video-stack/video-details.tsx b/src/screens/video-stack/video-details.tsx index 39fcbe5..324bb2c 100644 --- a/src/screens/video-stack/video-details.tsx +++ b/src/screens/video-stack/video-details.tsx @@ -47,7 +47,7 @@ export default function VideoDetails({ navigation, route }): React.JSX.Element {