2018-07-15 14:50:38 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import { translate } from '../../../base/i18n';
|
2019-08-30 16:39:06 +00:00
|
|
|
import { IconHangup } from '../../../base/icons';
|
2019-03-21 16:38:29 +00:00
|
|
|
import { connect } from '../../../base/redux';
|
2018-07-16 16:36:32 +00:00
|
|
|
import { AbstractButton } from '../../../base/toolbox';
|
2018-07-15 14:50:38 +00:00
|
|
|
import type { AbstractButtonProps } from '../../../base/toolbox';
|
|
|
|
import { incomingCallDeclined } from '../actions';
|
|
|
|
|
2018-07-16 16:36:32 +00:00
|
|
|
/**
|
|
|
|
* The type of the React {@code Component} props of {@link DeclineButton}.
|
|
|
|
*/
|
2018-07-15 14:50:38 +00:00
|
|
|
type Props = AbstractButtonProps & {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The redux {@code dispatch} function.
|
|
|
|
*/
|
|
|
|
dispatch: Function
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2018-07-16 16:36:32 +00:00
|
|
|
* An implementation of a button which declines/rejects an incoming call.
|
2018-07-15 14:50:38 +00:00
|
|
|
*/
|
|
|
|
class DeclineButton extends AbstractButton<Props, *> {
|
|
|
|
accessibilityLabel = 'incomingCall.decline';
|
2019-08-30 16:39:06 +00:00
|
|
|
icon = IconHangup;
|
2018-07-15 14:50:38 +00:00
|
|
|
label = 'incomingCall.decline';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles clicking / pressing the button, and declines the incoming call.
|
|
|
|
*
|
|
|
|
* @protected
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_handleClick() {
|
|
|
|
this.props.dispatch(incomingCallDeclined());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default translate(connect()(DeclineButton));
|