From b2a42406df7a7514050a8fe4a40bb12a1069bdcc Mon Sep 17 00:00:00 2001 From: Yusong Hsu Date: Sun, 8 Dec 2024 13:56:17 +0800 Subject: [PATCH 1/2] feat: disable dropdown if sections empty --- src/components/BottomActions/Dropdown/index.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/BottomActions/Dropdown/index.jsx b/src/components/BottomActions/Dropdown/index.jsx index 4a8ea3d..6c9121c 100644 --- a/src/components/BottomActions/Dropdown/index.jsx +++ b/src/components/BottomActions/Dropdown/index.jsx @@ -1,5 +1,5 @@ import { useClickOutside, useToggle } from '@react-hooks-library/core' -import { map } from 'lodash-es' +import { map, isEmpty } from 'lodash-es' import { useRef } from 'react' import { FaList } from 'react-icons/fa6' import { MdTitle } from 'react-icons/md' @@ -27,6 +27,7 @@ const Dropdown = (props) => { onClick={toggle} className={` dropdown dropdown-top ${isSectionVisible ? 'dropdown-open' : ''} + ${isEmpty(sections) ? 'disabled pointer-events-none' : ''} `} > From 93f7004a808c21c443b09bfa3d6c341971e4f5ab Mon Sep 17 00:00:00 2001 From: sky172839465 <9082423+sky172839465@users.noreply.github.com> Date: Sun, 8 Dec 2024 05:56:47 +0000 Subject: [PATCH 2/2] chore: fix code style issues with linters --- src/components/BottomActions/Dropdown/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BottomActions/Dropdown/index.jsx b/src/components/BottomActions/Dropdown/index.jsx index 6c9121c..1a401ab 100644 --- a/src/components/BottomActions/Dropdown/index.jsx +++ b/src/components/BottomActions/Dropdown/index.jsx @@ -1,5 +1,5 @@ import { useClickOutside, useToggle } from '@react-hooks-library/core' -import { map, isEmpty } from 'lodash-es' +import { isEmpty,map } from 'lodash-es' import { useRef } from 'react' import { FaList } from 'react-icons/fa6' import { MdTitle } from 'react-icons/md'