ref(more-tab) Update design on SettingsDialog More tab (#13006)

This commit is contained in:
Robert Pintilii 2023-03-08 10:40:40 +02:00 committed by GitHub
parent fb81619fc5
commit aa57309057
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 73 deletions

View File

@ -995,7 +995,7 @@
"microphones": "Microphones", "microphones": "Microphones",
"moderator": "Moderator", "moderator": "Moderator",
"moderatorOptions": "Moderator options", "moderatorOptions": "Moderator options",
"more": "More", "more": "General",
"name": "Name", "name": "Name",
"noDevice": "None", "noDevice": "None",
"notifications": "Notifications", "notifications": "Notifications",

View File

@ -1,3 +1,6 @@
import { Theme } from '@mui/material';
import { withStyles } from '@mui/styles';
import clsx from 'clsx';
import React from 'react'; import React from 'react';
import { WithTranslation } from 'react-i18next'; import { WithTranslation } from 'react-i18next';
@ -12,7 +15,12 @@ import { MAX_ACTIVE_PARTICIPANTS } from '../../../filmstrip/constants';
/** /**
* The type of the React {@code Component} props of {@link MoreTab}. * The type of the React {@code Component} props of {@link MoreTab}.
*/ */
export type Props = AbstractDialogTabProps & WithTranslation & { export interface IProps extends AbstractDialogTabProps, WithTranslation {
/**
* CSS classes object.
*/
classes: any;
/** /**
* Whether or not follow me is currently active (enabled by some other participant). * Whether or not follow me is currently active (enabled by some other participant).
@ -43,11 +51,23 @@ export type Props = AbstractDialogTabProps & WithTranslation & {
* Wether or not the stage filmstrip is enabled. * Wether or not the stage filmstrip is enabled.
*/ */
stageFilmstripEnabled: boolean; stageFilmstripEnabled: boolean;
}
/** const styles = (theme: Theme) => {
* Invoked to obtain translated strings. return {
*/ container: {
t: Function; display: 'flex',
flexDirection: 'column' as const
},
divider: {
margin: `${theme.spacing(4)} 0`,
width: '100%',
height: '1px',
border: 0,
backgroundColor: theme.palette.ui03
}
};
}; };
/** /**
@ -55,14 +75,14 @@ export type Props = AbstractDialogTabProps & WithTranslation & {
* *
* @augments Component * @augments Component
*/ */
class MoreTab extends AbstractDialogTab<Props, any> { class MoreTab extends AbstractDialogTab<IProps, any> {
/** /**
* Initializes a new {@code MoreTab} instance. * Initializes a new {@code MoreTab} instance.
* *
* @param {Object} props - The read-only properties with which the new * @param {Object} props - The read-only properties with which the new
* instance is to be initialized. * instance is to be initialized.
*/ */
constructor(props: Props) { constructor(props: IProps) {
super(props); super(props);
// Bind event handler so it is only bound once for every instance. // Bind event handler so it is only bound once for every instance.
@ -78,16 +98,17 @@ class MoreTab extends AbstractDialogTab<Props, any> {
* @returns {ReactElement} * @returns {ReactElement}
*/ */
render() { render() {
const content = []; const { showPrejoinSettings, classes } = this.props;
content.push(this._renderSettingsLeft());
content.push(this._renderSettingsRight());
return ( return (
<div <div
className = 'more-tab box' className = { clsx('more-tab', classes.container) }
key = 'more'> key = 'more'>
{ content } {showPrejoinSettings && <>
{this._renderPrejoinScreenSettings()}
<hr className = { classes.divider } />
</>}
{this._renderMaxStageParticipantsSelect()}
</div> </div>
); );
} }
@ -127,18 +148,11 @@ class MoreTab extends AbstractDialogTab<Props, any> {
const { t, showPrejoinPage } = this.props; const { t, showPrejoinPage } = this.props;
return ( return (
<div <Checkbox
className = 'settings-sub-pane-element' checked = { showPrejoinPage }
key = 'prejoin-screen'> label = { t('prejoin.showScreen') }
<span className = 'checkbox-label'> name = 'show-prejoin-page'
{ t('prejoin.premeeting') } onChange = { this._onShowPrejoinPageChanged } />
</span>
<Checkbox
checked = { showPrejoinPage }
label = { t('prejoin.showScreen') }
name = 'show-prejoin-page'
onChange = { this._onShowPrejoinPageChanged } />
</div>
); );
} }
@ -162,52 +176,13 @@ class MoreTab extends AbstractDialogTab<Props, any> {
}); });
return ( return (
<div <Select
className = 'settings-sub-pane-element' label = { t('settings.maxStageParticipants') }
key = 'maxStageParticipants'> onChange = { this._onMaxStageParticipantsSelect }
<div className = 'dropdown-menu'> options = { maxParticipantsItems }
<Select value = { maxStageParticipants } />
label = { t('settings.maxStageParticipants') }
onChange = { this._onMaxStageParticipantsSelect }
options = { maxParticipantsItems }
value = { maxStageParticipants } />
</div>
</div>
);
}
/**
* Returns the React element that needs to be displayed on the right half of the more tabs.
*
* @private
* @returns {ReactElement}
*/
_renderSettingsRight() {
return (
<div
className = 'settings-sub-pane right'
key = 'settings-sub-pane-right'>
{ this._renderMaxStageParticipantsSelect() }
</div>
);
}
/**
* Returns the React element that needs to be displayed on the left half of the more tabs.
*
* @returns {ReactElement}
*/
_renderSettingsLeft() {
const { showPrejoinSettings } = this.props;
return (
<div
className = 'settings-sub-pane left'
key = 'settings-sub-pane-left'>
{ showPrejoinSettings && this._renderPrejoinScreenSettings() }
</div>
); );
} }
} }
export default translate(MoreTab); export default withStyles(styles)(translate(MoreTab));

View File

@ -389,8 +389,6 @@ function _mapStateToProps(state: IReduxState, ownProps: any) {
if (showMoreTab) { if (showMoreTab) {
tabs.push({ tabs.push({
name: SETTINGS_TABS.MORE, name: SETTINGS_TABS.MORE,
// @ts-ignore
component: MoreTab, component: MoreTab,
labelKey: 'settings.more', labelKey: 'settings.more',
props: moreTabProps, props: moreTabProps,