From bb63efefe808f6a8009f0935eca9de4637d63e3e Mon Sep 17 00:00:00 2001 From: Sergey Kintsel Date: Tue, 12 Sep 2023 11:14:55 +0100 Subject: [PATCH] Disable scrolling when drawer open, but modal isn't If you open the drawer it should block scrolling of the elements behind it, but once the dynamic modal opens it should stop doing it, otherwise it'll block the modal's scrolling too --- src/views/home/AccountListWithDrawer.tsx | 4 +++- src/views/nfts/NftsView.tsx | 4 +++- src/views/settings/BeaconDrawerCard.tsx | 5 +++-- src/views/settings/ErrorLogsDrawerCard.tsx | 4 +++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/views/home/AccountListWithDrawer.tsx b/src/views/home/AccountListWithDrawer.tsx index 31ad03c877..2916788ac6 100644 --- a/src/views/home/AccountListWithDrawer.tsx +++ b/src/views/home/AccountListWithDrawer.tsx @@ -5,12 +5,14 @@ import AccountCard from "../../components/AccountDrawer"; import { useAllAccounts } from "../../utils/hooks/accountHooks"; import { AccountsList } from "./AccountsList"; import { DrawerTopButtons } from "./DrawerTopButtons"; +import { useDynamicModal } from "../../components/DynamicModal"; const AccountListWithDrawer: React.FC = () => { const [selected, setSelected] = useState(null); const allAccounts = useAllAccounts(); const { isOpen, onClose: closeDrawer, onOpen } = useDisclosure(); + const { isOpen: isDynamicModalOpen } = useDynamicModal(); const handleClose = () => { setSelected(null); @@ -28,7 +30,7 @@ const AccountListWithDrawer: React.FC = () => { }} /> { const nfts = useAllNfts(); const { accountsFilter, selectedAccounts } = useAccountsFilter(); const navigate = useNavigate(); const { ownerPkh, nftId } = useParams(); + const { isOpen: isDynamicModalOpen } = useDynamicModal(); const openNFTsPage = useCallback(() => { navigate(`/nfts`); @@ -58,7 +60,7 @@ const NFTsViewBase = () => { { const { isOpen, onClose: closeDrawer, onOpen } = useDisclosure(); - + const { isOpen: isDynamicModalOpen } = useDynamicModal(); return ( <> { const { isOpen, onClose: closeDrawer, onOpen } = useDisclosure(); + const { isOpen: isDynamicModalOpen } = useDynamicModal(); const handleClose = () => { closeDrawer(); @@ -30,7 +32,7 @@ const ErrorLogsDrawerCard = () => { <>