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.9KB

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