瀏覽代碼

feat: use participant id for avatar color

master
Bettenbuk Zoltan 6 年之前
父節點
當前提交
74d0013acc

+ 6
- 0
android/app/.classpath 查看文件

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<classpath>
3
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
4
+	<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
5
+	<classpathentry kind="output" path="bin/default"/>
6
+</classpath>

+ 2
- 0
android/app/.settings/org.eclipse.buildship.core.prefs 查看文件

1
+connection.project.dir=..
2
+eclipse.preferences.version=1

+ 6
- 0
android/sdk/.classpath 查看文件

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<classpath>
3
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
4
+	<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
5
+	<classpathentry kind="output" path="bin/default"/>
6
+</classpath>

+ 2
- 0
android/sdk/.settings/org.eclipse.buildship.core.prefs 查看文件

1
+connection.project.dir=..
2
+eclipse.preferences.version=1

+ 7
- 3
react/features/always-on-top/AlwaysOnTop.js 查看文件

5
 // We need to reference these files directly to avoid loading things that are not available
5
 // We need to reference these files directly to avoid loading things that are not available
6
 // in this environment (e.g. JitsiMeetJS or interfaceConfig)
6
 // in this environment (e.g. JitsiMeetJS or interfaceConfig)
7
 import StatelessAvatar from '../base/avatar/components/web/StatelessAvatar';
7
 import StatelessAvatar from '../base/avatar/components/web/StatelessAvatar';
8
-import { getInitials } from '../base/avatar/functions';
8
+import { getAvatarColor, getInitials } from '../base/avatar/functions';
9
 
9
 
10
 import Toolbar from './Toolbar';
10
 import Toolbar from './Toolbar';
11
 
11
 
24
     displayName: string,
24
     displayName: string,
25
     formattedDisplayName: string,
25
     formattedDisplayName: string,
26
     isVideoDisplayed: boolean,
26
     isVideoDisplayed: boolean,
27
+    userID: string,
27
     visible: boolean
28
     visible: boolean
28
 };
29
 };
29
 
30
 
50
             displayName: '',
51
             displayName: '',
51
             formattedDisplayName: '',
52
             formattedDisplayName: '',
52
             isVideoDisplayed: true,
53
             isVideoDisplayed: true,
54
+            userID: '',
53
             visible: true
55
             visible: true
54
         };
56
         };
55
 
57
 
132
             avatarURL,
134
             avatarURL,
133
             displayName,
135
             displayName,
134
             formattedDisplayName,
136
             formattedDisplayName,
135
-            isVideoDisplayed
137
+            isVideoDisplayed,
138
+            userID
136
         });
139
         });
137
     }
140
     }
138
 
141
 
175
      * @returns {ReactElement}
178
      * @returns {ReactElement}
176
      */
179
      */
177
     _renderVideoNotAvailableScreen() {
180
     _renderVideoNotAvailableScreen() {
178
-        const { avatarURL, displayName, formattedDisplayName, isVideoDisplayed } = this.state;
181
+        const { avatarURL, displayName, formattedDisplayName, isVideoDisplayed, userID } = this.state;
179
 
182
 
180
         if (isVideoDisplayed) {
183
         if (isVideoDisplayed) {
181
             return null;
184
             return null;
185
             <div id = 'videoNotAvailableScreen'>
188
             <div id = 'videoNotAvailableScreen'>
186
                 <div id = 'avatarContainer'>
189
                 <div id = 'avatarContainer'>
187
                     <StatelessAvatar
190
                     <StatelessAvatar
191
+                        color = { getAvatarColor(userID) }
188
                         id = 'avatar'
192
                         id = 'avatar'
189
                         initials = { getInitials(displayName) }
193
                         initials = { getInitials(displayName) }
190
                         url = { avatarURL } />)
194
                         url = { avatarURL } />)

+ 3
- 2
react/features/base/avatar/components/Avatar.js 查看文件

175
  * @returns {Props}
175
  * @returns {Props}
176
  */
176
  */
177
 export function _mapStateToProps(state: Object, ownProps: Props) {
177
 export function _mapStateToProps(state: Object, ownProps: Props) {
178
-    const { displayName, participantId } = ownProps;
178
+    const { colorBase, displayName, participantId } = ownProps;
179
     const _participant = participantId && getParticipantById(state, participantId);
179
     const _participant = participantId && getParticipantById(state, participantId);
180
     const _initialsBase = (_participant && _participant.name) || displayName;
180
     const _initialsBase = (_participant && _participant.name) || displayName;
181
 
181
 
182
     return {
182
     return {
183
         _initialsBase,
183
         _initialsBase,
184
-        _loadableAvatarUrl: _participant && _participant.loadableAvatarUrl
184
+        _loadableAvatarUrl: _participant && _participant.loadableAvatarUrl,
185
+        colorBase: !colorBase && _participant ? _participant.id : colorBase
185
     };
186
     };
186
 }
187
 }
187
 
188
 

Loading…
取消
儲存