mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-30 19:39:22 +00:00
Review (everything except translation feedback)
This commit is contained in:
@@ -36,18 +36,6 @@ export interface ToggleOption {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface IconsAndLabels {
|
||||
/** The Icon used if the mute button is enabled */
|
||||
IconEnabled: ComponentType<React.SVGAttributes<SVGElement>>;
|
||||
/** The Icon used if the mute button is disabled */
|
||||
IconDisabled: ComponentType<React.SVGAttributes<SVGElement>>;
|
||||
/** The icon used for the different options */
|
||||
IconOptions?: ComponentType<React.SVGAttributes<SVGElement>>;
|
||||
enabledLabel: string;
|
||||
disabledLabel: string;
|
||||
optionsButtonLabel: string;
|
||||
}
|
||||
|
||||
export interface MediaMuteAndSwitchButtonProps {
|
||||
/** The title used in the Switcher modal. */
|
||||
title: string;
|
||||
@@ -55,7 +43,7 @@ export interface MediaMuteAndSwitchButtonProps {
|
||||
enabled?: boolean;
|
||||
/** Callback if the mute button is clicked */
|
||||
onMuteClick?: () => void;
|
||||
iconsAndLabels?: "video" | "audio" | IconsAndLabels;
|
||||
iconsAndLabels: "video" | "audio";
|
||||
/** The options available for the media device selector modal */
|
||||
options?: MenuOptions[];
|
||||
/** The option that will currently be rendered as the selected option */
|
||||
@@ -115,30 +103,7 @@ export const MediaMuteAndSwitchButton: FC<MediaMuteAndSwitchButtonProps> = ({
|
||||
data-testid="incall_mute"
|
||||
/>
|
||||
);
|
||||
break;
|
||||
default:
|
||||
button = (
|
||||
<Button
|
||||
iconOnly
|
||||
role="switch"
|
||||
Icon={
|
||||
enabled ? iconsAndLabels?.IconEnabled : iconsAndLabels?.IconDisabled
|
||||
}
|
||||
onClick={(e) => {
|
||||
onMuteClick?.();
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}}
|
||||
kind={enabled ? "secondary" : "primary"}
|
||||
size="lg"
|
||||
className={styles.button}
|
||||
aria-label={
|
||||
enabled
|
||||
? iconsAndLabels?.disabledLabel
|
||||
: iconsAndLabels?.enabledLabel
|
||||
}
|
||||
/>
|
||||
);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -153,14 +118,6 @@ export const MediaMuteAndSwitchButton: FC<MediaMuteAndSwitchButtonProps> = ({
|
||||
IconOptions = MicOnIcon;
|
||||
optionsButtonLabel = t("settings.devices.microphone");
|
||||
break;
|
||||
case undefined:
|
||||
IconOptions = undefined;
|
||||
optionsButtonLabel = "undefined";
|
||||
break;
|
||||
default:
|
||||
IconOptions = iconsAndLabels.IconOptions;
|
||||
optionsButtonLabel = iconsAndLabels.optionsButtonLabel;
|
||||
break;
|
||||
}
|
||||
return (
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user