use useEffect to close menu whenever the space panel collapsed state changes
use useEffect to close menu whenever the space panel collapsed state changes

matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk