|
@@ -1,6 +1,6 @@
|
1
|
1
|
// @flow
|
2
|
2
|
|
3
|
|
-import React, { Component } from 'react';
|
|
3
|
+import React, { PureComponent } from 'react';
|
4
|
4
|
import { Text, View } from 'react-native';
|
5
|
5
|
|
6
|
6
|
import { Avatar } from '../../../base/avatar';
|
|
@@ -68,7 +68,7 @@ let RemoteVideoMenu_;
|
68
|
68
|
/**
|
69
|
69
|
* Class to implement a popup menu that opens upon long pressing a thumbnail.
|
70
|
70
|
*/
|
71
|
|
-class RemoteVideoMenu extends Component<Props> {
|
|
71
|
+class RemoteVideoMenu extends PureComponent<Props> {
|
72
|
72
|
/**
|
73
|
73
|
* Constructor of the component.
|
74
|
74
|
*
|
|
@@ -78,6 +78,7 @@ class RemoteVideoMenu extends Component<Props> {
|
78
|
78
|
super(props);
|
79
|
79
|
|
80
|
80
|
this._onCancel = this._onCancel.bind(this);
|
|
81
|
+ this._renderMenuHeader = this._renderMenuHeader.bind(this);
|
81
|
82
|
}
|
82
|
83
|
|
83
|
84
|
/**
|
|
@@ -94,32 +95,15 @@ class RemoteVideoMenu extends Component<Props> {
|
94
|
95
|
styles: this.props._bottomSheetStyles.buttons
|
95
|
96
|
};
|
96
|
97
|
|
97
|
|
- const buttons = [];
|
98
|
|
-
|
99
|
|
- if (!_disableRemoteMute) {
|
100
|
|
- buttons.push(<MuteButton { ...buttonProps } />);
|
101
|
|
- }
|
102
|
|
-
|
103
|
|
- buttons.push(<GrantModeratorButton { ...buttonProps } />);
|
104
|
|
-
|
105
|
|
- if (!_disableKick) {
|
106
|
|
- buttons.push(<KickButton { ...buttonProps } />);
|
107
|
|
- }
|
108
|
|
-
|
109
|
|
- buttons.push(<PinButton { ...buttonProps } />);
|
110
|
|
- buttons.push(<PrivateMessageButton { ...buttonProps } />);
|
111
|
|
-
|
112
|
98
|
return (
|
113
|
|
- <BottomSheet onCancel = { this._onCancel }>
|
114
|
|
- <View style = { styles.participantNameContainer }>
|
115
|
|
- <Avatar
|
116
|
|
- participantId = { participant.id }
|
117
|
|
- size = { AVATAR_SIZE } />
|
118
|
|
- <Text style = { styles.participantNameLabel }>
|
119
|
|
- { this.props._participantDisplayName }
|
120
|
|
- </Text>
|
121
|
|
- </View>
|
122
|
|
- { buttons }
|
|
99
|
+ <BottomSheet
|
|
100
|
+ onCancel = { this._onCancel }
|
|
101
|
+ renderHeader = { this._renderMenuHeader }>
|
|
102
|
+ { !_disableRemoteMute && <MuteButton { ...buttonProps } /> }
|
|
103
|
+ { !_disableKick && <KickButton { ...buttonProps } /> }
|
|
104
|
+ <GrantModeratorButton { ...buttonProps } />
|
|
105
|
+ <PinButton { ...buttonProps } />
|
|
106
|
+ <PrivateMessageButton { ...buttonProps } />
|
123
|
107
|
</BottomSheet>
|
124
|
108
|
);
|
125
|
109
|
}
|
|
@@ -141,6 +125,31 @@ class RemoteVideoMenu extends Component<Props> {
|
141
|
125
|
|
142
|
126
|
return false;
|
143
|
127
|
}
|
|
128
|
+
|
|
129
|
+ _renderMenuHeader: () => React$Element<any>;
|
|
130
|
+
|
|
131
|
+ /**
|
|
132
|
+ * Function to render the menu's header.
|
|
133
|
+ *
|
|
134
|
+ * @returns {React$Element}
|
|
135
|
+ */
|
|
136
|
+ _renderMenuHeader() {
|
|
137
|
+ const { _bottomSheetStyles, participant } = this.props;
|
|
138
|
+
|
|
139
|
+ return (
|
|
140
|
+ <View
|
|
141
|
+ style = { [
|
|
142
|
+ _bottomSheetStyles.sheet,
|
|
143
|
+ styles.participantNameContainer ] }>
|
|
144
|
+ <Avatar
|
|
145
|
+ participantId = { participant.id }
|
|
146
|
+ size = { AVATAR_SIZE } />
|
|
147
|
+ <Text style = { styles.participantNameLabel }>
|
|
148
|
+ { this.props._participantDisplayName }
|
|
149
|
+ </Text>
|
|
150
|
+ </View>
|
|
151
|
+ );
|
|
152
|
+ }
|
144
|
153
|
}
|
145
|
154
|
|
146
|
155
|
/**
|