您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

AnswerButton.js 1007B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // @flow
  2. import { translate } from '../../../base/i18n';
  3. import { connect } from '../../../base/redux';
  4. import { AbstractButton } from '../../../base/toolbox';
  5. import type { AbstractButtonProps } from '../../../base/toolbox';
  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. iconName = 'hangup';
  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));