Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

KnockingParticipantList.js 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // @flow
  2. import React from 'react';
  3. import { translate } from '../../../base/i18n';
  4. import { connect } from '../../../base/redux';
  5. import NotificationWithParticipants from '../../../notifications/components/web/NotificationWithParticipants';
  6. import { approveKnockingParticipant, rejectKnockingParticipant } from '../../actions';
  7. import AbstractKnockingParticipantList, {
  8. mapStateToProps as abstractMapStateToProps,
  9. type Props as AbstractProps
  10. } from '../AbstractKnockingParticipantList';
  11. type Props = AbstractProps & {
  12. /**
  13. * True if the toolbox is visible, so we need to adjust the position.
  14. */
  15. _toolboxVisible: boolean
  16. };
  17. /**
  18. * Component to render a list for the actively knocking participants.
  19. */
  20. class KnockingParticipantList extends AbstractKnockingParticipantList<Props> {
  21. /**
  22. * Implements {@code PureComponent#render}.
  23. *
  24. * @inheritdoc
  25. */
  26. render() {
  27. const { _participants, _visible, t } = this.props;
  28. if (!_visible) {
  29. return null;
  30. }
  31. return (
  32. <div id = 'knocking-participant-list'>
  33. <div className = 'title'>
  34. { t('lobby.knockingParticipantList') }
  35. </div>
  36. <NotificationWithParticipants
  37. approveButtonText = { t('lobby.allow') }
  38. onApprove = { approveKnockingParticipant }
  39. onReject = { rejectKnockingParticipant }
  40. participants = { _participants }
  41. rejectButtonText = { t('lobby.reject') }
  42. testIdPrefix = 'lobby' />
  43. </div>
  44. );
  45. }
  46. _onRespondToParticipant: (string, boolean) => Function;
  47. }
  48. export default translate(connect(abstractMapStateToProps)(KnockingParticipantList));