Browse Source

fix(prejoin_page) Add labels for video & more UI fixes

master
Vlad Piersec 4 years ago
parent
commit
c05ca1d9fc

+ 0
- 16
css/_atlaskit_overrides.scss View File

@@ -48,19 +48,3 @@
48 48
 .toolbox-button-wth-dialog .eYJELv {
49 49
     max-height: initial;
50 50
 }
51
-
52
-/**
53
- * Override @atlaskit/InlineDialog styling for the video preview
54
- */
55
-.video-preview .eYJELv {
56
-    outline: none;
57
-    padding: 16px;
58
-}
59
-
60
-/**
61
- * Override @atlaskit/InlineDialog styling for the audio preview
62
- */
63
-.audio-preview .eYJELv {
64
-    outline: none;
65
-    padding: 0;
66
-}

+ 6
- 0
css/_audio-preview.css View File

@@ -121,4 +121,10 @@
121 121
         right: 16px;
122 122
         top: 18px;
123 123
     }
124
+
125
+   // Override @atlaskit/InlineDialog container which is made with styled components
126
+    & > div > div:nth-child(2) > div > div {
127
+        outline: none;
128
+        padding: 0;
129
+    }
124 130
 }

+ 3
- 6
css/_meter.css View File

@@ -3,21 +3,21 @@
3 3
         display: inline-block;
4 4
 
5 5
         & > svg {
6
-            fill: #76CF9C;
6
+            fill: #4E5E6C;
7 7
             width: 38px;
8 8
         }
9 9
     }
10 10
 
11 11
     &.metr--disabled {
12 12
         & > svg {
13
-            fill: #5E6D7A;
13
+            fill: #4E5E6C;
14 14
         }
15 15
     }
16 16
 }
17 17
 
18 18
 .metr-l-0 {
19 19
     rect:first-child {
20
-        fill: #279255;
20
+        fill: #31B76A;
21 21
     }
22 22
 }
23 23
 
@@ -26,8 +26,5 @@
26 26
         rect:nth-child(-n+#{$i+1}) {
27 27
             fill: #31B76A;
28 28
         }
29
-        rect:first-child {
30
-            fill: #279255;
31
-        }
32 29
     }
33 30
 }

+ 12
- 9
css/_settings-button.scss View File

@@ -50,15 +50,11 @@
50 50
         bottom: 0;
51 51
         box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.25);
52 52
         cursor: pointer;
53
-        height: 18px;
53
+        height: 16px;
54 54
         position: absolute;
55 55
         text-align: center;
56
-        right: 2px;
57
-        width: 18px;
58
-
59
-        &:hover {
60
-            background-color: #daebfa;
61
-        }
56
+        right: 4px;
57
+        width: 16px;
62 58
 
