diff --git a/lang/main.json b/lang/main.json index 6897d433c..2e44156d8 100644 --- a/lang/main.json +++ b/lang/main.json @@ -886,9 +886,9 @@ }, "profile": { "avatar": "avatar", - "setDisplayNameLabel": "Set your display name", + "setDisplayNameLabel": "Name", "setEmailInput": "Enter email", - "setEmailLabel": "Set your gravatar email", + "setEmailLabel": "Gravatar email", "title": "Profile" }, "raisedHand": "Would like to speak", diff --git a/react/features/settings/actions.ts b/react/features/settings/actions.ts index 30778a5f4..7d2554a30 100644 --- a/react/features/settings/actions.ts +++ b/react/features/settings/actions.ts @@ -107,20 +107,12 @@ export function submitMoreTab(newState: any) { })); } - if (newState.currentLanguage !== currentState.currentLanguage) { - i18next.changeLanguage(newState.currentLanguage); - } - if (newState.currentFramerate !== currentState.currentFramerate) { const frameRate = parseInt(newState.currentFramerate, 10); dispatch(setScreenshareFramerate(frameRate)); } - if (newState.hideSelfView !== currentState.hideSelfView) { - dispatch(updateSettings({ disableSelfView: newState.hideSelfView })); - } - if (newState.maxStageParticipants !== currentState.maxStageParticipants) { dispatch(updateSettings({ maxStageParticipants: Number(newState.maxStageParticipants) })); } @@ -174,6 +166,14 @@ export function submitProfileTab(newState: any) { if (newState.email !== currentState.email) { 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 8dc3cd7d7..83e71be6d 100644 --- a/react/features/settings/components/web/MoreTab.tsx +++ b/react/features/settings/components/web/MoreTab.tsx @@ -22,22 +22,11 @@ export type Props = AbstractDialogTabProps & WithTranslation & { */ currentFramerate: string; - /** - * The currently selected language to display in the language select - * dropdown. - */ - currentLanguage: string; - /** * All available desktop capture frame rates. */ desktopShareFramerates: Array; - /** - * Whether to show hide self view setting. - */ - disableHideSelfView: boolean; - /** * The types of enabled notifications that can be configured and their specific visibility. */ @@ -48,26 +37,11 @@ export type Props = AbstractDialogTabProps & WithTranslation & { */ followMeActive: boolean; - /** - * Whether or not to hide self-view screen. - */ - hideSelfView: boolean; - - /** - * All available languages to display in the language select dropdown. - */ - languages: Array; - /** * The number of max participants to display on stage. */ maxStageParticipants: number; - /** - * Whether or not to display the language select dropdown. - */ - showLanguageSettings: boolean; - /** * Whether or not to display moderator-only settings. */ @@ -116,11 +90,9 @@ class MoreTab extends AbstractDialogTab { // Bind event handler so it is only bound once for every instance. this._onFramerateItemSelect = this._onFramerateItemSelect.bind(this); - this._onLanguageItemSelect = this._onLanguageItemSelect.bind(this); this._onEnabledNotificationsChanged = this._onEnabledNotificationsChanged.bind(this); this._onShowPrejoinPageChanged = this._onShowPrejoinPageChanged.bind(this); this._onKeyboardShortcutEnableChanged = this._onKeyboardShortcutEnableChanged.bind(this); - this._onHideSelfViewChanged = this._onHideSelfViewChanged.bind(this); this._renderMaxStageParticipantsSelect = this._renderMaxStageParticipantsSelect.bind(this); this._onMaxStageParticipantsSelect = this._onMaxStageParticipantsSelect.bind(this); } @@ -159,19 +131,6 @@ class MoreTab extends AbstractDialogTab { super._onChange({ currentFramerate: frameRate }); } - /** - * Callback invoked to select a language from select dropdown. - * - * @param {Object} e - The key event to handle. - * - * @returns {void} - */ - _onLanguageItemSelect(e: React.ChangeEvent) { - const language = e.target.value; - - super._onChange({ currentLanguage: language }); - } - /** * Callback invoked to select if the lobby * should be shown. @@ -215,17 +174,6 @@ class MoreTab extends AbstractDialogTab { super._onChange({ keyboardShortcutEnable: checked }); } - /** - * 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) { - super._onChange({ hideSelfView: checked }); - } - /** * Callback invoked to select a max number of stage participants from the select dropdown. * @@ -296,67 +244,6 @@ class MoreTab extends AbstractDialogTab { ); } - /** - * Returns the React Element for self view setting. - * - * @private - * @returns {ReactElement} - */ - _renderSelfViewCheckbox() { - const { hideSelfView, t } = this.props; - - return ( -
- - { t('settings.selfView') } - - -
- ); - } - - /** - * Returns the menu item for changing displayed language. - * - * @private - * @returns {ReactElement} - */ - _renderLanguageSelect() { - const { - currentLanguage, - languages, - t - } = this.props; - - const languageItems - = languages.map((language: string) => { - return { - value: language, - label: t(`languages:${language}`) - }; - }); - - return ( -
-
- + ); + } + /** * Implements React's {@link Component#render()}. * @@ -114,38 +228,55 @@ class ProfileTab extends AbstractDialogTab { render() { const { authEnabled, + classes, + disableHideSelfView, displayName, email, hideEmailInSettings, + hideSelfView, + id, readOnlyName, - t // @ts-ignore + showLanguageSettings, + t } = this.props; return ( -
-
-
- -
- {!hideEmailInSettings &&
- -
} +
+
+
+ + {!hideEmailInSettings &&
+ +
} + {!disableHideSelfView && ( + + )} + {showLanguageSettings && this._renderLanguageSelect()} { authEnabled && this._renderAuth() }
); @@ -159,7 +290,6 @@ class ProfileTab extends AbstractDialogTab { * @returns {void} */ _onAuthToggle() { - // @ts-ignore if (this.props.authLogin) { sendAnalytics(createProfilePanelButtonEvent('logout.button')); @@ -183,8 +313,6 @@ class ProfileTab extends AbstractDialogTab { const { authLogin, t - - // @ts-ignore } = this.props; return ( @@ -206,5 +334,4 @@ class ProfileTab extends AbstractDialogTab { } } -// @ts-ignore -export default translate(ProfileTab); +export default withStyles(styles)(translate(ProfileTab)); diff --git a/react/features/settings/components/web/SettingsDialog.tsx b/react/features/settings/components/web/SettingsDialog.tsx index 42cd58a76..c42159a7c 100644 --- a/react/features/settings/components/web/SettingsDialog.tsx +++ b/react/features/settings/components/web/SettingsDialog.tsx @@ -84,10 +84,6 @@ const styles = (theme: Theme) => { display: 'flex', width: '100%', - '&.profile-pane': { - flexDirection: 'column' - }, - '& .auth-name': { marginBottom: theme.spacing(1) }, @@ -130,19 +126,6 @@ const styles = (theme: Theme) => { width: '100%' }, - '& .profile-edit': { - display: 'flex', - width: '100%', - padding: '0 2px', - boxSizing: 'border-box' - }, - - '& .profile-edit-field': { - flex: 0.5, - marginRight: '20px', - marginTop: theme.spacing(3) - }, - '& .settings-sub-pane': { flex: 1 }, @@ -303,7 +286,7 @@ function _mapStateToProps(state: IReduxState, ownProps: any) { component: ProfileTab, labelKey: 'profile.title', props: getProfileTabProps(state), - className: `settings-pane ${classes.settingsDialog} profile-pane`, + className: `settings-pane ${classes.settingsDialog}`, submit: submitProfileTab, icon: IconUser }); diff --git a/react/features/settings/functions.any.ts b/react/features/settings/functions.any.ts index b19b0bf08..e5568fc18 100644 --- a/react/features/settings/functions.any.ts +++ b/react/features/settings/functions.any.ts @@ -116,22 +116,12 @@ export function getNotificationsMap(stateful: IStateful) { export function getMoreTabProps(stateful: IStateful) { const state = toState(stateful); const framerate = state['features/screen-share'].captureFrameRate ?? SS_DEFAULT_FRAME_RATE; - const language = i18next.language || DEFAULT_LANGUAGE; - const configuredTabs: string[] = interfaceConfig.SETTINGS_SECTIONS || []; const enabledNotifications = getNotificationsMap(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 { currentFramerate: framerate, - currentLanguage: language, desktopShareFramerates: SS_SUPPORTED_FRAMERATES, - disableHideSelfView: disableSelfViewSettings || disableSelfView, - hideSelfView: getHideSelfView(state), - languages: LANGUAGES, - showLanguageSettings: configuredTabs.includes('language'), enabledNotifications, showNotificationsSettings: Object.keys(enabledNotifications).length > 0, showPrejoinPage: !state['features/base/settings'].userSelectedSkipPrejoin, @@ -207,14 +197,25 @@ export function getProfileTabProps(stateful: IStateful) { } = state['features/base/conference']; const { hideEmailInSettings } = state['features/base/config']; const localParticipant = getLocalParticipant(state); + 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), + id: localParticipant?.id, + languages: LANGUAGES, readOnlyName: isNameReadOnly(state), - hideEmailInSettings + showLanguageSettings: configuredTabs.includes('language') }; } diff --git a/react/features/settings/middleware.web.ts b/react/features/settings/middleware.web.ts index 7868c1b02..9906ae2b6 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.MORE)) + dispatch(openSettingsDialog(SETTINGS_TABS.PROFILE)) ] }, NOTIFICATION_TIMEOUT_TYPE.STICKY)); } diff --git a/react/features/subtitles/components/LanguageSelectorDialog.web.tsx b/react/features/subtitles/components/LanguageSelectorDialog.web.tsx index 8ff5451b9..b34dc0ec8 100644 --- a/react/features/subtitles/components/LanguageSelectorDialog.web.tsx +++ b/react/features/subtitles/components/LanguageSelectorDialog.web.tsx @@ -92,7 +92,7 @@ const LanguageSelectorDialog = ({ }, [ _language ]); const onSourceLanguageClick = useCallback(() => { - dispatch(openSettingsDialog(SETTINGS_TABS.MORE, false)); + dispatch(openSettingsDialog(SETTINGS_TABS.PROFILE, false)); }, []); return (