Browse Source

fix(recording-dialog) Fix broken dialog content (#12490)

factor2
Robert Pintilii 3 years ago
parent
commit
7a3b8d6ac4
No account linked to committer's email address

+ 4
- 2
react/features/base/ui/components/web/Switch.tsx View File

@@ -7,6 +7,8 @@ import { ISwitchProps } from '../types';
7 7
 
8 8
 interface IProps extends ISwitchProps {
9 9
 
10
+    className?: string;
11
+
10 12
     /**
11 13
      * Id of the toggle.
12 14
      */
@@ -78,7 +80,7 @@ const useStyles = makeStyles()((theme: Theme) => {
78 80
     };
79 81
 });
80 82
 
81
-const Switch = ({ id, checked, disabled, onChange }: IProps) => {
83
+const Switch = ({ className, id, checked, disabled, onChange }: IProps) => {
82 84
     const { classes: styles, cx } = useStyles();
83 85
     const isMobile = isMobileBrowser();
84 86
 
@@ -89,7 +91,7 @@ const Switch = ({ id, checked, disabled, onChange }: IProps) => {
89 91
     return (
90 92
         <label
91 93
             className = { cx('toggle-container', styles.container, checked && styles.containerOn,
92
-                isMobile && 'is-mobile', disabled && 'disabled') }>
94
+                isMobile && 'is-mobile', disabled && 'disabled', className) }>
93 95
             <input
94 96
                 type = 'checkbox'
95 97
                 { ...(id ? { id } : {}) }

+ 1
- 1
react/features/recording/components/Recording/AbstractStartRecordingDialogContent.tsx View File

@@ -113,7 +113,7 @@ export interface IProps extends WithTranslation {
113 113
     /**
114 114
      * Callback to change the local recording only self setting.
115 115
      */
116
-    onLocalRecordingSelfChange: Function;
116
+    onLocalRecordingSelfChange: () => void;
117 117
 
118 118
     /**
119 119
      * Callback to be invoked on sharing setting change.

+ 0
- 3
react/features/recording/components/Recording/styles.web.js View File

@@ -1,6 +1,5 @@
1 1
 // XXX CSS is used on Web, JavaScript styles are use only for mobile. Export an
2 2
 // (empty) object so that styles[*] statements on Web don't trigger errors.
3
-import BaseTheme from '../../../base/ui/components/BaseTheme';
4 3
 
5 4
 export default {};
6 5
 
@@ -13,5 +12,3 @@ export const ICON_CLOUD = 'images/icon-cloud.png';
13 12
 export const ICON_INFO = 'images/icon-info.png';
14 13
 
15 14
 export const ICON_USERS = 'images/icon-users.png';
16
-
17
-export const TRACK_COLOR = BaseTheme.palette.ui15;

+ 14
- 20
react/features/recording/components/Recording/web/StartRecordingDialogContent.tsx View File

@@ -6,12 +6,12 @@ import {
6 6
     Container,
7 7
     Image,
8 8
     LoadingIndicator,
9
-    Switch,
10 9
     Text
11 10
     // @ts-ignore
12 11
 } from '../../../../base/react';
13 12
 import { connect } from '../../../../base/redux/functions';
14 13
 import Button from '../../../../base/ui/components/web/Button';
14
+import Switch from '../../../../base/ui/components/web/Switch';
15 15
 import { BUTTON_TYPES } from '../../../../base/ui/constants';
16 16
 import { RECORDING_TYPES } from '../../../constants';
17 17
 // @ts-ignore
@@ -25,8 +25,7 @@ import {
25 25
     ICON_CLOUD,
26 26
     ICON_INFO,
27 27
     ICON_USERS,
28
-    LOCAL_RECORDING,
29
-    TRACK_COLOR
28
+    LOCAL_RECORDING
30 29
     // @ts-ignore
31 30
 } from '../styles.web';
32 31
 
@@ -76,11 +75,10 @@ class StartRecordingDialogContent extends AbstractStartRecordingDialogContent<IP
76 75
             = integrationsEnabled || _localRecordingAvailable
77 76
                 ? (
78 77
                     <Switch
78
+                        checked = { selectedRecordingService === RECORDING_TYPES.JITSI_REC_SERVICE }
79 79
                         className = 'recording-switch'
80 80
                         disabled = { isValidating }
81
-                        onValueChange = { this._onRecordingServiceSwitchChange }
82
-                        trackColor = {{ false: TRACK_COLOR }}
83
-                        value = { selectedRecordingService === RECORDING_TYPES.JITSI_REC_SERVICE } />
81
+                        onChange = { this._onRecordingServiceSwitchChange } />
84 82
                 ) : null;
85 83
 
86 84
         const label = isVpaas ? t('recording.serviceDescriptionCloud') : t('recording.serviceDescription');
@@ -141,11 +139,10 @@ class StartRecordingDialogContent extends AbstractStartRecordingDialogContent<IP
141 139
                     { t('recording.fileSharingdescription') }
142 140
                 </Text>
143 141
                 <Switch
142
+                    checked = { sharingSetting }
144 143
                     className = 'recording-switch'
145 144
                     disabled = { isValidating }
146
-                    onValueChange = { onSharingSettingChanged }
147
-                    trackColor = {{ false: TRACK_COLOR }}
148
-                    value = { sharingSetting } />
145
+                    onChange = { onSharingSettingChanged } />
149 146
             </Container>
150 147
         );
151 148
     }
@@ -282,12 +279,11 @@ class StartRecordingDialogContent extends AbstractStartRecordingDialogContent<IP
282 279
         if (fileRecordingsServiceEnabled || _localRecordingAvailable) {
283 280
             switchContent = (
284 281
                 <Switch
282
+                    checked = { selectedRecordingService
283
+                        === RECORDING_TYPES.DROPBOX }
285 284
                     className = 'recording-switch'
286 285
                     disabled = { isValidating }
287
-                    onValueChange = { this._onDropboxSwitchChange }
288
-                    trackColor = {{ false: TRACK_COLOR }}
289
-                    value = { selectedRecordingService
290
-                        === RECORDING_TYPES.DROPBOX } />
286
+                    onChange = { this._onDropboxSwitchChange } />
291 287
             );
292 288
         }
293 289
 
@@ -351,12 +347,11 @@ class StartRecordingDialogContent extends AbstractStartRecordingDialogContent<IP
351 347
                             { t('recording.saveLocalRecording') }
352 348
                         </Text>
353 349
                         <Switch
350
+                            checked = { selectedRecordingService
351
+                                === RECORDING_TYPES.LOCAL }
354 352
                             className = 'recording-switch'
355 353
                             disabled = { isValidating }
356
-                            onValueChange = { this._onLocalRecordingSwitchChange }
357
-                            trackColor = {{ false: TRACK_COLOR }}
358
-                            value = { selectedRecordingService
359
-                                === RECORDING_TYPES.LOCAL } />
354
+                            onChange = { this._onLocalRecordingSwitchChange } />
360 355
                     </Container>
361 356
                 </Container>
362 357
                 {selectedRecordingService === RECORDING_TYPES.LOCAL && (
@@ -373,11 +368,10 @@ class StartRecordingDialogContent extends AbstractStartRecordingDialogContent<IP
373 368
                                         {t('recording.onlyRecordSelf')}
374 369
                                     </Text>
375 370
                                     <Switch
371
+                                        checked = { localRecordingOnlySelf }
376 372
                                         className = 'recording-switch'
377 373
                                         disabled = { isValidating }
378
-                                        onValueChange = { onLocalRecordingSelfChange }
379
-                                        trackColor = {{ false: TRACK_COLOR }}
380
-                                        value = { localRecordingOnlySelf } />
374
+                                        onChange = { onLocalRecordingSelfChange } />
381 375
                                 </Container>
382 376
                             </Container>
383 377
                         )}

Loading…
Cancel
Save