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.

AnswerButton.js 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // @flow
  2. import { translate } from '../../../base/i18n';
  3. import { IconHangup } from '../../../base/icons';
  4. import { connect } from '../../../base/redux';
  5. import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
  6. import { incomingCallAnswered } from '../actions';
  7. /**
  8. * The type of the React {@code Component} props of {@link AnswerButton}.
  9. */
  10. type Props = AbstractButtonProps & {
  11. /**
  12. * The redux {@code dispatch} function.
  13. */
  14. dispatch: Function
  15. };
  16. /**
  17. * An implementation of a button which accepts/answers an incoming call.
  18. */
  19. class AnswerButton extends AbstractButton<Props, *> {
  20. accessibilityLabel = 'incomingCall.answer';
  21. icon = IconHangup;
  22. label = 'incomingCall.answer';
  23. /**
  24. * Handles clicking / pressing the button, and answers the incoming call.
  25. *
  26. * @protected
  27. * @returns {void}
  28. */
  29. _handleClick() {
  30. this.props.dispatch(incomingCallAnswered());
  31. }
  32. }
  33. export default translate(connect()(AnswerButton));