浏览代码

[RN] Add avatar to remote video menu

master
Bettenbuk Zoltan 6 年前
父节点
当前提交
2ea5f3c1aa

+ 23
- 3
react/features/remote-video-menu/components/native/RemoteVideoMenu.js 查看文件

@@ -8,7 +8,11 @@ import {
8 8
     BottomSheet,
9 9
     bottomSheetItemStylesCombined
10 10
 } from '../../../base/dialog';
11
-import { getParticipantDisplayName } from '../../../base/participants';
11
+import {
12
+    Avatar,
13
+    getAvatarURL,
14
+    getParticipantDisplayName
15
+} from '../../../base/participants';
12 16
 
13 17
 import { hideRemoteVideoMenu } from '../../actions';
14 18
 
@@ -16,6 +20,11 @@ import KickButton from './KickButton';
16 20
 import MuteButton from './MuteButton';
17 21
 import styles from './styles';
18 22
 
23
+/**
24
+ * Size of the rendered avatar in the menu.
25
+ */
26
+const AVATAR_SIZE = 25;
27
+
19 28
 type Props = {
20 29
 
21 30
     /**
@@ -28,6 +37,11 @@ type Props = {
28 37
      */
29 38
     participant: Object,
30 39
 
40
+    /**
41
+     * URL of the avatar of the participant.
42
+     */
43
+    _avatarURL: string,
44
+
31 45
     /**
32 46
      * Display name of the participant retreived from Redux.
33 47
      */
@@ -65,6 +79,9 @@ class RemoteVideoMenu extends Component<Props> {
65 79
         return (
66 80
             <BottomSheet onCancel = { this._onCancel }>
67 81
                 <View style = { styles.participantNameContainer }>
82
+                    <Avatar
83
+                        size = { AVATAR_SIZE }
84
+                        uri = { this.props._avatarURL } />
68 85
                     <Text style = { styles.participantNameLabel }>
69 86
                         { this.props._participantDisplayName }
70 87
                     </Text>
@@ -95,14 +112,17 @@ class RemoteVideoMenu extends Component<Props> {
95 112
  * @param {Object} ownProps - Properties of component.
96 113
  * @private
97 114
  * @returns {{
115
+ *      _avatarURL: string,
98 116
  *      _participantDisplayName: string
99 117
  *  }}
100 118
  */
101 119
 function _mapStateToProps(state, ownProps) {
102
-    const { id } = ownProps.participant;
120
+    const { participant } = ownProps;
103 121
 
104 122
     return {
105
-        _participantDisplayName: getParticipantDisplayName(state, id)
123
+        _avatarURL: getAvatarURL(participant),
124
+        _participantDisplayName: getParticipantDisplayName(
125
+            state, participant.id)
106 126
     };
107 127
 }
108 128
 

+ 1
- 0
react/features/remote-video-menu/components/native/styles.js 查看文件

@@ -15,6 +15,7 @@ export default createStyleSheet({
15 15
         color: ColorPalette.lightGrey,
16 16
         flexShrink: 1,
17 17
         fontSize: 16,
18
+        marginLeft: 16,
18 19
         opacity: 0.90
19 20
     }
20 21
 });

正在加载...
取消
保存