зеркало из
1
0
Форкнуть 0

fix missing keys for ControlBar buttons (#226)

This commit is contained in:
alcail 2021-05-06 13:37:04 -07:00 коммит произвёл GitHub
Родитель b6f2bcca5c
Коммит 2f7ac2b229
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 28 добавлений и 13 удалений

Просмотреть файл

@ -0,0 +1,7 @@
{
"type": "none",
"comment": "fix missing keys for ControlBar buttons",
"packageName": "react-components",
"email": "alcail@microsoft.com",
"dependentChangeType": "none"
}

Просмотреть файл

@ -27,12 +27,12 @@ export const CameraButton = (props: CameraButtonProps): JSX.Element => {
const componentStyles = concatStyleSets(controlButtonStyles, styles ?? {});
const defaultRenderIcon = (props?: IButtonProps): JSX.Element => {
return props?.checked ? <CallVideoIcon /> : <CallVideoOffIcon />;
return props?.checked ? <CallVideoIcon key={'videoIconKey'} /> : <CallVideoOffIcon key={'videoOffIconKey'} />;
};
const defaultRenderText = (props?: IButtonProps): JSX.Element => {
return (
<Stack className={mergeStyles(controlButtonLabelStyles, props?.styles?.label)}>
<Stack key={'videoLabelKey'} className={mergeStyles(controlButtonLabelStyles, props?.styles?.label)}>
{props?.checked ? 'Turn off' : 'Turn on'}
</Stack>
);

Просмотреть файл

@ -27,11 +27,15 @@ export const EndCallButton = (props: EndCallButtonProps): JSX.Element => {
const componentStyles = concatStyleSets(endCallControlButtonStyles, styles ?? {});
const defaultRenderIcon = (): JSX.Element => {
return <CallEndIcon />;
return <CallEndIcon key={'callEndIconKey'} />;
};
const defaultRenderText = (props?: IButtonProps): JSX.Element => {
return <Stack className={mergeStyles(controlButtonLabelStyles, props?.styles?.label)}>{'Hangup'}</Stack>;
return (
<Stack key={'callEndLabelKey'} className={mergeStyles(controlButtonLabelStyles, props?.styles?.label)}>
{'Hangup'}
</Stack>
);
};
return (

Просмотреть файл

@ -25,11 +25,7 @@ export const MicrophoneButton = (props: MicrophoneButtonProps): JSX.Element => {
const componentStyles = concatStyleSets(controlButtonStyles, styles ?? {});
const defaultRenderIcon = (props?: IButtonProps): JSX.Element => {
if (props?.checked) {
return <MicIcon key={'micIconKey'} />;
}
return <MicOffIcon key={'micOffIconKey'} />;
return props?.checked ? <MicIcon key={'microphoneIconKey'} /> : <MicOffIcon key={'microphoneOffIconKey'} />;
};
const defaultRenderText = (props?: IButtonProps): JSX.Element => {

Просмотреть файл

@ -28,11 +28,15 @@ export const OptionsButton = (props: OptionsButtonProps): JSX.Element => {
const componentStyles = concatStyleSets(controlButtonStyles, styles ?? {});
const defaultRenderIcon = (): JSX.Element => {
return <MoreIcon />;
return <MoreIcon key={'optionsIconKey'} />;
};
const defaultRenderText = (props?: IButtonProps): JSX.Element => {
return <Stack className={mergeStyles(controlButtonLabelStyles, props?.styles?.label)}>{'Options'}</Stack>;
return (
<Stack key={'optionsLabelKey'} className={mergeStyles(controlButtonLabelStyles, props?.styles?.label)}>
{'Options'}
</Stack>
);
};
return (

Просмотреть файл

@ -27,12 +27,16 @@ export const ScreenShareButton = (props: ScreenShareButtonProps): JSX.Element =>
const componentStyles = concatStyleSets(controlButtonStyles, styles ?? {});
const defaultRenderIcon = (props?: IButtonProps): JSX.Element => {
return props?.checked ? <CallControlCloseTrayIcon /> : <CallControlPresentNewIcon bordered={false} />;
return props?.checked ? (
<CallControlCloseTrayIcon key={'screenShareIconKey'} />
) : (
<CallControlPresentNewIcon key={'screenShareBorderedIconKey'} bordered={false} />
);
};
const defaultRenderText = (props?: IButtonProps): JSX.Element => {
return (
<Stack className={mergeStyles(controlButtonLabelStyles, props?.styles?.label)}>
<Stack key={'screenShareLabelKey'} className={mergeStyles(controlButtonLabelStyles, props?.styles?.label)}>
{props?.checked ? 'Stop' : 'Share'}
</Stack>
);