feat(native-participants-pane) first lobbyparticipantlist steps
This commit is contained in:
parent
0c76d7532c
commit
f984faef3f
|
@ -31,12 +31,13 @@ export const LobbyParticipantItem = ({ participant: p }: Props) => {
|
||||||
participant = { p }
|
participant = { p }
|
||||||
videoMuteState = { MediaState.None }>
|
videoMuteState = { MediaState.None }>
|
||||||
<Button
|
<Button
|
||||||
onClick = { reject }
|
mode = 'contained'
|
||||||
|
onPress = { reject }
|
||||||
style = { styles.participantActionButton }>
|
style = { styles.participantActionButton }>
|
||||||
{t('lobby.reject')}
|
{t('lobby.reject')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick = { admit }
|
onPress = { admit }
|
||||||
style = { styles.participantActionButton }>
|
style = { styles.participantActionButton }>
|
||||||
{t('lobby.admit')}
|
{t('lobby.admit')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -2,35 +2,27 @@
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { View } from 'react-native';
|
|
||||||
import { Text } from 'react-native-paper';
|
import { Text } from 'react-native-paper';
|
||||||
import { useSelector } from 'react-redux';
|
|
||||||
|
|
||||||
import { getLobbyState } from '../../../lobby/functions';
|
|
||||||
|
|
||||||
import { LobbyParticipantItem } from './LobbyParticipantItem';
|
import { LobbyParticipantItem } from './LobbyParticipantItem';
|
||||||
import { participants } from './participants';
|
import { participants } from './participants';
|
||||||
|
import styles from './styles';
|
||||||
|
|
||||||
export const LobbyParticipantList = () => {
|
export const LobbyParticipantList = () => {
|
||||||
const {
|
|
||||||
lobbyEnabled
|
|
||||||
} = useSelector(getLobbyState);
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
if (!lobbyEnabled || !participants.length) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Text>{t('participantsPane.headings.lobby', { count: participants.length })}</Text>
|
{/* eslint-disable-next-line max-len */}
|
||||||
<View>
|
<Text style = { styles.participantName }>
|
||||||
{participants.map(p => (
|
{t('participantsPane.headings.lobby',
|
||||||
<LobbyParticipantItem
|
{ count: participants.length })}
|
||||||
key = { p.id }
|
</Text>
|
||||||
participant = { p } />)
|
{ participants.map(p => (
|
||||||
)}
|
<LobbyParticipantItem
|
||||||
</View>
|
key = { p.id }
|
||||||
|
participant = { p } />)
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import type { Node } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import { Text } from 'react-native-paper';
|
import { Text } from 'react-native-paper';
|
||||||
|
@ -24,6 +25,11 @@ type Props = {
|
||||||
*/
|
*/
|
||||||
audioMuteState: MediaState,
|
audioMuteState: MediaState,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* React children
|
||||||
|
*/
|
||||||
|
children: Node,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback for when the mouse leaves this component
|
* Callback for when the mouse leaves this component
|
||||||
*/
|
*/
|
||||||
|
@ -46,6 +52,7 @@ type Props = {
|
||||||
* @returns {React$Element<any>}
|
* @returns {React$Element<any>}
|
||||||
*/
|
*/
|
||||||
function ParticipantItem({
|
function ParticipantItem({
|
||||||
|
children,
|
||||||
audioMuteState = MediaState.None,
|
audioMuteState = MediaState.None,
|
||||||
videoMuteState = MediaState.None,
|
videoMuteState = MediaState.None,
|
||||||
participant: p
|
participant: p
|
||||||
|
@ -57,15 +64,16 @@ function ParticipantItem({
|
||||||
<View style = { styles.participantContainer } >
|
<View style = { styles.participantContainer } >
|
||||||
<Avatar
|
<Avatar
|
||||||
className = 'participant-avatar'
|
className = 'participant-avatar'
|
||||||
participant = { p.id }
|
participantId = { p.id }
|
||||||
size = { 32 } />
|
size = { 32 } />
|
||||||
<View style = { styles.participantContent }>
|
<View style = { styles.participantContent }>
|
||||||
<View style = { styles.participantNameContainer }>
|
<View style = { styles.participantNameContainer }>
|
||||||
<Text style = { styles.participantName }>
|
<Text style = { styles.participantName }>
|
||||||
{ name }
|
{ name }
|
||||||
</Text>
|
</Text>
|
||||||
{ p.local ? <Text>({t('chat.you')})</Text> : null }
|
{ p.local ? <Text style = { styles.isLocal }>({t('chat.you')})</Text> : null }
|
||||||
</View>
|
</View>
|
||||||
|
{ !p.local && children }
|
||||||
<View style = { styles.participantStates } >
|
<View style = { styles.participantStates } >
|
||||||
{p.raisedHand && <RaisedHandIndicator />}
|
{p.raisedHand && <RaisedHandIndicator />}
|
||||||
{VideoStateIcons[videoMuteState]}
|
{VideoStateIcons[videoMuteState]}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
|
||||||
import { JitsiModal } from '../../../base/modal';
|
import { JitsiModal } from '../../../base/modal';
|
||||||
import { close } from '../../actions.any';
|
import { close } from '../../actions.any';
|
||||||
|
|
||||||
|
import { LobbyParticipantList } from './LobbyParticipantList';
|
||||||
import styles from './styles';
|
import styles from './styles';
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,7 +48,7 @@ function ParticipantsPane({ theme }: Props) {
|
||||||
/* eslint-disable-next-line react/jsx-no-bind */
|
/* eslint-disable-next-line react/jsx-no-bind */
|
||||||
icon = { () =>
|
icon = { () =>
|
||||||
(<Icon
|
(<Icon
|
||||||
size = { 16 }
|
size = { 24 }
|
||||||
src = { IconClose } />)
|
src = { IconClose } />)
|
||||||
}
|
}
|
||||||
mode = 'contained'
|
mode = 'contained'
|
||||||
|
@ -59,8 +60,11 @@ function ParticipantsPane({ theme }: Props) {
|
||||||
}
|
}
|
||||||
}} />
|
}} />
|
||||||
</View>
|
</View>
|
||||||
|
<LobbyParticipantList />
|
||||||
<View style = { styles.footer }>
|
<View style = { styles.footer }>
|
||||||
<Button
|
<Button
|
||||||
|
color = { palette.text01 }
|
||||||
|
compact = { true }
|
||||||
contentStyle = { styles.muteAllContent }
|
contentStyle = { styles.muteAllContent }
|
||||||
onPress = { closePane }
|
onPress = { closePane }
|
||||||
style = { styles.muteAllButton } >
|
style = { styles.muteAllButton } >
|
||||||
|
@ -71,7 +75,7 @@ function ParticipantsPane({ theme }: Props) {
|
||||||
/* eslint-disable-next-line react/jsx-no-bind */
|
/* eslint-disable-next-line react/jsx-no-bind */
|
||||||
icon = { () =>
|
icon = { () =>
|
||||||
(<Icon
|
(<Icon
|
||||||
size = { 16 }
|
size = { 24 }
|
||||||
src = { IconHorizontalPoints } />)
|
src = { IconHorizontalPoints } />)
|
||||||
}
|
}
|
||||||
mode = 'contained'
|
mode = 'contained'
|
||||||
|
|
|
@ -35,6 +35,7 @@ export const participants = [
|
||||||
name: 'me',
|
name: 'me',
|
||||||
pinned: false,
|
pinned: false,
|
||||||
presence: undefined,
|
presence: undefined,
|
||||||
|
raisedHand: true,
|
||||||
role: 'participant',
|
role: 'participant',
|
||||||
startWithAudioMuted: true,
|
startWithAudioMuted: true,
|
||||||
startWithVideoMuted: false
|
startWithVideoMuted: false
|
||||||
|
@ -95,6 +96,7 @@ export const participants = [
|
||||||
name: 'Carlin',
|
name: 'Carlin',
|
||||||
pinned: false,
|
pinned: false,
|
||||||
presence: undefined,
|
presence: undefined,
|
||||||
|
raisedHand: true,
|
||||||
role: 'participant',
|
role: 'participant',
|
||||||
startWithAudioMuted: true,
|
startWithAudioMuted: true,
|
||||||
startWithVideoMuted: false
|
startWithVideoMuted: false
|
||||||
|
|
|
@ -1,15 +1,5 @@
|
||||||
import BaseTheme from '../../../base/ui/components/BaseTheme.native';
|
import BaseTheme from '../../../base/ui/components/BaseTheme.native';
|
||||||
|
|
||||||
/**
|
|
||||||
* The style for content.
|
|
||||||
*/
|
|
||||||
const flexContent = {
|
|
||||||
alignItems: 'center',
|
|
||||||
color: BaseTheme.palette.icon01,
|
|
||||||
display: 'flex',
|
|
||||||
flex: 1
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The style of the participants pane buttons.
|
* The style of the participants pane buttons.
|
||||||
*/
|
*/
|
||||||
|
@ -17,9 +7,8 @@ const container = {
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
height: 64,
|
height: 72,
|
||||||
justifyContent: 'center',
|
paddingRight: 16,
|
||||||
paddingRight: 8,
|
|
||||||
width: '100%'
|
width: '100%'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -32,6 +21,7 @@ const button = {
|
||||||
borderRadius: BaseTheme.shape.borderRadius,
|
borderRadius: BaseTheme.shape.borderRadius,
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
height: 48,
|
height: 48,
|
||||||
|
justifyContent: 'center',
|
||||||
marginLeft: 'auto'
|
marginLeft: 'auto'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -48,7 +38,7 @@ const smallButton = {
|
||||||
*/
|
*/
|
||||||
const buttonContent = {
|
const buttonContent = {
|
||||||
...BaseTheme.typography.labelButtonLarge,
|
...BaseTheme.typography.labelButtonLarge,
|
||||||
...flexContent,
|
color: BaseTheme.palette.text01,
|
||||||
justifyContent: 'center'
|
justifyContent: 'center'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -70,34 +60,39 @@ export default {
|
||||||
|
|
||||||
participantContainer: {
|
participantContainer: {
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
color: BaseTheme.palette.text01,
|
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
flexDirection: 'row',
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
height: 64,
|
height: 64,
|
||||||
|
justifyContent: 'center',
|
||||||
margin: BaseTheme.spacing[4],
|
margin: BaseTheme.spacing[4],
|
||||||
position: 'relative',
|
paddingLeft: 8,
|
||||||
width: 375
|
paddingRight: 8
|
||||||
},
|
},
|
||||||
|
|
||||||
participantContent: {
|
participantContent: {
|
||||||
...flexContent,
|
backgroundColor: 'green',
|
||||||
boxShadow: BaseTheme.shape.boxShadow,
|
boxShadow: BaseTheme.shape.boxShadow,
|
||||||
height: '100%',
|
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
paddingRight: BaseTheme.spacing[4]
|
paddingRight: BaseTheme.spacing[4],
|
||||||
|
width: '100%'
|
||||||
},
|
},
|
||||||
|
|
||||||
participantNameContainer: {
|
participantNameContainer: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
flexDirection: 'row',
|
||||||
marginRight: BaseTheme.spacing[3],
|
marginRight: BaseTheme.spacing[3],
|
||||||
overflow: 'hidden'
|
overflow: 'hidden'
|
||||||
},
|
},
|
||||||
|
|
||||||
participantName: {
|
participantName: {
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
textOverflow: 'ellipsis',
|
color: BaseTheme.palette.text01
|
||||||
whiteSpace: 'nowrap'
|
},
|
||||||
|
|
||||||
|
isLocal: {
|
||||||
|
color: BaseTheme.palette.text01
|
||||||
},
|
},
|
||||||
|
|
||||||
participantsPane: {
|
participantsPane: {
|
||||||
|
@ -105,8 +100,8 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
participantStates: {
|
participantStates: {
|
||||||
display: 'flex',
|
alignItems: 'flex-end',
|
||||||
justifyContent: 'flex-end'
|
display: 'flex'
|
||||||
},
|
},
|
||||||
|
|
||||||
raisedHandIndicator: {
|
raisedHandIndicator: {
|
||||||
|
@ -121,13 +116,11 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
header: {
|
header: {
|
||||||
...container,
|
...container
|
||||||
backgroundColor: 'red'
|
|
||||||
},
|
},
|
||||||
|
|
||||||
footer: {
|
footer: {
|
||||||
...container,
|
...container,
|
||||||
backgroundColor: 'green',
|
|
||||||
marginTop: 'auto'
|
marginTop: 'auto'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -136,7 +129,8 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
closeIcon: {
|
closeIcon: {
|
||||||
...buttonContent
|
...buttonContent,
|
||||||
|
left: 8
|
||||||
},
|
},
|
||||||
|
|
||||||
moreButton: {
|
moreButton: {
|
||||||
|
@ -144,16 +138,13 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
moreIcon: {
|
moreIcon: {
|
||||||
...buttonContent
|
...buttonContent,
|
||||||
|
left: 8
|
||||||
},
|
},
|
||||||
|
|
||||||
muteAllButton: {
|
muteAllButton: {
|
||||||
...button,
|
...button,
|
||||||
paddingBottom: 12,
|
left: 80
|
||||||
paddingLeft: 16,
|
|
||||||
paddingRight: 16,
|
|
||||||
paddingTop: 12,
|
|
||||||
width: 94
|
|
||||||
},
|
},
|
||||||
|
|
||||||
muteAllContent: {
|
muteAllContent: {
|
||||||
|
|
Loading…
Reference in New Issue