fix(rn, participants-pane) Show raised hand indicator (#10424)
Make name container limited width and add ellipsis text overflow Show raise hand status live in participants pane
This commit is contained in:
parent
42e62e013d
commit
763d975445
|
@ -5,6 +5,7 @@ import React, { PureComponent } from 'react';
|
||||||
import { translate } from '../../../base/i18n';
|
import { translate } from '../../../base/i18n';
|
||||||
import {
|
import {
|
||||||
getLocalParticipant,
|
getLocalParticipant,
|
||||||
|
getParticipantById,
|
||||||
getParticipantDisplayName,
|
getParticipantDisplayName,
|
||||||
hasRaisedHand,
|
hasRaisedHand,
|
||||||
isParticipantModerator
|
isParticipantModerator
|
||||||
|
@ -178,6 +179,10 @@ function mapStateToProps(state, ownProps): Object {
|
||||||
const audioMediaState = getParticipantAudioMediaState(participant, _isAudioMuted, state);
|
const audioMediaState = getParticipantAudioMediaState(participant, _isAudioMuted, state);
|
||||||
const videoMediaState = getParticipantVideoMediaState(participant, _isVideoMuted, state);
|
const videoMediaState = getParticipantVideoMediaState(participant, _isVideoMuted, state);
|
||||||
const { disableModeratorIndicator } = state['features/base/config'];
|
const { disableModeratorIndicator } = state['features/base/config'];
|
||||||
|
const raisedHand = hasRaisedHand(participant?.local
|
||||||
|
? participant
|
||||||
|
: getParticipantById(state, participant.id)
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
_audioMediaState: audioMediaState,
|
_audioMediaState: audioMediaState,
|
||||||
|
@ -189,7 +194,7 @@ function mapStateToProps(state, ownProps): Object {
|
||||||
_local: Boolean(participant?.local),
|
_local: Boolean(participant?.local),
|
||||||
_localVideoOwner: Boolean(ownerId === localParticipantId),
|
_localVideoOwner: Boolean(ownerId === localParticipantId),
|
||||||
_participantID: participant?.id,
|
_participantID: participant?.id,
|
||||||
_raisedHand: hasRaisedHand(participant),
|
_raisedHand: raisedHand,
|
||||||
_videoMediaState: videoMediaState
|
_videoMediaState: videoMediaState
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,12 +101,18 @@ function ParticipantItem({
|
||||||
displayName = { displayName }
|
displayName = { displayName }
|
||||||
participantId = { participantID }
|
participantId = { participantID }
|
||||||
size = { 32 } />
|
size = { 32 } />
|
||||||
<View style = { styles.participantDetailsContainer }>
|
<View
|
||||||
|
style = { [
|
||||||
|
styles.participantDetailsContainer,
|
||||||
|
raisedHand && styles.participantDetailsContainerRaisedHand
|
||||||
|
] }>
|
||||||
<View style = { styles.participantNameContainer }>
|
<View style = { styles.participantNameContainer }>
|
||||||
<Text style = { styles.participantName }>
|
<Text
|
||||||
|
numberOfLines = { 1 }
|
||||||
|
style = { styles.participantName }>
|
||||||
{ displayName }
|
{ displayName }
|
||||||
|
{local && ` (${t('chat.you')})` }
|
||||||
</Text>
|
</Text>
|
||||||
{ local ? <Text style = { styles.isLocal }>({t('chat.you')})</Text> : null }
|
|
||||||
</View>
|
</View>
|
||||||
{isModerator && !disableModeratorIndicator
|
{isModerator && !disableModeratorIndicator
|
||||||
&& <Text style = { styles.moderatorLabel }>{t('videothumbnail.moderator')}</Text>
|
&& <Text style = { styles.moderatorLabel }>{t('videothumbnail.moderator')}</Text>
|
||||||
|
@ -115,9 +121,7 @@ function ParticipantItem({
|
||||||
{
|
{
|
||||||
!isKnockingParticipant
|
!isKnockingParticipant
|
||||||
&& <>
|
&& <>
|
||||||
{
|
{raisedHand && <RaisedHandIndicator />}
|
||||||
raisedHand && <RaisedHandIndicator />
|
|
||||||
}
|
|
||||||
<View style = { styles.participantStatesContainer }>
|
<View style = { styles.participantStatesContainer }>
|
||||||
<View style = { styles.participantStateVideo }>{VideoStateIcons[videoMediaState]}</View>
|
<View style = { styles.participantStateVideo }>{VideoStateIcons[videoMediaState]}</View>
|
||||||
<View>{AudioStateIcons[audioMediaState]}</View>
|
<View>{AudioStateIcons[audioMediaState]}</View>
|
||||||
|
|
|
@ -140,7 +140,11 @@ export default {
|
||||||
participantDetailsContainer: {
|
participantDetailsContainer: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
width: '100%'
|
width: '73%'
|
||||||
|
},
|
||||||
|
|
||||||
|
participantDetailsContainerRaisedHand: {
|
||||||
|
width: '65%'
|
||||||
},
|
},
|
||||||
|
|
||||||
participantNameContainer: {
|
participantNameContainer: {
|
||||||
|
@ -163,12 +167,6 @@ export default {
|
||||||
paddingTop: BaseTheme.spacing[1]
|
paddingTop: BaseTheme.spacing[1]
|
||||||
},
|
},
|
||||||
|
|
||||||
isLocal: {
|
|
||||||
alignSelf: 'center',
|
|
||||||
color: BaseTheme.palette.text01,
|
|
||||||
marginLeft: BaseTheme.spacing[1]
|
|
||||||
},
|
|
||||||
|
|
||||||
participantsPane: {
|
participantsPane: {
|
||||||
backgroundColor: BaseTheme.palette.ui01,
|
backgroundColor: BaseTheme.palette.ui01,
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
@ -190,8 +188,9 @@ export default {
|
||||||
backgroundColor: BaseTheme.palette.warning02,
|
backgroundColor: BaseTheme.palette.warning02,
|
||||||
borderRadius: BaseTheme.shape.borderRadius / 2,
|
borderRadius: BaseTheme.shape.borderRadius / 2,
|
||||||
height: BaseTheme.spacing[4],
|
height: BaseTheme.spacing[4],
|
||||||
marginLeft: BaseTheme.spacing[2],
|
width: BaseTheme.spacing[4],
|
||||||
width: BaseTheme.spacing[4]
|
marginLeft: 'auto',
|
||||||
|
marginRight: BaseTheme.spacing[2]
|
||||||
},
|
},
|
||||||
|
|
||||||
raisedHandIcon: {
|
raisedHandIcon: {
|
||||||
|
|
Loading…
Reference in New Issue