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 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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));