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

DeclineButton.js 1.0KB

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