Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

ParticipantsPane.js 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // @flow
  2. import React, { useCallback } from 'react';
  3. import { useTranslation } from 'react-i18next';
  4. import { View } from 'react-native';
  5. import { Button } from 'react-native-paper';
  6. import { useDispatch, useSelector } from 'react-redux';
  7. import { openDialog } from '../../../base/dialog';
  8. import { JitsiModal } from '../../../base/modal';
  9. import {
  10. isLocalParticipantModerator
  11. } from '../../../base/participants';
  12. import MuteEveryoneDialog
  13. from '../../../video-menu/components/native/MuteEveryoneDialog';
  14. import { close } from '../../actions.native';
  15. import { ContextMenuMore } from './ContextMenuMore';
  16. import HorizontalDotsIcon from './HorizontalDotsIcon';
  17. import LobbyParticipantList from './LobbyParticipantList';
  18. import MeetingParticipantList from './MeetingParticipantList';
  19. import styles from './styles';
  20. /**
  21. * Participant pane.
  22. *
  23. * @returns {React$Element<any>}
  24. */
  25. const ParticipantsPane = () => {
  26. const dispatch = useDispatch();
  27. const openMoreMenu = useCallback(() => dispatch(openDialog(ContextMenuMore)), [ dispatch ]);
  28. const closePane = useCallback(() => dispatch(close()), [ dispatch ]);
  29. const isLocalModerator = useSelector(isLocalParticipantModerator);
  30. const muteAll = useCallback(() => dispatch(openDialog(MuteEveryoneDialog)),
  31. [ dispatch ]);
  32. const { t } = useTranslation();
  33. return (
  34. <JitsiModal
  35. headerProps = {{
  36. headerLabelKey: 'participantsPane.header'
  37. }}
  38. onClose = { closePane }
  39. style = { styles.participantsPane }>
  40. <LobbyParticipantList />
  41. <MeetingParticipantList />
  42. {
  43. isLocalModerator
  44. && <View style = { styles.footer }>
  45. <Button
  46. children = { t('participantsPane.actions.muteAll') }
  47. labelStyle = { styles.muteAllLabel }
  48. mode = 'contained'
  49. onPress = { muteAll }
  50. style = { styles.muteAllMoreButton } />
  51. <Button
  52. icon = { HorizontalDotsIcon }
  53. labelStyle = { styles.moreIcon }
  54. mode = 'contained'
  55. onPress = { openMoreMenu }
  56. style = { styles.moreButton } />
  57. </View>
  58. }
  59. </JitsiModal>
  60. );
  61. };
  62. export default ParticipantsPane;