You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ParticipantsPane.js 2.3KB

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