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 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. // @flow
  2. import React, { useCallback } from 'react';
  3. import { useTranslation } from 'react-i18next';
  4. import { View } from 'react-native';
  5. import { withTheme } from 'react-native-paper';
  6. import { useDispatch, useSelector } from 'react-redux';
  7. import { IconClose, IconHorizontalPoints } from '../../../base/icons';
  8. import { JitsiModal } from '../../../base/modal';
  9. import { isLocalParticipantModerator } from '../../../base/participants';
  10. import { close } from '../../actions';
  11. import Button from './Button';
  12. import { LobbyParticipantList } from './LobbyParticipantList';
  13. import styles from './styles';
  14. /**
  15. * {@code ParticipantsPane}'s React {@code Component} prop types.
  16. */
  17. type Props = {
  18. /**
  19. * Theme used for styles.
  20. */
  21. theme: Object
  22. }
  23. /**
  24. * Participant pane.
  25. *
  26. * @returns {React$Element<any>}
  27. */
  28. function ParticipantsPane({ theme }: Props) {
  29. const dispatch = useDispatch();
  30. const closePane = useCallback(
  31. () => dispatch(close()),
  32. [ dispatch ]);
  33. const isLocalModerator = useSelector(isLocalParticipantModerator);
  34. const { t } = useTranslation();
  35. const { palette } = theme;
  36. return (
  37. <JitsiModal
  38. showHeaderWithNavigation = { false }
  39. style = { styles.participantsPane }>
  40. <View style = { styles.header }>
  41. <Button
  42. contentStyle = { styles.muteAllContent }
  43. iconButton = { true }
  44. iconSize = { 16 }
  45. iconSrc = { IconClose }
  46. iconStyle = { styles.closeIcon }
  47. mode = 'contained'
  48. onPress = { closePane }
  49. style = { styles.closeButton }
  50. theme = {{
  51. colors: {
  52. primary: palette.action02
  53. }
  54. }} />
  55. </View>
  56. <LobbyParticipantList />
  57. {
  58. isLocalModerator
  59. && <View style = { styles.footer }>
  60. <Button
  61. content = { t('participantsPane.actions.muteAll') }
  62. contentStyle = { styles.muteAllContent }
  63. onPress = { closePane }
  64. style = { styles.muteAllButton } />
  65. <Button
  66. contentStyle = { styles.muteAllContent }
  67. iconButton = { true }
  68. iconSize = { 16 }
  69. iconSrc = { IconHorizontalPoints }
  70. iconStyle = { styles.moreIcon }
  71. mode = 'contained'
  72. onPress = { closePane }
  73. style = { styles.moreButton }
  74. theme = {{
  75. colors: {
  76. primary: palette.action02
  77. }
  78. }} />
  79. </View>
  80. }
  81. </JitsiModal>
  82. );
  83. }
  84. export default withTheme(ParticipantsPane);