diff --git a/src/app/organisms/profile-viewer/ProfileViewer.jsx b/src/app/organisms/profile-viewer/ProfileViewer.jsx index e6b3a83..6eb370d 100644 --- a/src/app/organisms/profile-viewer/ProfileViewer.jsx +++ b/src/app/organisms/profile-viewer/ProfileViewer.jsx @@ -44,6 +44,11 @@ function ModerationTools({ && room.currentState.hasSufficientPowerLevelFor('kick', myPowerLevel) && powerLevel < myPowerLevel ); + const canIBan = ( + ['join', 'leave'].includes(roomMember?.membership) + && room.currentState.hasSufficientPowerLevelFor('ban', myPowerLevel) + && powerLevel < myPowerLevel + ); const handleKick = (e) => { e.preventDefault(); @@ -51,15 +56,25 @@ function ModerationTools({ roomActions.kick(roomId, userId, kickReason !== '' ? kickReason : undefined); }; + const handleBan = (e) => { + e.preventDefault(); + const banReason = e.target.elements['ban-reason']?.value.trim(); + roomActions.ban(roomId, userId, banReason !== '' ? banReason : undefined); + }; + return (