Skip to content
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Add remove participant menu item for participant item if role allows.",
"packageName": "@internal/react-components",
"email": "miguelgamis@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -200,20 +200,17 @@ export const ParticipantList = (props: ParticipantListProps): JSX.Element => {
const createParticipantMenuItems = useCallback(
(participant: ParticipantListParticipant): IContextualMenuItem[] => {
let menuItems: IContextualMenuItem[] = [];
let disabled = !participant.isRemovable;
let participantIsRemovable = participant.isRemovable;
/* @conditional-compile-remove(rooms) */
const isRemovable = _usePermissions().removeParticipantButton;
/* @conditional-compile-remove(rooms) */
disabled = !isRemovable || disabled;
if (participant.userId !== myUserId && onRemoveParticipant) {
participantIsRemovable = _usePermissions().removeParticipantButton && participantIsRemovable;
if (participant.userId !== myUserId && onRemoveParticipant && participantIsRemovable) {
menuItems.push({
key: 'remove',
text: strings.removeButtonLabel,
onClick: () => onRemoveParticipant(participant.userId),
itemProps: {
styles: props.styles?.participantItemStyles?.participantSubMenuItemsStyles
},
disabled: disabled,
'data-ui-id': ids.participantListRemoveParticipantButton
});
}
Expand Down