63 59
         &> svg {
64 60
             margin-top: 5px;
@@ -67,9 +63,16 @@
67 63
         &--disabled {
68 64
             background-color: #a4b8d1;
69 65
             cursor: default;
66
+        }
70 67
 
71
-            &:hover {
72
-                background-color: #a4b8d1;
68
+        &--hovered {
69
+            bottom: -1px;
70
+            height: 20px;
71
+            right: 2px;
72
+            width: 20px;
73
+
74
+            &> svg {
75
+                margin-top: 6px;
73 76
             }
74 77
         }
75 78
     }

+ 22
- 0
css/_video-preview.css View File

@@ -1,4 +1,7 @@
1 1
 .video-preview {
2
+    max-height: 290px;
3
+    overflow: auto;
4
+
2 5
     &-entry {
3 6
         cursor: pointer;
4 7
         height: 135px;
@@ -40,4 +43,23 @@
40 43
         position: absolute;
41 44
         width: 100%;
42 45
     }
46
+
47
+    &-label {
48
+        color: #fff;
49
+        font-size: 13px;
50
+        line-height: 20px;
51
+        overflow: hidden;
52
+        padding: 8px;
53
+        position: absolute;
54
+        text-align: center;
55
+        text-overflow: ellipsis;
56
+        width: 220px;
57
+        z-index: 2;
58
+    }
59
+
60
+    // Override @atlaskit/InlineDialog container which is made with styled components
61
+    & > div > div:nth-child(2) > div > div {
62
+        outline: none;
63
+        padding: 16px;
64
+    }
43 65
 }

+ 1
- 0
lang/main.json View File

@@ -525,6 +525,7 @@
525 525
         "followMe": "Everyone follows me",
526 526
         "language": "Language",
527 527
         "loggedIn": "Logged in as {{name}}",
528
+        "microphones": "Microphones",
528 529
         "moderator": "Moderator",
529 530
         "more": "More",
530 531
         "name": "Name",

+ 98
- 27
react/features/base/toolbox/components/ToolboxButtonWithIcon.js View File

@@ -1,6 +1,6 @@
1 1
 // @flow
2 2
 
3
-import React from 'react';
3
+import React, { Component } from 'react';
4 4
 import { Icon } from '../../icons';
5 5
 
6 6
 type Props = {
@@ -29,38 +29,109 @@ type Props = {
29 29
      * Additional styles.
30 30
      */
31 31
     styles?: Object,
32
-}
32
+};
33
+
34
+type State = {
35
+
36
+    /**
37
+     * Whether the button is hovered or not.
38
+     */
39
+    isHovered: boolean,
40
+};
33 41
 
34 42
 /**
35 43
  * Displayes the `ToolboxButtonWithIcon` component.
36 44
  *
37 45
  * @returns {ReactElement}
38 46
  */
39
-export default function ToolboxButtonWithIcon({
40
-    children,
41
-    icon,
42
-    iconDisabled,
43
-    onIconClick,
44
-    styles
45
-}: Props) {
46
-    const iconProps = {};
47
-
48
-    if (iconDisabled) {
49
-        iconProps.className = 'settings-button-small-icon settings-button-small-icon--disabled';
50
-    } else {
51
-        iconProps.className = 'settings-button-small-icon';
52
-        iconProps.onClick = onIconClick;
47
+export default class ToolboxButtonWithIcon extends Component<Props, State> {
48
+
49
+    /**
50
+     * Initializes a new {@code ToolboxButtonWithIcon} instance.
51
+     *
52
+     * @param {Props} props - The props of the component.
53
+     */
54
+    constructor(props: Props) {
55
+        super(props);
56
+
57
+        this.state = {
58
+            isHovered: false
59
+        };
60
+        this._onMouseEnter = this._onMouseEnter.bind(this);
61
+        this._onMouseLeave = this._onMouseLeave.bind(this);
62
+    }
63
+
64
+    _onMouseEnter: () => void;
65
+
66
+    /**
67
+     * Handler for when the small button has the mouse over.
68
+     *
69
+     * @returns {void}.
70
+     */
71
+    _onMouseEnter() {
72
+        this.setState({
73
+            isHovered: true
74
+        });
53 75
     }
54 76
 
55
-    return (
56
-        <div
57
-            className = 'settings-button-container'
58
-            styles = { styles }>
59
-            { children }
60
-            <Icon
61
-                { ...iconProps }
62
-                size = { 9 }
63
-                src = { icon } />
64
-        </div>
65
-    );
77
+    _onMouseLeave: () => void;
78
+
79
+    /**
80
+     * Handler for when the mouse leaves the small button.
81
+     *
82
+     * @returns {void}
83
+     */
84
+    _onMouseLeave() {
85
+        this.setState({
86
+            isHovered: false
87
+        });
88
+    }
89
+
90
+    /**
91
+     * Implements React's {@link Component#render()}.
92
+     *
93
+     * @inheritdoc
94
+     * @returns {React$Node}
95
+     */
96
+    render() {
97
+        const {
98
+            children,
99
+            icon,
100
+            iconDisabled,
101
+            onIconClick,
102
+            styles
103
+        } = this.props;
104
+
105
+        const iconProps = {};
106
+        let size = 9;
107
+
108
+        if (iconDisabled) {
109
+            iconProps.className
110
+                = 'settings-button-small-icon settings-button-small-icon--disabled';
111
+        } else {
112
+            iconProps.className = 'settings-button-small-icon';
113
+            iconProps.onClick = onIconClick;
114
+
115
+            if (this.state.isHovered) {
116
+                iconProps.className = `${iconProps.className} settings-button-small-icon--hovered`;
117
+                size = 11;
118
+            }
119
+        }
120
+
121
+        return (
122
+            <div
123
+                className = 'settings-button-container'
124
+                styles = { styles }>
125
+                {children}
126
+                <div
127
+                    onMouseEnter = { this._onMouseEnter }
128
+                    onMouseLeave = { this._onMouseLeave }>
129
+                    <Icon
130
+                        { ...iconProps }
131
+                        size = { size }
132
+                        src = { icon } />
133
+                </div>
134
+            </div>
135
+        );
136
+    }
66 137
 }

+ 1
- 3
react/features/settings/components/web/SettingsDialog.js View File

@@ -127,11 +127,9 @@ class SettingsDialog extends Component<Props> {
127 127
 function _mapStateToProps(state) {
128 128
     const configuredTabs = interfaceConfig.SETTINGS_SECTIONS || [];
129 129
     const jwt = state['features/base/jwt'];
130
-    const { prejoinPageEnabled } = state['features/base/config'];
131 130
 
132 131
     // The settings sections to display.
133
-    const showDeviceSettings = !prejoinPageEnabled
134
-          && configuredTabs.includes('devices');
132
+    const showDeviceSettings = configuredTabs.includes('devices');
135 133
     const moreTabProps = getMoreTabProps(state);
136 134
     const { showModeratorSettings, showLanguageSettings } = moreTabProps;
137 135
     const showProfileSettings

+ 1
- 1
react/features/settings/components/web/audio/AudioSettingsContent.js View File

@@ -243,7 +243,7 @@ class AudioSettingsContent extends Component<Props, State> {
243 243
                 <div className = 'audio-preview-content'>
244 244
                     <AudioSettingsHeader
245 245
                         IconComponent = { IconMicrophoneEmpty }
246
-                        text = { t('settings.selectMic') } />
246
+                        text = { t('settings.microphones') } />
247 247
                     {microphoneDevices.map((data, i) =>
248 248
                         this._renderMicrophoneEntry(data, i),
249 249
                     )}

+ 3
- 1
react/features/settings/components/web/video/VideoSettingsContent.js View File

@@ -153,6 +153,7 @@ class VideoSettingsContent extends Component<Props, State> {
153 153
             className,
154 154
             key
155 155
         };
156
+        const label = jitsiTrack && jitsiTrack.getTrackLabel();
156 157
 
157 158
         if (isSelected) {
158 159
             props.className = `${className} video-preview-entry--selected`;
@@ -162,6 +163,7 @@ class VideoSettingsContent extends Component<Props, State> {
162 163
 
163 164
         return (
164 165
             <div { ...props }>
166
+                <div className = 'video-preview-label'>{label}</div>
165 167
                 <div className = 'video-preview-overlay' />
166 168
                 <Video
167 169
                     className = { videoClassName }
@@ -209,7 +211,7 @@ class VideoSettingsContent extends Component<Props, State> {
209 211
         const { trackData } = this.state;
210 212
 
211 213
         return (
212
-            <div>
214
+            <div className = 'video-preview'>
213 215
                 {trackData.map((data, i) => this._renderPreviewEntry(data, i))}
214 216
             </div>
215 217
         );

Loading…
Cancel
Save