mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-13 22:52:30 +00:00
* feat: Initial UI part for A/V moderation. Based on https://github.com/jitsi/jitsi-meet/pull/7779 Co-authored-by: Gabriel Imre <gabriel.lucaci@8x8.com> * feat: Hides context menu in p2p or only moderators in the meeting. * feat: Show notifications on enable/disable. * feat(moderation): Add buttons to participant list & notifications * fix(moderation): Fix raised hand participant leaving * feat(moderation): Add support for video moderation * feat(moderation): Add mute all video to context menu * feat(moderation): Redo participants list 'More menu' * fix: Fixes clearing av_moderation table. * fix: Start moderation context menu * fix(moderation): Show notification if unapproved participant tries to start CS Co-authored-by: Gabriel Imre <gabriel.lucaci@8x8.com> Co-authored-by: Vlad Piersec <vlad.piersec@8x8.com>
83 lines
2.6 KiB
JavaScript
83 lines
2.6 KiB
JavaScript
// @flow
|
|
|
|
import React from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
import { Avatar } from '../../../base/avatar';
|
|
import { HIDDEN_EMAILS } from '../../../lobby/constants';
|
|
|
|
import NotificationButton from './NotificationButton';
|
|
|
|
type Props = {
|
|
|
|
/**
|
|
* Callback used when clicking the ok/approve button.
|
|
*/
|
|
onApprove: Function,
|
|
|
|
/**
|
|
* Callback used when clicking the reject button.
|
|
*/
|
|
onReject: Function,
|
|
|
|
/**
|
|
* Array of participants to be displayed.
|
|
*/
|
|
participants: Array<Object>,
|
|
|
|
/**
|
|
* String prefix used for button `test-id`.
|
|
*/
|
|
testIdPrefix: string
|
|
}
|
|
|
|
/**
|
|
* Component used to display a list of notifications based on a list of participants.
|
|
* This is visible only to moderators.
|
|
*
|
|
* @returns {React$Element<'div'> | null}
|
|
*/
|
|
export default function({ onApprove, onReject, participants, testIdPrefix }: Props): React$Element<'ul'> {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<ul className = 'knocking-participants-container'>
|
|
{ participants.map(p => (
|
|
<li
|
|
className = 'knocking-participant'
|
|
key = { p.id }>
|
|
<Avatar
|
|
displayName = { p.name }
|
|
size = { 48 }
|
|
testId = { `${testIdPrefix}.avatar` }
|
|
url = { p.loadableAvatarUrl } />
|
|
|
|
<div className = 'details'>
|
|
<span data-testid = { `${testIdPrefix}.name` }>
|
|
{ p.name }
|
|
</span>
|
|
{ p.email && !HIDDEN_EMAILS.includes(p.email) && (
|
|
<span data-testid = { `${testIdPrefix}.email` }>
|
|
{ p.email }
|
|
</span>
|
|
) }
|
|
</div>
|
|
<NotificationButton
|
|
action = { onApprove }
|
|
className = 'primary'
|
|
participant = { p }
|
|
testId = { `${testIdPrefix}.allow` }>
|
|
{ t('lobby.allow') }
|
|
</NotificationButton>
|
|
<NotificationButton
|
|
action = { onReject }
|
|
className = 'borderLess'
|
|
participant = { p }
|
|
testId = { `${testIdPrefix}.reject` }>
|
|
{ t('lobby.reject') }
|
|
</NotificationButton>
|
|
</li>
|
|
)) }
|
|
</ul>);
|
|
}
|