2018-07-15 14:50:38 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
|
|
|
import { translate } from '../../../base/i18n';
|
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';
|
|
|
|
iconName = 'hangup';
|
|
|
|
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));
|