jiti-meet/react/features/mobile/incoming-call/components/AnswerButton.js

41 lines
1.0 KiB
JavaScript
Raw Normal View History

// @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';
import { AbstractButton } from '../../../base/toolbox';
import type { AbstractButtonProps } from '../../../base/toolbox';
import { incomingCallAnswered } from '../actions';
/**
* The type of the React {@code Component} props of {@link AnswerButton}.
*/
type Props = AbstractButtonProps & {
/**
* The redux {@code dispatch} function.
*/
dispatch: Function
};
/**
* An implementation of a button which accepts/answers an incoming call.
*/
class AnswerButton extends AbstractButton<Props, *> {
accessibilityLabel = 'incomingCall.answer';
2019-08-30 16:39:06 +00:00
icon = IconHangup;
label = 'incomingCall.answer';
/**
* Handles clicking / pressing the button, and answers the incoming call.
*
* @protected
* @returns {void}
*/
_handleClick() {
this.props.dispatch(incomingCallAnswered());
}
}
export default translate(connect()(AnswerButton));