Skip to content

Commit

Permalink
Merge pull request #17962 from ramonlsouza/change-self-cam-label
Browse files Browse the repository at this point in the history
refactor: Change enable/disable self cam label based on state
  • Loading branch information
antobinary committed May 29, 2023
2 parents 6552a80 + 6ef4b40 commit 20d1247
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ const VideoListItem = (props) => {
isRTL={isRTL}
isStream={isStream}
onHandleDisableCam={() => setIsSelfViewDisabled((value) => !value)}
isSelfViewDisabled={isSelfViewDisabled}
/>
);

Expand All @@ -157,6 +158,7 @@ const VideoListItem = (props) => {
isRTL={isRTL}
isStream={isStream}
onHandleDisableCam={() => setIsSelfViewDisabled((value) => !value)}
isSelfViewDisabled={isSelfViewDisabled}
/>
<UserStatus
voiceUser={voiceUser}
Expand Down Expand Up @@ -206,6 +208,7 @@ const VideoListItem = (props) => {
isRTL={isRTL}
isStream={isStream}
onHandleDisableCam={() => setIsSelfViewDisabled((value) => !value)}
isSelfViewDisabled={isSelfViewDisabled}
/>
<UserStatus
voiceUser={voiceUser}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ const intlMessages = defineMessages({
disableLabel: {
id: 'app.videoDock.webcamDisableLabel',
},
enableLabel: {
id: 'app.videoDock.webcamEnableLabel',
},
pinDesc: {
id: 'app.videoDock.webcamPinDesc',
},
Expand Down Expand Up @@ -60,7 +63,7 @@ const intlMessages = defineMessages({
const UserActions = (props) => {
const {
name, cameraId, numOfStreams, onHandleVideoFocus, user, focused, onHandleMirror,
isVideoSqueezed, videoContainer, isRTL, isStream,
isVideoSqueezed, videoContainer, isRTL, isStream, isSelfViewDisabled,
} = props;

const intl = useIntl();
Expand All @@ -72,6 +75,7 @@ const UserActions = (props) => {
const userId = user?.userId;
const isPinnedIntlKey = !pinned ? 'pin' : 'unpin';
const isFocusedIntlKey = !focused ? 'focus' : 'unfocus';
const enableSelfCamIntlKey = !isSelfViewDisabled ? 'disable' : 'enable';

const menuItems = [];

Expand Down Expand Up @@ -107,8 +111,8 @@ const UserActions = (props) => {
if (userId === Auth.userID && isStream) {
menuItems.push({
key: `${cameraId}-disable`,
label: intl.formatMessage(intlMessages.disableLabel),
description: intl.formatMessage(intlMessages.disableDesc),
label: intl.formatMessage(intlMessages[`${enableSelfCamIntlKey}Label`]),
description: intl.formatMessage(intlMessages[`${enableSelfCamIntlKey}Label`]),
onClick: () => toggleDisableCam(cameraId),
dataTest: 'selfViewDisableBtn',
});
Expand Down
5 changes: 3 additions & 2 deletions bigbluebutton-html5/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1125,8 +1125,9 @@
"app.videoDock.webcamFocusDesc": "Focus the selected webcam",
"app.videoDock.webcamUnfocusLabel": "Unfocus",
"app.videoDock.webcamUnfocusDesc": "Unfocus the selected webcam",
"app.videoDock.webcamDisableLabel": "Disable/Enable self cam",
"app.videoDock.webcamDisableDesc": "Self cam disabled",
"app.videoDock.webcamDisableLabel": "Disable self-view",
"app.videoDock.webcamEnableLabel": "Enable self-view",
"app.videoDock.webcamDisableDesc": "Self-view disabled",
"app.videoDock.webcamPinLabel": "Pin",
"app.videoDock.webcamPinDesc": "Pin the selected webcam",
"app.videoDock.webcamFullscreenLabel": "Fullscreen webcam",
Expand Down

0 comments on commit 20d1247

Please sign in to comment.