Przeglądaj źródła

feat(native-participants-pane) implemented review remarks pt. 3

master
Calin Chitu 3 lat temu
rodzic
commit
665b7730ee

+ 2
- 0
lang/main.json Wyświetl plik

@@ -601,7 +601,9 @@
601 601
             "blockEveryoneMicCamera": "Block everyone's mic and camera",
602 602
             "invite": "Invite Someone",
603 603
             "askUnmute": "Ask to unmute",
604
+            "mute": "Mute",
604 605
             "muteAll": "Mute all",
606
+            "muteEveryoneElse": "Mute everyone else",
605 607
             "startModeration": "Unmute themselves or start video",
606 608
             "stopEveryonesVideo": "Stop everyone's video",
607 609
             "stopVideo": "Stop video",

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

@@ -56,7 +56,7 @@ class HeaderWithNavigation extends Component<Props> {
56 56
         const { hideHeaderWithNavigation, onPressBack, onPressForward } = this.props;
57 57
 
58 58
         return (
59
-            !{ hideHeaderWithNavigation }
59
+            !hideHeaderWithNavigation
60 60
                     && <Header>
61 61
                         { onPressBack && <BackButton onPress = { onPressBack } /> }
62 62
                         <HeaderLabel labelKey = { this.props.headerLabelKey } />

+ 4
- 4
react/features/participants-pane/components/native/ContextMenuLobbyParticipantReject.js Wyświetl plik

@@ -35,12 +35,12 @@ export const ContextMenuLobbyParticipantReject = ({ participant: p }: Props) =>
35 35
             onCancel = { cancel }
36 36
             style = { styles.contextMenuMore }>
37 37
             <View
38
-                style = { styles.contextMenuItemSection }>
38
+                style = { styles.contextMenuItemSectionAvatar }>
39 39
                 <Avatar
40 40
                     className = 'participant-avatar'
41 41
                     participantId = { p.id }
42
-                    size = { 20 } />
43
-                <View style = { styles.contextMenuItemText }>
42
+                    size = { 30 } />
43
+                <View style = { styles.contextMenuItemAvatarText }>
44 44
                     <Text style = { styles.contextMenuItemName }>
45 45
                         { displayName }
46 46
                     </Text>
@@ -51,7 +51,7 @@ export const ContextMenuLobbyParticipantReject = ({ participant: p }: Props) =>
51 51
                 onPress = { reject }
52 52
                 style = { styles.contextMenuItem }>
53 53
                 <Icon
54
-                    size = { 20 }
54
+                    size = { 24 }
55 55
                     src = { IconClose }
56 56
                     style = { styles.contextMenuItemIcon } />
57 57
                 <Text style = { styles.contextMenuItemText }>{ t('lobby.reject') }</Text>

+ 9
- 9
react/features/participants-pane/components/native/ContextMenuMeetingParticipantDetails.js Wyświetl plik

@@ -74,14 +74,14 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
74 74
     return (
75 75
         <BottomSheet
76 76
             onCancel = { cancel }
77
-            style = { styles.contextMenuMore }>
77
+            style = { styles.contextMenuMeetingParticipantDetails }>
78 78
             <View
79
-                style = { styles.contextMenuItemSection }>
79
+                style = { styles.contextMenuItemSectionAvatar }>
80 80
                 <Avatar
81 81
                     className = 'participant-avatar'
82 82
                     participantId = { p.id }
83
-                    size = { 20 } />
84
-                <View style = { styles.contextMenuItemText }>
83
+                    size = { 30 } />
84
+                <View style = { styles.contextMenuItemAvatarText }>
85 85
                     <Text style = { styles.contextMenuItemName }>
86 86
                         { displayName }
87 87
                     </Text>
@@ -94,7 +94,7 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
94 94
                     onPress = { muteAudio }
95 95
                     style = { styles.contextMenuItem }>
96 96
                     <Icon
97
-                        size = { 20 }
97
+                        size = { 24 }
98 98
                         src = { IconMicrophoneEmptySlash }
99 99
                         style = { styles.contextMenuItemIcon } />
100 100
                     <Text style = { styles.contextMenuItemText }>
@@ -108,7 +108,7 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
108 108
                     onPress = { muteEveryoneElse }
109 109
                     style = { styles.contextMenuItem }>
110 110
                     <Icon
111
-                        size = { 20 }
111
+                        size = { 24 }
112 112
                         src = { IconMuteEveryoneElse }
113 113
                         style = { styles.contextMenuItemIcon } />
114 114
                     <Text style = { styles.contextMenuItemText }>
@@ -124,7 +124,7 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
124 124
                         onPress = { muteVideo }
125 125
                         style = { styles.contextMenuItemSection }>
126 126
                         <Icon
127
-                            size = { 20 }
127
+                            size = { 24 }
128 128
                             src = { IconVideoOff }
129 129
                             style = { styles.contextMenuItemIcon } />
130 130
                         <Text style = { styles.contextMenuItemText }>
@@ -139,7 +139,7 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
139 139
                     onPress = { kickRemoteParticipant }
140 140
                     style = { styles.contextMenuItem }>
141 141
                     <Icon
142
-                        size = { 20 }
142
+                        size = { 24 }
143 143
                         src = { IconCloseCircle }
144 144
                         style = { styles.contextMenuItemIcon } />
145 145
                     <Text style = { styles.contextMenuItemText }>
@@ -151,7 +151,7 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
151 151
                 onPress = { sendPrivateMessage }
152 152
                 style = { styles.contextMenuItem }>
153 153
                 <Icon
154
-                    size = { 20 }
154
+                    size = { 24 }
155 155
                     src = { IconMessage }
156 156
                     style = { styles.contextMenuItemIcon } />
157 157
                 <Text style = { styles.contextMenuItemText }>

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

@@ -38,7 +38,7 @@ export const ContextMenuMore = () => {
38 38
                 onPress = { muteAllVideo }
39 39
                 style = { styles.contextMenuItem }>
40 40
                 <Icon
41
-                    size = { 20 }
41
+                    size = { 24 }
42 42
                     src = { IconVideoOff } />
43 43
                 <Text style = { styles.contextMenuItemText }>{t('participantsPane.actions.stopEveryonesVideo')}</Text>
44 44
             </TouchableOpacity>
@@ -46,7 +46,7 @@ export const ContextMenuMore = () => {
46 46
                 onPress = { blockAudioVideo }
47 47
                 style = { styles.contextMenuItem }>
48 48
                 <Icon
49
-                    size = { 20 }
49
+                    size = { 24 }
50 50
                     src = { IconMicDisabledHollow }
51 51
                     style = { styles.contextMenuIcon } />
52 52
                 <Text style = { styles.contextMenuItemText }>

+ 7
- 7
react/features/participants-pane/components/native/ParticipantsPane.js Wyświetl plik

@@ -10,7 +10,8 @@ import { openDialog } from '../../../base/dialog';
10 10
 import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
11 11
 import { JitsiModal } from '../../../base/modal';
12 12
 import {
13
-    getParticipantCount, isEveryoneModerator,
13
+    getParticipantCount,
14
+    isEveryoneModerator,
14 15
     isLocalParticipantModerator
15 16
 } from '../../../base/participants';
16 17
 import MuteEveryoneDialog
@@ -20,7 +21,7 @@ import { close } from '../../actions.native';
20 21
 import { ContextMenuMore } from './ContextMenuMore';
21 22
 import { LobbyParticipantList } from './LobbyParticipantList';
22 23
 import { MeetingParticipantList } from './MeetingParticipantList';
23
-import styles, { button } from './styles';
24
+import styles from './styles';
24 25
 
25 26
 /**
26 27
  * Participant pane.
@@ -34,7 +35,7 @@ const ParticipantsPane = () => {
34 35
     const isLocalModerator = useSelector(isLocalParticipantModerator);
35 36
     const participantsCount = useSelector(getParticipantCount);
36 37
     const everyoneModerator = useSelector(isEveryoneModerator);
37
-    const showContextMenu = !everyoneModerator && participantsCount > 2;
38
+    const showContextMenu = true;
38 39
     const muteAll = useCallback(() => dispatch(openDialog(MuteEveryoneDialog)),
39 40
         [ dispatch ]);
40 41
     const { t } = useTranslation();
@@ -45,13 +46,13 @@ const ParticipantsPane = () => {
45 46
             style = { styles.participantsPane }>
46 47
             <View style = { styles.header }>
47 48
                 <Button
48
-                    contentStyle = { styles.closeIcon }
49 49
                     /* eslint-disable-next-line react/jsx-no-bind */
50 50
                     icon = { () =>
51 51
                         (<Icon
52 52
                             size = { 24 }
53 53
                             src = { IconClose } />)
54 54
                     }
55
+                    labelStyle = { styles.closeIcon }
55 56
                     mode = 'contained'
56 57
                     onPress = { closePane }
57 58
                     style = { styles.closeButton } />
@@ -65,21 +66,20 @@ const ParticipantsPane = () => {
65 66
                 && <View style = { styles.footer }>
66 67
                     <Button
67 68
                         children = { t('participantsPane.actions.muteAll') }
68
-                        contentStyle = { styles.muteAllContent }
69 69
                         labelStyle = { styles.muteAllLabel }
70 70
                         mode = 'contained'
71 71
                         onPress = { muteAll }
72
-                        style = { showContextMenu ? styles.muteAllButton : button } />
72
+                        style = { showContextMenu ? styles.muteAllMoreButton : styles.muteAllButton } />
73 73
                     {
74 74
                         showContextMenu
75 75
                         && <Button
76
-                            contentStyle = { styles.moreIcon }
77 76
                             /* eslint-disable-next-line react/jsx-no-bind */
78 77
                             icon = { () =>
79 78
                                 (<Icon
80 79
                                     size = { 24 }
81 80
                                     src = { IconHorizontalPoints } />)
82 81
                             }
82
+                            labelStyle = { styles.moreIcon }
83 83
                             mode = 'contained'
84 84
                             onPress = { openMoreMenu }
85 85
                             style = { styles.moreButton } />

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

@@ -22,23 +22,39 @@ const flexContent = {
22 22
     flex: 1
23 23
 };
24 24
 
25
+/**
26
+ * The style for the context menu items text.
27
+ */
28
+const contextMenuItemText = {
29
+    ...BaseTheme.typography.bodyShortRegularLarge,
30
+    color: BaseTheme.palette.text01
31
+};
32
+
25 33
 /**
26 34
  * The style of the participants pane buttons.
27 35
  */
28 36
 export const button = {
29
-    alignItems: 'center',
30 37
     backgroundColor: BaseTheme.palette.action02,
31 38
     borderRadius: BaseTheme.shape.borderRadius,
32 39
     display: 'flex',
33
-    justifyContent: 'center',
34
-    marginLeft: 'auto'
40
+    minWidth: 0
35 41
 };
36 42
 
37 43
 /**
38 44
  * Small buttons.
39 45
  */
40 46
 const smallButton = {
41
-    ...button
47
+    ...button,
48
+    height: BaseTheme.spacing[7],
49
+    width: BaseTheme.spacing[7]
50
+};
51
+
52
+/**
53
+ * Mute all button.
54
+ */
55
+const muteAllButton = {
56
+    ...button,
57
+    marginLeft: 'auto'
42 58
 };
43 59
 
44 60
 /**
@@ -46,6 +62,7 @@ const smallButton = {
46 62
  */
47 63
 const buttonContent = {
48 64
     ...BaseTheme.typography.labelButton,
65
+    alignSelf: 'center',
49 66
     color: BaseTheme.palette.text01,
50 67
     justifyContent: 'center'
51 68
 };
@@ -213,6 +230,7 @@ export default {
213 230
         display: 'flex',
214 231
         flexDirection: 'row',
215 232
         height: BaseTheme.spacing[10],
233
+        justifyContent: 'space-between',
216 234
         paddingRight: BaseTheme.spacing[3],
217 235
         position: 'relative',
218 236
         right: BaseTheme.spacing[0],
@@ -221,13 +239,17 @@ export default {
221 239
 
222 240
     closeButton: {
223 241
         ...smallButton,
224
-        width: BaseTheme.spacing[8]
242
+        marginLeft: 'auto'
225 243
     },
226 244
 
227 245
     closeIcon: {
228 246
         ...buttonContent,
229
-        height: BaseTheme.spacing[8],
230
-        left: BaseTheme.spacing[2]
247
+        height: BaseTheme.spacing[5],
248
+        marginLeft: 'auto',
249
+        paddingTop: 12,
250
+        paddingBottom: 12,
251
+        paddingRight: BaseTheme.spacing[3],
252
+        paddingLeft: BaseTheme.spacing[3]
231 253
     },
232 254
 
233 255
     inviteButton: {
@@ -243,14 +265,17 @@ export default {
243 265
     },
244 266
 
245 267
     moreButton: {
246
-        ...smallButton,
247
-        width: BaseTheme.spacing[8]
268
+        ...smallButton
248 269
     },
249 270
 
250 271
     moreIcon: {
251 272
         ...buttonContent,
252
-        height: BaseTheme.spacing[8],
253
-        left: BaseTheme.spacing[2]
273
+        height: BaseTheme.spacing[5],
274
+        marginLeft: 'auto',
275
+        paddingTop: 12,
276
+        paddingBottom: 12,
277
+        paddingRight: BaseTheme.spacing[3],
278
+        paddingLeft: BaseTheme.spacing[3]
254 279
     },
255 280
 
256 281
     contextMenuMore: {
@@ -258,20 +283,33 @@ export default {
258 283
         borderRadius: BaseTheme.shape.borderRadius
259 284
     },
260 285
 
286
+    contextMenuMeetingParticipantDetails: {
287
+        backgroundColor: BaseTheme.palette.action02,
288
+        borderRadius: BaseTheme.shape.borderRadius
289
+    },
290
+
261 291
     muteAllButton: {
262
-        ...button,
263
-        left: BaseTheme.spacing[10] + BaseTheme.spacing[2]
292
+        ...muteAllButton
264 293
     },
265 294
 
266
-    muteAllContent: {
267
-        ...buttonContent,
268
-        height: BaseTheme.spacing[8]
295
+    muteAllMoreButton: {
296
+        ...muteAllButton,
297
+        right: BaseTheme.spacing[3]
269 298
     },
270 299
 
271 300
     muteAllLabel: {
272 301
         ...BaseTheme.typography.labelButtonLarge,
273 302
         color: BaseTheme.palette.text01,
274
-        textTransform: 'capitalize'
303
+        flexDirection: 'column',
304
+        height: BaseTheme.spacing[7],
305
+        marginVertical: BaseTheme.spacing[0],
306
+        marginHorizontal: BaseTheme.spacing[0],
307
+        paddingTop: 12,
308
+        paddingBottom: 12,
309
+        paddingRight: BaseTheme.spacing[3],
310
+        paddingLeft: BaseTheme.spacing[3],
311
+        textTransform: 'capitalize',
312
+        width: 94
275 313
     },
276 314
 
277 315
     contextMenuItem: {
@@ -282,9 +320,18 @@ export default {
282 320
         ...contextMenuItem
283 321
     },
284 322
 
323
+    contextMenuItemSectionAvatar: {
324
+        ...contextMenuItem,
325
+        marginLeft: BaseTheme.spacing[1]
326
+    },
327
+
328
+    contextMenuItemAvatarText: {
329
+        ...contextMenuItemText,
330
+        marginLeft: BaseTheme.spacing[2]
331
+    },
332
+
285 333
     contextMenuItemText: {
286
-        ...BaseTheme.typography.bodyShortRegularLarge,
287
-        color: BaseTheme.palette.text01,
334
+        ...contextMenuItemText,
288 335
         marginLeft: BaseTheme.spacing[3]
289 336
     },
290 337
 

+ 3
- 1
react/features/participants-pane/constants.js Wyświetl plik

@@ -3,7 +3,9 @@
3 3
 import React from 'react';
4 4
 
5 5
 import {
6
-    Icon, IconCameraEmpty, IconCameraEmptyDisabled,
6
+    Icon,
7
+    IconCameraEmpty,
8
+    IconCameraEmptyDisabled,
7 9
     IconMicrophoneEmpty,
8 10
     IconMicrophoneEmptySlash
9 11
 } from '../base/icons';

+ 5
- 11
react/features/video-menu/components/native/VolumeSlider.js Wyświetl plik

@@ -2,15 +2,11 @@
2 2
 
3 3
 import _ from 'lodash';
4 4
 import React, { PureComponent } from 'react';
5
-import { View, Slider } from 'react-native';
5
+import { Slider, View } from 'react-native';
6 6
 import { withTheme } from 'react-native-paper';
7 7
 
8 8
 import { translate } from '../../../base/i18n';
9 9
 import { Icon, IconVolumeEmpty } from '../../../base/icons';
10
-import {
11
-    getLocalParticipant,
12
-    getParticipantById
13
-} from '../../../base/participants';
14 10
 import { connect } from '../../../base/redux';
15 11
 import { setVolume } from '../../../participants-pane/actions.native';
16 12
 import { VOLUME_SLIDER_SCALE } from '../../constants';
@@ -105,7 +101,7 @@ class VolumeSlider extends PureComponent<Props, State> {
105 101
         return (
106 102
             <View style = { styles.volumeSliderContainer } >
107 103
                 <Icon
108
-                    size = { 20 }
104
+                    size = { 24 }
109 105
                     src = { IconVolumeEmpty }
110 106
                     style = { styles.volumeIcon } />
111 107
                 <Slider
@@ -148,15 +144,13 @@ class VolumeSlider extends PureComponent<Props, State> {
148 144
  */
149 145
 function mapStateToProps(state, ownProps): Object {
150 146
     const { participant } = ownProps;
151
-    const { startSilent } = state['features/base/config'];
147
+    const { id, local } = participant;
152 148
     const { participantsVolume } = state['features/participants-pane'];
153
-    const getParticipant = participant.id
154
-        ? getParticipantById(state, participant.id) : getLocalParticipant(state);
155
-    const { id } = getParticipant;
149
+    const { startSilent } = state['features/base/config'];
156 150
 
157 151
     return {
158 152
         _startSilent: Boolean(startSilent),
159
-        _volume: participant.local ? undefined : participantsVolume[id]
153
+        _volume: local ? undefined : participantsVolume[id]
160 154
     };
161 155
 }
162 156
 

+ 4
- 3
react/features/video-menu/components/native/styles.js Wyświetl plik

@@ -59,11 +59,12 @@ export default createStyleSheet({
59 59
     },
60 60
 
61 61
     volumeIcon: {
62
-        marginLeft: BaseTheme.spacing[1]
62
+        marginLeft: BaseTheme.spacing[1],
63
+        minWidth: '5%'
63 64
     },
64 65
 
65 66
     sliderContainer: {
66
-        marginLeft: BaseTheme.spacing[2],
67
-        minWidth: '92%'
67
+        marginLeft: BaseTheme.spacing[3],
68
+        minWidth: '90%'
68 69
     }
69 70
 });

Ładowanie…
Anuluj
Zapisz