Changed the buttons to TooltipButtons and added the tooltip for the hangup button

Signed-off-by: Peter Vágner <pvdeejay@gmail.com>
This commit is contained in:
Peter Vágner 2021-06-12 14:17:10 +02:00
parent 6458f717cc
commit a94d11235e
2 changed files with 13 additions and 9 deletions

View file

@ -25,6 +25,8 @@ import RoomAvatar from "../avatars/RoomAvatar";
import { CallState, CallType, MatrixCall, CallEvent } from 'matrix-js-sdk/src/webrtc/call';
import classNames from 'classnames';
import AccessibleButton from '../elements/AccessibleButton';
import AccessibleTooltipButton from "../elements/AccessibleTooltipButton";
import { ContextMenuTooltipButton } from "../../../accessibility/context_menu/ContextMenuTooltipButton";
import {isOnlyCtrlOrCmdKeyEvent, Key} from '../../../Keyboard';
import {alwaysAboveLeftOf, alwaysAboveRightOf, ChevronFace, ContextMenuButton} from '../../structures/ContextMenu';
import CallContextMenu from '../context_menus/CallContextMenu';
@ -438,40 +440,40 @@ export default class CallView extends React.Component<IProps, IState> {
mx_CallView_callControls_hidden: !this.state.controlsVisible,
});
const vidMuteButton = this.props.call.type === CallType.Video ? <AccessibleButton
const vidMuteButton = this.props.call.type === CallType.Video ? <AccessibleTooltipButton
className={vidClasses}
onClick={this.onVidMuteClick}
aria-label={this.state.vidMuted ? _t("Start the camera") : _t("Stop the camera")}
title={this.state.vidMuted ? _t("Start the camera") : _t("Stop the camera")}
/> : null;
// The dial pad & 'more' button actions are only relevant in a connected call
// When not connected, we have to put something there to make the flexbox alignment correct
const dialpadButton = this.state.callState === CallState.Connected ? <ContextMenuButton
const dialpadButton = this.state.callState === CallState.Connected ? <ContextMenuTooltipButton
className="mx_CallView_callControls_button mx_CallView_callControls_dialpad"
inputRef={this.dialpadButton}
onClick={this.onDialpadClick}
isExpanded={this.state.showDialpad}
aria-label={_t("Dialpad")}
title={_t("Dialpad")}
/> : <div className="mx_CallView_callControls_button mx_CallView_callControls_button_dialpad_hidden" />;
const contextMenuButton = this.state.callState === CallState.Connected ? <ContextMenuButton
const contextMenuButton = this.state.callState === CallState.Connected ? <ContextMenuTooltipButton
className="mx_CallView_callControls_button mx_CallView_callControls_button_more"
onClick={this.onMoreClick}
inputRef={this.contextMenuButton}
isExpanded={this.state.showMoreMenu}
aria-label={_t("More")}
title={_t("More")}
/> : <div className="mx_CallView_callControls_button mx_CallView_callControls_button_more_hidden" />;
// in the near future, the dial pad button will go on the left. For now, it's the nothing button
// because something needs to have margin-right: auto to make the alignment correct.
const callControls = <div className={callControlsClasses}>
{dialpadButton}
<AccessibleButton
<AccessibleTooltipButton
className={micClasses}
onClick={this.onMicMuteClick}
aria-label={this.state.micMuted ? _t("Unmute the microphone") : _t("Mute the microphone")}
title={this.state.micMuted ? _t("Unmute the microphone") : _t("Mute the microphone")}
/>
<AccessibleButton
<AccessibleTooltipButton
className="mx_CallView_callControls_button mx_CallView_callControls_button_hangup"
onClick={() => {
dis.dispatch({
@ -479,6 +481,7 @@ export default class CallView extends React.Component<IProps, IState> {
room_id: callRoomId,
});
}}
title={_t("Hangup")}
/>
{vidMuteButton}
<div className={micCacheClasses} />

View file

@ -895,6 +895,7 @@
"More": "More",
"Unmute the microphone": "Unmute the microphone",
"Mute the microphone": "Mute the microphone",
"Hangup": "Hangup",
"unknown person": "unknown person",
"Consulting with %(transferTarget)s. <a>Transfer to %(transferee)s</a>": "Consulting with %(transferTarget)s. <a>Transfer to %(transferee)s</a>",
"You held the call <a>Switch</a>": "You held the call <a>Switch</a>",