Hide the "Message" button in the sidebar if the CreateRooms components should not be shown (#9271)

* Hide the "Message" button in the sidebar if the CreateRooms components should not be shown

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

* Add tests to check if the message button is correctly hidden by the customisations

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

* Use the testing-library instead of enzyme

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

* Fix type error

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

* Smaller test change, prettier

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>

---------

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>
Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
Co-authored-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
Co-authored-by: maheichyk <mikhail.aheichyk@gmail.com>
This commit is contained in:
Dominik Henneke 2024-01-26 15:54:48 +01:00 committed by GitHub
parent 38f791b79d
commit 11f45f5413
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 1 deletions

View file

@ -521,7 +521,8 @@ export const UserOptionsSection: React.FC<{
</AccessibleButton>
);
const directMessageButton = isMe ? null : <MessageButton member={member} />;
const directMessageButton =
isMe || !shouldShowComponent(UIComponent.CreateRooms) ? null : <MessageButton member={member} />;
return (
<div className="mx_UserInfo_container">