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

DeclineButton.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 { incomingCallDeclined } from '../actions';
  7. /**
  8. * The type of the React {@code Component} props of {@link DeclineButton}.
  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 declines/rejects an incoming call.
  18. */
  19. class DeclineButton extends AbstractButton<Props, *> {
  20. accessibilityLabel = 'incomingCall.decline';
  21. icon = IconHangup;
  22. label = 'incomingCall.decline';
  23. /**
  24. * Handles clicking / pressing the button, and declines the incoming call.
  25. *
  26. * @protected
  27. * @returns {void}
  28. */
  29. _handleClick() {
  30. this.props.dispatch(incomingCallDeclined());
  31. }
  32. }
  33. export default translate(connect()(DeclineButton));