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.

DeclineButton.js 1014B

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 { 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. iconName = 'hangup';
  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));