diff --git a/src/components/dapp/TransactionButton.tsx b/src/components/dapp/TransactionButton.tsx index 8699f1982..531d8acfd 100644 --- a/src/components/dapp/TransactionButton.tsx +++ b/src/components/dapp/TransactionButton.tsx @@ -16,8 +16,6 @@ export default function TransactionButton({ tx, name, children, onExecute, ...pr const { address: user, client, sendTransaction } = useWalletContext(); const execute = useCallback(async () => { - console.log("CLIENT", client); - if (!tx || !user || !client) return; const hash = await sendTransaction?.([ diff --git a/src/components/extenders/Dropdown.tsx b/src/components/extenders/Dropdown.tsx index ee6f008cd..094f59ae5 100644 --- a/src/components/extenders/Dropdown.tsx +++ b/src/components/extenders/Dropdown.tsx @@ -34,8 +34,9 @@ export default function Dropdown({ if (!internalState || !onHover) return; hideTimeout.current = setTimeout(() => { setInternalState(false); + state?.[1]?.(false); }, 100); - }, [internalState, onHover]); + }, [internalState, onHover, state]); const handleMouseEnter = useCallback(() => { if (!onHover) return; @@ -44,7 +45,8 @@ export default function Dropdown({ hideTimeout.current = null; } setInternalState(true); - }, [onHover]); + state?.[1]?.(true); + }, [onHover, state]); const cancelClose = useCallback(() => { if (!onHover || !hideTimeout.current) return; @@ -57,11 +59,20 @@ export default function Dropdown({ clearTimeout(hideTimeout.current); }, [onHover]); + const toggle = useCallback( + () => + blockEvent(() => { + setInternalState(!internalState); + state?.[1]?.(!state?.[0]); + }), + [internalState, state], + ); + return ( setInternalState(r => !r))} + onClick={toggle} onMouseEnter={handleMouseEnter} onMouseLeave={closeModalWithDelay}> {children}