Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

ref(self-view) Move Hide self view to General tab (#13339)

Robert Pintilii63927db9e4f6
diff --git a/react/features/settings/actions.web.ts b/react/features/settings/actions.web.ts
index cce4e363fb..1466be6239 100644
--- a/react/features/settings/actions.web.ts
+++ b/react/features/settings/actions.web.ts
@@ -102,6 +102,10 @@ export function submitMoreTab(newState: any) {
if (newState.maxStageParticipants !== currentState.maxStageParticipants) {
dispatch(updateSettings({ maxStageParticipants: Number(newState.maxStageParticipants) }));
}
+
+ if (newState.hideSelfView !== currentState.hideSelfView) {
+ dispatch(updateSettings({ disableSelfView: newState.hideSelfView }));
+ }
};
}
@@ -153,10 +157,6 @@ export function submitProfileTab(newState: any) {
APP.conference.changeLocalEmail(newState.email);
}
- if (newState.hideSelfView !== currentState.hideSelfView) {
- dispatch(updateSettings({ disableSelfView: newState.hideSelfView }));
- }
-
if (newState.currentLanguage !== currentState.currentLanguage) {
i18next.changeLanguage(newState.currentLanguage);
}
diff --git a/react/features/settings/components/web/MoreTab.tsx b/react/features/settings/components/web/MoreTab.tsx
index 06f1f88003..c8d6e2afd0 100644
--- a/react/features/settings/components/web/MoreTab.tsx
+++ b/react/features/settings/components/web/MoreTab.tsx
@@ -22,11 +22,26 @@ export interface IProps extends AbstractDialogTabProps, WithTranslation {
*/
classes: any;
+ /**
+ * Whether to show hide self view setting.
+ */
+ disableHideSelfView: boolean;
+
/**
* Whether or not follow me is currently active (enabled by some other participant).
*/
followMeActive: boolean;
+ /**
+ * Whether or not to hide self-view screen.
+ */
+ hideSelfView: boolean;
+
+ /**
+ * Whether we are in visitors mode.
+ */
+ iAmVisitor: boolean;
+
/**
* The number of max participants to display on stage.
*/
@@ -66,6 +81,10 @@ const styles = (theme: Theme) => {
height: '1px',
border: 0,
backgroundColor: theme.palette.ui03
+ },
+
+ checkbox: {
+ margin: `${theme.spacing(3)} 0`
}
};
};
@@ -89,6 +108,7 @@ class MoreTab extends AbstractDialogTab<IProps, any> {
this._onShowPrejoinPageChanged = this._onShowPrejoinPageChanged.bind(this);
this._renderMaxStageParticipantsSelect = this._renderMaxStageParticipantsSelect.bind(this);
this._onMaxStageParticipantsSelect = this._onMaxStageParticipantsSelect.bind(this);
+ this._onHideSelfViewChanged = this._onHideSelfViewChanged.bind(this);
}
/**
@@ -98,7 +118,7 @@ class MoreTab extends AbstractDialogTab<IProps, any> {
* @returns {ReactElement}
*/
render() {
- const { showPrejoinSettings, classes } = this.props;
+ const { showPrejoinSettings, classes, disableHideSelfView, iAmVisitor, hideSelfView, t } = this.props;
return (
<div
@@ -109,6 +129,14 @@ class MoreTab extends AbstractDialogTab<IProps, any> {
<hr className = { classes.divider } />
</>}
{this._renderMaxStageParticipantsSelect()}
+ {!disableHideSelfView && !iAmVisitor && (
+ <Checkbox
+ checked = { hideSelfView }
+ className = { classes.checkbox }
+ label = { t('videothumbnail.hideSelfView') }
+ name = 'hide-self-view'
+ onChange = { this._onHideSelfViewChanged } />
+ )}
</div>
);
}
@@ -138,6 +166,17 @@ class MoreTab extends AbstractDialogTab<IProps, any> {
super._onChange({ maxStageParticipants: maxParticipants });
}
+ /**
+ * Callback invoked to select if hide self view should be enabled.
+ *
+ * @param {Object} e - The key event to handle.
+ *
+ * @returns {void}
+ */
+ _onHideSelfViewChanged({ target: { checked } }: React.ChangeEvent<HTMLInputElement>) {
+ super._onChange({ hideSelfView: checked });
+ }
+
/**
* Returns the React Element for modifying prejoin screen settings.
*
diff --git a/react/features/settings/components/web/ProfileTab.tsx b/react/features/settings/components/web/ProfileTab.tsx
index d6dcd10320..ef1ac3b997 100644
--- a/react/features/settings/components/web/ProfileTab.tsx
+++ b/react/features/settings/components/web/ProfileTab.tsx
@@ -13,7 +13,6 @@ import AbstractDialogTab, {
import { translate } from '../../../base/i18n/functions';
import { withPixelLineHeight } from '../../../base/styles/functions.web';
import Button from '../../../base/ui/components/web/Button';
-import Checkbox from '../../../base/ui/components/web/Checkbox';
import Input from '../../../base/ui/components/web/Input';
import Select from '../../../base/ui/components/web/Select';
import { openLogoutDialog } from '../../actions';
@@ -44,11 +43,6 @@ export interface IProps extends AbstractDialogTabProps, WithTranslation {
*/
currentLanguage: string;
- /**
- * Whether to show hide self view setting.
- */
- disableHideSelfView: boolean;
-
/**
* The display name to display for the local participant.
*/
@@ -64,16 +58,6 @@ export interface IProps extends AbstractDialogTabProps, WithTranslation {
*/
hideEmailInSettings?: boolean;
- /**
- * Whether or not to hide self-view screen.
- */
- hideSelfView: boolean;
-
- /**
- * Whether we are in visitors mode.
- */
- iAmVisitor: boolean;
-
/**
* The id of the local participant.
*/
@@ -151,7 +135,6 @@ class ProfileTab extends AbstractDialogTab<IProps, any> {
this._onAuthToggle = this._onAuthToggle.bind(this);
this._onDisplayNameChange = this._onDisplayNameChange.bind(this);
this._onEmailChange = this._onEmailChange.bind(this);
- this._onHideSelfViewChanged = this._onHideSelfViewChanged.bind(this);
this._onLanguageItemSelect = this._onLanguageItemSelect.bind(this);
}
@@ -177,17 +160,6 @@ class ProfileTab extends AbstractDialogTab<IProps, any> {
super._onChange({ email: value });
}
- /**
- * Callback invoked to select if hide self view should be enabled.
- *
- * @param {Object} e - The key event to handle.
- *
- * @returns {void}
- */
- _onHideSelfViewChanged({ target: { checked } }: React.ChangeEvent<HTMLInputElement>) {
- super._onChange({ hideSelfView: checked });
- }
-
/**
* Callback invoked to select a language from select dropdown.
*
@@ -243,12 +215,9 @@ class ProfileTab extends AbstractDialogTab<IProps, any> {
const {
authEnabled,
classes,
- disableHideSelfView,
displayName,
email,
hideEmailInSettings,
- hideSelfView,
- iAmVisitor,
id,
readOnlyName,
showLanguageSettings,
@@ -283,14 +252,6 @@ class ProfileTab extends AbstractDialogTab<IProps, any> {
type = 'text'
value = { email } />
</div>}
- {!disableHideSelfView && !iAmVisitor && (
- <Checkbox
- checked = { hideSelfView }
- className = { classes.bottomMargin }
- label = { t('videothumbnail.hideSelfView') }
- name = 'hide-self-view'
- onChange = { this._onHideSelfViewChanged } />
- )}
{showLanguageSettings && this._renderLanguageSelect()}
{ authEnabled && this._renderAuth() }
</div>
diff --git a/react/features/settings/functions.any.ts b/react/features/settings/functions.any.ts
index 4816db9eba..caf7ddab1b 100644
--- a/react/features/settings/functions.any.ts
+++ b/react/features/settings/functions.any.ts
@@ -115,7 +115,13 @@ export function getMoreTabProps(stateful: IStateful) {
const state = toState(stateful);
const stageFilmstripEnabled = isStageFilmstripEnabled(state);
+ // when self view is controlled by the config we hide the settings
+ const { disableSelfView, disableSelfViewSettings } = state['features/base/config'];
+
return {
+ disableHideSelfView: disableSelfViewSettings || disableSelfView,
+ hideSelfView: getHideSelfView(state),
+ iAmVisitor: iAmVisitor(state),
showPrejoinPage: !state['features/base/settings'].userSelectedSkipPrejoin,
showPrejoinSettings: state['features/base/config'].prejoinConfig?.enabled,
maxStageParticipants: state['features/base/settings'].maxStageParticipants,
@@ -192,19 +198,13 @@ export function getProfileTabProps(stateful: IStateful) {
const language = i18next.language || DEFAULT_LANGUAGE;
const configuredTabs: string[] = interfaceConfig.SETTINGS_SECTIONS || [];
- // when self view is controlled by the config we hide the settings
- const { disableSelfView, disableSelfViewSettings } = state['features/base/config'];
-
return {
authEnabled: Boolean(conference && authEnabled),
authLogin,
- disableHideSelfView: disableSelfViewSettings || disableSelfView,
currentLanguage: language,
displayName: localParticipant?.name,
email: localParticipant?.email,
hideEmailInSettings,
- hideSelfView: getHideSelfView(state),
- iAmVisitor: iAmVisitor(state),
id: localParticipant?.id,
languages: LANGUAGES,
readOnlyName: isNameReadOnly(state),
diff --git a/react/features/settings/middleware.web.ts b/react/features/settings/middleware.web.ts
index 9906ae2b66..7868c1b024 100644
--- a/react/features/settings/middleware.web.ts
+++ b/react/features/settings/middleware.web.ts
@@ -22,7 +22,7 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
titleKey: 'notify.selfViewTitle',
customActionNameKey: [ 'settings.title' ],
customActionHandler: [ () =>
- dispatch(openSettingsDialog(SETTINGS_TABS.PROFILE))
+ dispatch(openSettingsDialog(SETTINGS_TABS.MORE))
]
}, NOTIFICATION_TIMEOUT_TYPE.STICKY));
}