mirror of https://github.com/jitsi/jitsi-meet
parent
47be509d17
commit
0b3991d9e1
@ -1,13 +1,24 @@ |
||||
import { openDialog } from '../base/dialog'; |
||||
|
||||
import { ContextMenuReject } from './components/native/ContextMenuReject'; |
||||
import { ContextMenuLobbyParticipantReject, ContextMenuMeetingParticipantDetails } from './components/native'; |
||||
|
||||
/** |
||||
* Displays the context menu for the selected lobby participant. |
||||
* |
||||
* @param {string} participant - The selected participant's id. |
||||
* @param {Object} participant - The selected lobby participant. |
||||
* @returns {Function} |
||||
*/ |
||||
export function showContextMenuReject(participant) { |
||||
return openDialog(ContextMenuReject, { participant }); |
||||
return openDialog(ContextMenuLobbyParticipantReject, { participant }); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* Displays the context menu for the selected meeting participant. |
||||
* |
||||
* @param {Object} participant - The selected meeting participant. |
||||
* @returns {Function} |
||||
*/ |
||||
export function showContextMenuDetails(participant) { |
||||
return openDialog(ContextMenuMeetingParticipantDetails, { participant }); |
||||
} |
||||
|
@ -0,0 +1,105 @@ |
||||
// @flow
|
||||
|
||||
import React, { useCallback } from 'react'; |
||||
import { useTranslation } from 'react-i18next'; |
||||
import { TouchableOpacity, View } from 'react-native'; |
||||
import { Text } from 'react-native-paper'; |
||||
import { useDispatch } from 'react-redux'; |
||||
|
||||
import { Avatar } from '../../../base/avatar'; |
||||
import { hideDialog } from '../../../base/dialog'; |
||||
import BottomSheet from '../../../base/dialog/components/native/BottomSheet'; |
||||
import { |
||||
Icon, IconCloseCircle, IconConnectionActive, IconMessage, |
||||
IconMicrophoneEmptySlash, |
||||
IconMuteEveryoneElse, IconVideoOff |
||||
} from '../../../base/icons'; |
||||
import { MEDIA_TYPE } from '../../../base/media'; |
||||
import { muteRemote } from '../../../video-menu/actions.any'; |
||||
|
||||
import styles from './styles'; |
||||
|
||||
type Props = { |
||||
|
||||
/** |
||||
* Participant reference |
||||
*/ |
||||
participant: Object |
||||
}; |
||||
|
||||
export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props) => { |
||||
const dispatch = useDispatch(); |
||||
const cancel = useCallback(() => dispatch(hideDialog()), [ dispatch ]); |
||||
const displayName = p.name; |
||||
const muteAudio = useCallback(() => dispatch(muteRemote(p.id, MEDIA_TYPE.AUDIO)), [ dispatch ]); |
||||
const { t } = useTranslation(); |
||||
|
||||
return ( |
||||
<BottomSheet |
||||
onCancel = { cancel } |
||||
style = { styles.contextMenuMore }> |
||||
<View |
||||
style = { styles.contextMenuItemSection }> |
||||
<Avatar |
||||
className = 'participant-avatar' |
||||
participantId = { p.id } |
||||
size = { 32 } /> |
||||
<View style = { styles.contextMenuItemText }> |
||||
<Text style = { styles.contextMenuItemName }> |
||||
{ displayName } |
||||
</Text> |
||||
</View> |
||||
</View> |
||||
<TouchableOpacity |
||||
onPress = { muteAudio } |
||||
style = { styles.contextMenuItem }> |
||||
<Icon |
||||
size = { 24 } |
||||
src = { IconMicrophoneEmptySlash } |
||||
style = { styles.contextMenuItemIcon } /> |
||||
<Text style = { styles.contextMenuItemText }>{ t('participantsPane.actions.mute') }</Text> |
||||
</TouchableOpacity> |
||||
<TouchableOpacity |
||||
onPress = { muteAudio } |
||||
style = { styles.contextMenuItem }> |
||||
<Icon |
||||
size = { 24 } |
||||
src = { IconMuteEveryoneElse } |
||||
style = { styles.contextMenuItemIcon } /> |
||||
<Text style = { styles.contextMenuItemText }>{ t('participantsPane.actions.muteEveryoneElse') }</Text> |
||||
</TouchableOpacity> |
||||
<TouchableOpacity |
||||
style = { styles.contextMenuItemSection }> |
||||
<Icon |
||||
size = { 24 } |
||||
src = { IconVideoOff } |
||||
style = { styles.contextMenuItemIcon } /> |
||||
<Text style = { styles.contextMenuItemText }>{ t('participantsPane.actions.stopVideo') }</Text> |
||||
</TouchableOpacity> |
||||
<TouchableOpacity |
||||
style = { styles.contextMenuItem }> |
||||
<Icon |
||||
size = { 24 } |
||||
src = { IconCloseCircle } |
||||
style = { styles.contextMenuItemIcon } /> |
||||
<Text style = { styles.contextMenuItemText }>{ t('videothumbnail.kick') }</Text> |
||||
</TouchableOpacity> |
||||
<TouchableOpacity |
||||
style = { styles.contextMenuItem }> |
||||
<Icon |
||||
size = { 24 } |
||||
src = { IconMessage } |
||||
style = { styles.contextMenuItemIcon } /> |
||||
<Text style = { styles.contextMenuItemText }>{ t('toolbar.accessibilityLabel.privateMessage') }</Text> |
||||
</TouchableOpacity> |
||||
<TouchableOpacity |
||||
style = { styles.contextMenuItemSection }> |
||||
<Icon |
||||
size = { 24 } |
||||
src = { IconConnectionActive } |
||||
style = { styles.contextMenuItemIcon } /> |
||||
<Text style = { styles.contextMenuItemText }>{ t('participantsPane.actions.networkStats') }</Text> |
||||
</TouchableOpacity> |
||||
</BottomSheet> |
||||
); |
||||
}; |
Loading…
Reference in new issue