Przeglądaj źródła

feat(raise-hand) Update raised hand design (#10651)

Updated indicator color and background color
Added border on thumbnails
Web and Native
master
Robert Pintilii 3 lat temu
rodzic
commit
a7bf037363
No account linked to committer's email address

+ 2
- 2
react/features/base/icons/components/Icon.js Wyświetl plik

@@ -15,7 +15,7 @@ type Props = {
15 15
     /**
16 16
      * Color of the icon (if not provided by the style object).
17 17
      */
18
-    color?: string,
18
+    color?: ?string,
19 19
 
20 20
     /**
21 21
      * Id prop (mainly for autotests).
@@ -35,7 +35,7 @@ type Props = {
35 35
     /**
36 36
      * The size of the icon (if not provided by the style object).
37 37
      */
38
-    size?: number | string,
38
+    size?: ?number | string,
39 39
 
40 40
     /**
41 41
      * The preloaded icon component to render.

+ 1
- 1
react/features/base/icons/svg/raised-hand.svg Wyświetl plik

@@ -1,3 +1,3 @@
1
-<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
1
+<svg width="22" height="22" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
2 2
 <path fill-rule="evenodd" clip-rule="evenodd" d="M11.9167 3.20834L11.9167 4.83334L11.9167 11L11.9167 11.9167C11.9167 12.4229 12.3271 12.8333 12.8333 12.8333C13.3396 12.8333 13.75 12.4229 13.75 11.9167V11V4.83334C13.75 4.73632 13.9183 4.58334 14.2083 4.58334C14.4984 4.58334 14.6667 4.73632 14.6667 4.83334L14.6667 6.875L14.6667 11.9167C14.6667 12.4229 15.0771 12.8333 15.5833 12.8333C16.0896 12.8333 16.5 12.4229 16.5 11.9167L16.5 6.875C16.5 6.62187 16.7052 6.41667 16.9583 6.41667C17.2115 6.41667 17.4167 6.62187 17.4167 6.875V13.788C17.1671 16.3395 14.9919 18.3333 12.375 18.3333C10.6569 18.3333 9.09297 17.4675 8.17032 16.0753L8.16703 16.0762L4.67206 10.8208C4.50437 10.5805 4.55476 10.2948 4.76211 10.1496C4.96947 10.0044 5.25526 10.0548 5.40045 10.2621L6.57295 12.015L6.57177 12.0158C6.85487 12.4355 7.42461 12.5463 7.84432 12.2632C8.09767 12.0923 8.23844 11.8169 8.24797 11.5332L8.25 11.5338V5.04167C8.25 4.78854 8.4552 4.58334 8.70833 4.58334C8.96124 4.58334 9.1663 4.78818 9.16667 5.041L9.16667 5.04167L9.16667 11L9.16667 11.9167C9.16667 12.4229 9.57707 12.8333 10.0833 12.8333C10.5896 12.8333 11 12.4229 11 11.9167V11V5.04167V3.20834C11 2.95521 11.2052 2.75001 11.4583 2.75001C11.7115 2.75001 11.9167 2.95521 11.9167 3.20834ZM19.2337 13.7686L19.25 13.7605V13.2917V6.875C19.25 5.60935 18.224 4.58334 16.9583 4.58334C16.7976 4.58334 16.6408 4.59988 16.4894 4.63136C16.3776 3.57554 15.399 2.75001 14.2083 2.75001C14.0384 2.75001 13.8729 2.76681 13.7135 2.7987C13.5204 1.72851 12.5842 0.916672 11.4583 0.916672C10.3309 0.916672 9.39356 1.73088 9.20233 2.80339C9.04323 2.76843 8.87793 2.75001 8.70833 2.75001C7.44268 2.75001 6.41667 3.77602 6.41667 5.04167V8.70352C5.64445 8.11321 4.54919 8.06056 3.71056 8.64778C2.67379 9.37373 2.42183 10.8027 3.14778 11.8395L6.44893 16.7791C7.64459 18.8065 9.85095 20.1667 12.375 20.1667C16.0117 20.1667 18.9888 17.3431 19.2337 13.7686Z" />
3 3
 </svg>

+ 7
- 1
react/features/base/react/components/native/BaseIndicator.js Wyświetl plik

@@ -26,6 +26,11 @@ type Props = {
26 26
      */
27 27
     icon: string,
28 28
 
29
+    /**
30
+     * Size of icon.
31
+     */
32
+    iconSize: ?number,
33
+
29 34
     /**
30 35
      * Additional style to be applied to the icon element.
31 36
      */
@@ -43,7 +48,7 @@ export default class BaseIndicator extends Component<Props> {
43 48
      * @inheritdoc
44 49
      */
45 50
     render() {
46
-        const { highlight, icon, iconStyle, backgroundColor } = this.props;
51
+        const { highlight, icon, iconStyle, backgroundColor, iconSize } = this.props;
47 52
         const highlightedIndicator = { ...styles.highlightedIndicator };
48 53
 
49 54
         if (backgroundColor) {
@@ -55,6 +60,7 @@ export default class BaseIndicator extends Component<Props> {
55 60
                 style = { [ BASE_INDICATOR,
56 61
                     highlight ? highlightedIndicator : null ] }>
57 62
                 <Icon
63
+                    size = { iconSize }
58 64
                     src = { icon }
59 65
                     style = { [
60 66
                         styles.indicator,

+ 2
- 2
react/features/base/react/components/native/indicatorstyles.js Wyświetl plik

@@ -8,8 +8,8 @@ export default {
8 8
      */
9 9
     highlightedIndicator: {
10 10
         backgroundColor: ColorPalette.blue,
11
-        borderRadius: 16,
12
-        padding: 4
11
+        borderRadius: 4,
12
+        padding: 2
13 13
     },
14 14
 
15 15
     /**

+ 7
- 0
react/features/base/react/components/web/BaseIndicator.js Wyświetl plik

@@ -27,6 +27,11 @@ type Props = {
27 27
     */
28 28
     iconClassName: string,
29 29
 
30
+    /**
31
+     * The color of the icon.
32
+     */
33
+    iconColor: ?string,
34
+
30 35
     /**
31 36
      * Id of the icon to be rendered.
32 37
      */
@@ -81,6 +86,7 @@ const BaseIndicator = ({
81 86
     className = '',
82 87
     icon,
83 88
     iconClassName,
89
+    iconColor,
84 90
     iconId,
85 91
     iconSize,
86 92
     id = '',
@@ -105,6 +111,7 @@ const BaseIndicator = ({
105 111
                     id = { id }>
106 112
                     <Icon
107 113
                         className = { iconClassName }
114
+                        color = { iconColor }
108 115
                         id = { iconId }
109 116
                         src = { icon }
110 117
                         style = { style } />

+ 4
- 2
react/features/filmstrip/components/native/RaisedHandIndicator.js Wyświetl plik

@@ -25,9 +25,11 @@ class RaisedHandIndicator extends AbstractRaisedHandIndicator<Props> {
25 25
     _renderIndicator() {
26 26
         return (
27 27
             <BaseIndicator
28
-                backgroundColor = { BaseTheme.palette.warning01 }
28
+                backgroundColor = { BaseTheme.palette.warning02 }
29 29
                 highlight = { true }
30
-                icon = { IconRaisedHand } />
30
+                icon = { IconRaisedHand }
31
+                iconSize = { 16 }
32
+                iconStyle = {{ color: BaseTheme.palette.uiBackground }} />
31 33
         );
32 34
     }
33 35
 }

+ 11
- 2
react/features/filmstrip/components/native/Thumbnail.js Wyświetl plik

@@ -14,7 +14,8 @@ import {
14 14
     isEveryoneModerator,
15 15
     pinParticipant,
16 16
     getParticipantByIdOrUndefined,
17
-    getLocalParticipant
17
+    getLocalParticipant,
18
+    hasRaisedHand
18 19
 } from '../../../base/participants';
19 20
 import { Container } from '../../../base/react';
20 21
 import { connect } from '../../../base/redux';
@@ -84,6 +85,11 @@ type Props = {
84 85
      */
85 86
     _pinned: boolean,
86 87
 
88
+    /**
89
+     * Whether or not the participant has the hand raised.
90
+     */
91
+    _raisedHand: boolean,
92
+
87 93
     /**
88 94
      * Whether to show the dominant speaker indicator or not.
89 95
      */
@@ -267,6 +273,7 @@ class Thumbnail extends PureComponent<Props> {
267 273
             _participantId: participantId,
268 274
             _participantInLargeVideo: participantInLargeVideo,
269 275
             _pinned,
276
+            _raisedHand,
270 277
             _styles,
271 278
             disableTint,
272 279
             height,
@@ -289,7 +296,8 @@ class Thumbnail extends PureComponent<Props> {
289 296
                 style = { [
290 297
                     styles.thumbnail,
291 298
                     _pinned && !tileView ? _styles.thumbnailPinned : null,
292
-                    styleOverrides
299
+                    styleOverrides,
300
+                    _raisedHand ? styles.thumbnailRaisedHand : null
293 301
                 ] }
294 302
                 touchFeedback = { false }>
295 303
                 <ParticipantView
@@ -354,6 +362,7 @@ function _mapStateToProps(state, ownProps) {
354 362
         _participantInLargeVideo: participantInLargeVideo,
355 363
         _participantId: id,
356 364
         _pinned: participant?.pinned,
365
+        _raisedHand: hasRaisedHand(participant),
357 366
         _renderDominantSpeakerIndicator: renderDominantSpeakerIndicator,
358 367
         _renderModeratorIndicator: renderModeratorIndicator,
359 368
         _styles: ColorSchemeRegistry.get(state, 'Thumbnail'),

+ 6
- 0
react/features/filmstrip/components/native/styles.js Wyświetl plik

@@ -2,6 +2,7 @@
2 2
 
3 3
 import { ColorSchemeRegistry, schemeColor } from '../../../base/color-scheme';
4 4
 import { ColorPalette } from '../../../base/styles';
5
+import BaseTheme from '../../../base/ui/components/BaseTheme.native';
5 6
 import { SMALL_THUMBNAIL_SIZE } from '../../constants';
6 7
 
7 8
 /**
@@ -147,6 +148,11 @@ export default {
147 148
 
148 149
     thumbnailTopRightIndicatorContainer: {
149 150
         right: 0
151
+    },
152
+
153
+    thumbnailRaisedHand: {
154
+        borderWidth: 2,
155
+        borderColor: BaseTheme.palette.warning02
150 156
     }
151 157
 };
152 158
 

+ 3
- 1
react/features/filmstrip/components/web/RaisedHandIndicator.js Wyświetl plik

@@ -7,6 +7,7 @@ import { useSelector } from 'react-redux';
7 7
 import { IconRaisedHand } from '../../../base/icons';
8 8
 import { getParticipantById, hasRaisedHand } from '../../../base/participants';
9 9
 import { BaseIndicator } from '../../../base/react';
10
+import BaseTheme from '../../../base/ui/components/BaseTheme';
10 11
 
11 12
 /**
12 13
  * The type of the React {@code Component} props of {@link RaisedHandIndicator}.
@@ -33,7 +34,7 @@ type Props = {
33 34
 const useStyles = makeStyles(theme => {
34 35
     return {
35 36
         raisedHandIndicator: {
36
-            backgroundColor: theme.palette.warning01,
37
+            backgroundColor: theme.palette.warning02,
37 38
             padding: '2px',
38 39
             zIndex: 3,
39 40
             display: 'inline-block',
@@ -65,6 +66,7 @@ const RaisedHandIndicator = ({
65 66
         <div className = { styles.raisedHandIndicator }>
66 67
             <BaseIndicator
67 68
                 icon = { IconRaisedHand }
69
+                iconColor = { BaseTheme.palette.uiBackground }
68 70
                 iconSize = { `${iconSize}px` }
69 71
                 tooltipKey = 'raisedHand'
70 72
                 tooltipPosition = { tooltipPosition } />

+ 29
- 8
react/features/filmstrip/components/web/Thumbnail.js Wyświetl plik

@@ -10,6 +10,7 @@ import { isMobileBrowser } from '../../../base/environment/utils';
10 10
 import { MEDIA_TYPE, VideoTrack } from '../../../base/media';
11 11
 import {
12 12
     getParticipantByIdOrUndefined,
13
+    hasRaisedHand,
13 14
     pinParticipant
14 15
 } from '../../../base/participants';
15 16
 import { connect } from '../../../base/redux';
@@ -153,6 +154,11 @@ export type Props = {|
153 154
      */
154 155
     _participant: Object,
155 156
 
157
+    /**
158
+     * Whether or not the participant has the hand raised.
159
+     */
160
+    _raisedHand: boolean,
161
+
156 162
     /**
157 163
      * The video track that will be displayed in the thumbnail.
158 164
      */
@@ -245,14 +251,23 @@ const defaultStyles = theme => {
245 251
             backgroundColor: theme.palette.ui02
246 252
         },
247 253
 
254
+        borderIndicator: {
255
+            position: 'absolute',
256
+            width: '100%',
257
+            height: '100%',
258
+            zIndex: '9',
259
+            borderRadius: '4px'
260
+        },
261
+
248 262
         activeSpeaker: {
249 263
             '& .active-speaker-indicator': {
250
-                boxShadow: `inset 0px 0px 0px 4px ${theme.palette.link01Active} !important`,
251
-                position: 'absolute',
252
-                width: '100%',
253
-                height: '100%',
254
-                zIndex: '9',
255
-                borderRadius: '4px'
264
+                boxShadow: `inset 0px 0px 0px 4px ${theme.palette.link01Active} !important`
265
+            }
266
+        },
267
+
268
+        raisedHand: {
269
+            '& .raised-hand-border': {
270
+                boxShadow: `inset 0px 0px 0px 2px ${theme.palette.warning02} !important`
256 271
             }
257 272
         }
258 273
     };
@@ -661,11 +676,16 @@ class Thumbnail extends Component<Props, State> {
661 676
             _participant,
662 677
             _currentLayout,
663 678
             _isAnyParticipantPinned,
679
+            _raisedHand,
664 680
             classes
665 681
         } = this.props;
666 682
 
667 683
         className += ` ${DISPLAY_MODE_TO_CLASS_NAME[displayMode]}`;
668 684
 
685
+        if (_raisedHand) {
686
+            className += ` ${classes.raisedHand}`;
687
+        }
688
+
669 689
         if (_currentLayout === LAYOUTS.TILE_VIEW) {
670 690
             if (!_isDominantSpeakerDisabled && _participant?.dominantSpeaker) {
671 691
                 className += ` ${classes.activeSpeaker} dominant-speaker`;
@@ -828,7 +848,8 @@ class Thumbnail extends Component<Props, State> {
828 848
                     </div>
829 849
                 )}
830 850
                 <ThumbnailAudioIndicator _audioTrack = { _audioTrack } />
831
-                <div className = 'active-speaker-indicator' />
851
+                <div className = { clsx(classes.borderIndicator, 'raised-hand-border') } />
852
+                <div className = { clsx(classes.borderIndicator, 'active-speaker-indicator') } />
832 853
             </span>
833 854
         );
834 855
     }
@@ -892,7 +913,6 @@ function _mapStateToProps(state, ownProps): Object {
892 913
     const { localFlipX } = state['features/base/settings'];
893 914
     const _isMobile = isMobileBrowser();
894 915
 
895
-
896 916
     switch (_currentLayout) {
897 917
     case LAYOUTS.VERTICAL_FILMSTRIP_VIEW:
898 918
     case LAYOUTS.HORIZONTAL_FILMSTRIP_VIEW: {
@@ -948,6 +968,7 @@ function _mapStateToProps(state, ownProps): Object {
948 968
         _isVideoPlayable: id && isVideoPlayable(state, id),
949 969
         _localFlipX: Boolean(localFlipX),
950 970
         _participant: participant,
971
+        _raisedHand: hasRaisedHand(participant),
951 972
         _videoTrack,
952 973
         ...size
953 974
     };

+ 1
- 1
react/features/participants-pane/components/native/RaisedHandIndicator.js Wyświetl plik

@@ -8,7 +8,7 @@ import styles from './styles';
8 8
 export const RaisedHandIndicator = () => (
9 9
     <View style = { styles.raisedHandIndicator }>
10 10
         <Icon
11
-            size = { 15 }
11
+            size = { 16 }
12 12
             src = { IconRaisedHandHollow }
13 13
             style = { styles.raisedHandIcon } />
14 14
     </View>

+ 2
- 1
react/features/participants-pane/components/native/styles.js Wyświetl plik

@@ -195,7 +195,8 @@ export default {
195 195
 
196 196
     raisedHandIcon: {
197 197
         ...flexContent,
198
-        top: BaseTheme.spacing[1]
198
+        top: BaseTheme.spacing[1],
199
+        color: BaseTheme.palette.uiBackground
199 200
     },
200 201
 
201 202
     lobbyListContainer: {

+ 4
- 2
react/features/participants-pane/components/web/RaisedHandIndicator.js Wyświetl plik

@@ -4,11 +4,12 @@ import { makeStyles } from '@material-ui/styles';
4 4
 import React from 'react';
5 5
 
6 6
 import { Icon, IconRaisedHandHollow } from '../../../base/icons';
7
+import BaseTheme from '../../../base/ui/components/BaseTheme';
7 8
 
8 9
 const useStyles = makeStyles(theme => {
9 10
     return {
10 11
         indicator: {
11
-            backgroundColor: theme.palette.warning01,
12
+            backgroundColor: theme.palette.warning02,
12 13
             borderRadius: `${theme.shape.borderRadius / 2}px`,
13 14
             height: '24px',
14 15
             width: '24px'
@@ -22,7 +23,8 @@ export const RaisedHandIndicator = () => {
22 23
     return (
23 24
         <div className = { styles.indicator }>
24 25
             <Icon
25
-                size = { 15 }
26
+                color = { BaseTheme.palette.uiBackground }
27
+                size = { 16 }
26 28
                 src = { IconRaisedHandHollow } />
27 29
         </div>
28 30
     );

Ładowanie…
Anuluj
Zapisz