Browse Source

ref(moderator-settings) Update Moderator tab in Settings Dialog (#12991)

Update design
factor2
Robert Pintilii 2 years ago
parent
commit
d550254f31
No account linked to committer's email address

+ 1
- 0
lang/main.json View File

@@ -991,6 +991,7 @@
991 991
         "maxStageParticipants": "Maximum number of participants who can be pinned to the main stage (EXPERIMENTAL)",
992 992
         "microphones": "Microphones",
993 993
         "moderator": "Moderator",
994
+        "moderatorOptions": "Moderator options",
994 995
         "more": "More",
995 996
         "name": "Name",
996 997
         "noDevice": "None",

+ 6
- 0
react/features/base/icons/svg/host.svg View File

@@ -0,0 +1,6 @@
1
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+    <path fill-rule="evenodd" clip-rule="evenodd" d="M12.1602 8.24439C13.3281 8.16225 14.25 7.18879 14.25 6C14.25 4.75736 13.2426 3.75 12 3.75C10.7574 3.75 9.75 4.75736 9.75 6C9.75 7.18151 10.6607 8.15032 11.8184 8.24278C11.5197 8.21896 11.2375 8.13687 10.9831 8.00775C9.85816 9.83693 8.19346 10.3318 6.74461 10.3424C6.66364 9.17333 5.68961 8.25 4.5 8.25C3.25736 8.25 2.25 9.25736 2.25 10.5C2.25 11.7426 3.25736 12.75 4.5 12.75C5.32135 12.75 6.03995 12.31 6.43279 11.6528C6.39557 11.715 6.35542 11.7754 6.31253 11.8336C6.67901 11.8506 7.06503 11.8447 7.4618 11.805C8.64456 11.6868 9.95784 11.2623 11.0918 10.2228C11.4736 9.87283 11.8205 9.46641 12.1289 9.0006C12.4727 9.47803 12.8468 9.89069 13.2474 10.2432C14.3929 11.2513 15.6592 11.6829 16.8118 11.8042C17.1152 11.8362 17.4101 11.8467 17.6932 11.8412C17.6739 11.8152 17.6551 11.7887 17.6369 11.7619C18.0415 12.3582 18.725 12.75 19.5 12.75C20.7426 12.75 21.75 11.7426 21.75 10.5C21.75 9.25736 20.7426 8.25 19.5 8.25C18.3129 8.25 17.3405 9.16938 17.256 10.335C15.9245 10.2658 14.3912 9.7053 13.1957 7.90649C12.8918 8.09752 12.5389 8.21778 12.1602 8.24439ZM12 6.75C12.4142 6.75 12.75 6.41421 12.75 6C12.75 5.58579 12.4142 5.25 12 5.25C11.5858 5.25 11.25 5.58579 11.25 6C11.25 6.41421 11.5858 6.75 12 6.75ZM20.25 10.5C20.25 10.9142 19.9142 11.25 19.5 11.25C19.0858 11.25 18.75 10.9142 18.75 10.5C18.75 10.0858 19.0858 9.75 19.5 9.75C19.9142 9.75 20.25 10.0858 20.25 10.5ZM4.5 11.25C4.91421 11.25 5.25 10.9142 5.25 10.5C5.25 10.0858 4.91421 9.75 4.5 9.75C4.08579 9.75 3.75 10.0858 3.75 10.5C3.75 10.9142 4.08579 11.25 4.5 11.25Z" fill="white"/>
3
+    <path d="M17.9485 12.1296C18.3135 12.4773 18.7952 12.7036 19.3289 12.7437L19.2591 12.9706C19.1623 13.2853 18.8715 13.5 18.5423 13.5C18.0377 13.5 17.677 13.0117 17.8254 12.5294L17.9485 12.1296Z" fill="white"/>
4
+    <path d="M12.75 18.0001C13.1642 18.0001 13.5 18.3359 13.5 18.7501C13.5 19.1643 13.1642 19.5001 12.75 19.5001H7.85792C7.19941 19.5001 6.61791 19.0706 6.42425 18.4412L4.6712 12.7437C5.20487 12.7036 5.6866 12.4773 6.05164 12.1296L7.85792 18.0001H12.75Z" fill="white"/>
5
+    <path d="M11.25 18.0002C10.8358 18.0002 10.5 18.336 10.5 18.7502C10.5 19.1644 10.8358 19.5002 11.25 19.5002H16.1421C16.8006 19.5002 17.3821 19.0707 17.5757 18.4413L19.3289 12.7437C18.7952 12.7036 18.3135 12.4773 17.9485 12.1296L16.1421 18.0002H11.25Z" fill="white"/>
6
+</svg>

+ 1
- 0
react/features/base/icons/svg/index.ts View File

@@ -43,6 +43,7 @@ export { default as IconFeedback } from './feedback.svg';
43 43
 export { default as IconGear } from './gear.svg';
44 44
 export { default as IconGoogle } from './google.svg';
45 45
 export { default as IconHangup } from './hangup.svg';
46
+export { default as IconHost } from './host.svg';
46 47
 export { default as IconHelp } from './help.svg';
47 48
 export { default as IconHighlight } from './highlight.svg';
48 49
 export { default as IconImage } from './image.svg';

+ 62
- 52
react/features/settings/components/web/ModeratorTab.tsx View File

@@ -1,18 +1,23 @@
1
+import { Theme } from '@mui/material';
2
+import { withStyles } from '@mui/styles';
1 3
 import React from 'react';
2 4
 import { WithTranslation } from 'react-i18next';
3 5
 
4
-// @ts-ignore
5
-import { AbstractDialogTab } from '../../../base/dialog';
6
-// eslint-disable-next-line lines-around-comment
7
-// @ts-ignore
8
-import type { Props as AbstractDialogTabProps } from '../../../base/dialog';
6
+import AbstractDialogTab, {
7
+    IProps as AbstractDialogTabProps } from '../../../base/dialog/components/web/AbstractDialogTab';
9 8
 import { translate } from '../../../base/i18n/functions';
9
+import { withPixelLineHeight } from '../../../base/styles/functions.web';
10 10
 import Checkbox from '../../../base/ui/components/web/Checkbox';
11 11
 
12 12
 /**
13 13
  * The type of the React {@code Component} props of {@link ModeratorTab}.
14 14
  */
15
-export type Props = AbstractDialogTabProps & WithTranslation & {
15
+export interface IProps extends AbstractDialogTabProps, WithTranslation {
16
+
17
+    /**
18
+     * CSS classes object.
19
+     */
20
+    classes: any;
16 21
 
17 22
     /**
18 23
      * If set hides the reactions moderation setting.
@@ -46,11 +51,25 @@ export type Props = AbstractDialogTabProps & WithTranslation & {
46 51
      * enabled.
47 52
      */
48 53
     startVideoMuted: boolean;
54
+}
49 55
 
50
-    /**
51
-     * Invoked to obtain translated strings.
52
-     */
53
-    t: Function;
56
+const styles = (theme: Theme) => {
57
+    return {
58
+        container: {
59
+            display: 'flex',
60
+            flexDirection: 'column' as const
61
+        },
62
+
63
+        title: {
64
+            ...withPixelLineHeight(theme.typography.heading6),
65
+            color: `${theme.palette.text01} !important`,
66
+            marginBottom: theme.spacing(3)
67
+        },
68
+
69
+        checkbox: {
70
+            marginBottom: theme.spacing(3)
71
+        }
72
+    };
54 73
 };
55 74
 
56 75
 /**
@@ -58,14 +77,14 @@ export type Props = AbstractDialogTabProps & WithTranslation & {
58 77
  *
59 78
  * @augments Component
60 79
  */
61
-class ModeratorTab extends AbstractDialogTab<Props> {
80
+class ModeratorTab extends AbstractDialogTab<IProps, any> {
62 81
     /**
63 82
      * Initializes a new {@code ModeratorTab} instance.
64 83
      *
65 84
      * @param {Object} props - The read-only properties with which the new
66 85
      * instance is to be initialized.
67 86
      */
68
-    constructor(props: Props) {
87
+    constructor(props: IProps) {
69 88
         super(props);
70 89
 
71 90
         // Bind event handler so it is only bound once for every instance.
@@ -75,16 +94,6 @@ class ModeratorTab extends AbstractDialogTab<Props> {
75 94
         this._onFollowMeEnabledChanged = this._onFollowMeEnabledChanged.bind(this);
76 95
     }
77 96
 
78
-    /**
79
-     * Implements React's {@link Component#render()}.
80
-     *
81
-     * @inheritdoc
82
-     * @returns {ReactElement}
83
-     */
84
-    render() {
85
-        return <div className = 'moderator-tab box'>{ this._renderModeratorSettings() }</div>;
86
-    }
87
-
88 97
     /**
89 98
      * Callback invoked to select if conferences should start
90 99
      * with audio muted.
@@ -134,58 +143,59 @@ class ModeratorTab extends AbstractDialogTab<Props> {
134 143
     }
135 144
 
136 145
     /**
137
-     * Returns the React Element for modifying conference-wide settings.
146
+     * Implements React's {@link Component#render()}.
138 147
      *
139
-     * @private
148
+     * @inheritdoc
140 149
      * @returns {ReactElement}
141 150
      */
142
-    _renderModeratorSettings() {
151
+    render() {
143 152
         const {
153
+            classes,
144 154
             disableReactionsModeration,
145 155
             followMeActive,
146 156
             followMeEnabled,
147 157
             startAudioMuted,
148 158
             startVideoMuted,
149 159
             startReactionsMuted,
150
-            t // @ts-ignore
160
+            t
151 161
         } = this.props;
152 162
 
153 163
         return (
154 164
             <div
155
-                className = 'settings-sub-pane-element'
165
+                className = { `moderator-tab ${classes.container}` }
156 166
                 key = 'moderator'>
157
-                <div className = 'moderator-settings-wrapper'>
158
-                    <Checkbox
159
-                        checked = { startAudioMuted }
160
-                        className = 'settings-checkbox'
161
-                        label = { t('settings.startAudioMuted') }
162
-                        name = 'start-audio-muted'
163
-                        onChange = { this._onStartAudioMutedChanged } />
164
-                    <Checkbox
165
-                        checked = { startVideoMuted }
166
-                        className = 'settings-checkbox'
167
-                        label = { t('settings.startVideoMuted') }
168
-                        name = 'start-video-muted'
169
-                        onChange = { this._onStartVideoMutedChanged } />
170
-                    <Checkbox
171
-                        checked = { followMeEnabled && !followMeActive }
172
-                        className = 'settings-checkbox'
173
-                        disabled = { followMeActive }
174
-                        label = { t('settings.followMe') }
175
-                        name = 'follow-me'
176
-                        onChange = { this._onFollowMeEnabledChanged } />
177
-                    { !disableReactionsModeration
167
+                <h2 className = { classes.title }>
168
+                    {t('settings.moderatorOptions')}
169
+                </h2>
170
+                <Checkbox
171
+                    checked = { startAudioMuted }
172
+                    className = { classes.checkbox }
173
+                    label = { t('settings.startAudioMuted') }
174
+                    name = 'start-audio-muted'
175
+                    onChange = { this._onStartAudioMutedChanged } />
176
+                <Checkbox
177
+                    checked = { startVideoMuted }
178
+                    className = { classes.checkbox }
179
+                    label = { t('settings.startVideoMuted') }
180
+                    name = 'start-video-muted'
181
+                    onChange = { this._onStartVideoMutedChanged } />
182
+                <Checkbox
183
+                    checked = { followMeEnabled && !followMeActive }
184
+                    className = { classes.checkbox }
185
+                    disabled = { followMeActive }
186
+                    label = { t('settings.followMe') }
187
+                    name = 'follow-me'
188
+                    onChange = { this._onFollowMeEnabledChanged } />
189
+                { !disableReactionsModeration
178 190
                         && <Checkbox
179 191
                             checked = { startReactionsMuted }
180
-                            className = 'settings-checkbox'
192
+                            className = { classes.checkbox }
181 193
                             label = { t('settings.startReactionsMuted') }
182 194
                             name = 'start-reactions-muted'
183 195
                             onChange = { this._onStartReactionsMutedChanged } /> }
184
-                </div>
185 196
             </div>
186 197
         );
187 198
     }
188 199
 }
189 200
 
190
-// @ts-ignore
191
-export default translate(ModeratorTab);
201
+export default withStyles(styles)(translate(ModeratorTab));

+ 14
- 18
react/features/settings/components/web/SettingsDialog.tsx View File

@@ -4,7 +4,7 @@ import { withStyles } from '@mui/styles';
4 4
 import React, { Component } from 'react';
5 5
 
6 6
 import { IReduxState } from '../../../app/types';
7
-import { IconBell, IconCalendar, IconGear, IconModerator, IconUser, IconVolumeUp } from '../../../base/icons/svg';
7
+import { IconBell, IconCalendar, IconGear, IconHost, IconUser, IconVolumeUp } from '../../../base/icons/svg';
8 8
 import { connect } from '../../../base/redux/functions';
9 9
 import { withPixelLineHeight } from '../../../base/styles/functions.web';
10 10
 import DialogWithTabs, { IDialogTab } from '../../../base/ui/components/web/DialogWithTabs';
@@ -151,10 +151,6 @@ const styles = (theme: Theme) => {
151 151
                 marginBottom: theme.spacing(2)
152 152
             },
153 153
 
154
-            '& .moderator-settings-wrapper': {
155
-                paddingTop: '20px'
156
-            },
157
-
158 154
             '& .calendar-tab': {
159 155
                 alignItems: 'center',
160 156
                 flexDirection: 'column',
@@ -280,18 +276,6 @@ function _mapStateToProps(state: IReduxState, ownProps: any) {
280 276
         });
281 277
     }
282 278
 
283
-    if (showProfileSettings) {
284
-        tabs.push({
285
-            name: SETTINGS_TABS.PROFILE,
286
-            component: ProfileTab,
287
-            labelKey: 'profile.title',
288
-            props: getProfileTabProps(state),
289
-            className: `settings-pane ${classes.settingsDialog}`,
290
-            submit: submitProfileTab,
291
-            icon: IconUser
292
-        });
293
-    }
294
-
295 279
     if (showModeratorSettings) {
296 280
         tabs.push({
297 281
             name: SETTINGS_TABS.MODERATOR,
@@ -311,7 +295,19 @@ function _mapStateToProps(state: IReduxState, ownProps: any) {
311 295
             },
312 296
             className: `settings-pane ${classes.settingsDialog} moderator-pane`,
313 297
             submit: submitModeratorTab,
314
-            icon: IconModerator
298
+            icon: IconHost
299
+        });
300
+    }
301
+
302
+    if (showProfileSettings) {
303
+        tabs.push({
304
+            name: SETTINGS_TABS.PROFILE,
305
+            component: ProfileTab,
306
+            labelKey: 'profile.title',
307
+            props: getProfileTabProps(state),
308
+            className: `settings-pane ${classes.settingsDialog} profile-pane`,
309
+            submit: submitProfileTab,
310
+            icon: IconUser
315 311
         });
316 312
     }
317 313
 

Loading…
Cancel
Save