feat(native-participants-pane) token updates and added mute all event

This commit is contained in:
Calin Chitu 2021-05-26 13:03:12 +03:00 committed by Hristo Terezov
parent 34ccd56691
commit 8ca85f9e1c
4 changed files with 41 additions and 72 deletions

View File

@ -215,7 +215,7 @@ export const shape = {
boxShadow: 'inset 0px -1px 0px rgba(255, 255, 255, 0.15)' boxShadow: 'inset 0px -1px 0px rgba(255, 255, 255, 0.15)'
}; };
export const spacing = [ 0, 4, 8, 16, 24, 32, 40, 48, 56 ]; export const spacing = [ 0, 4, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80 ];
export const typography = { export const typography = {
labelRegular: { labelRegular: {

View File

@ -18,14 +18,6 @@ import {
import { RaisedHandIndicator } from './RaisedHandIndicator'; import { RaisedHandIndicator } from './RaisedHandIndicator';
import styles from './styles'; import styles from './styles';
// /**
// * Participant actions component mapping depending on trigger type.
// */
// const Actions = {
// [ActionTrigger.Hover]: ParticipantActionsHover,
// [ActionTrigger.Permanent]: ParticipantActionsPermanent
// };
type Props = { type Props = {
/** /**

View File

@ -6,9 +6,11 @@ import { ScrollView, View } from 'react-native';
import { Button } from 'react-native-paper'; import { Button } from 'react-native-paper';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import { hideDialog } from '../../../base/dialog'; import { hideDialog, openDialog } from '../../../base/dialog';
import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons'; import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
import { JitsiModal } from '../../../base/modal'; import { JitsiModal } from '../../../base/modal';
import MuteEveryoneDialog
from '../../../video-menu/components/native/MuteEveryoneDialog';
import { LobbyParticipantList } from './LobbyParticipantList'; import { LobbyParticipantList } from './LobbyParticipantList';
import { MeetingParticipantList } from './MeetingParticipantList'; import { MeetingParticipantList } from './MeetingParticipantList';
@ -24,6 +26,8 @@ export function ParticipantsPane() {
const closePane = useCallback( const closePane = useCallback(
() => dispatch(hideDialog()), () => dispatch(hideDialog()),
[ dispatch ]); [ dispatch ]);
const muteAll = useCallback(() => dispatch(openDialog(MuteEveryoneDialog)),
[ dispatch ]);
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
@ -51,6 +55,7 @@ export function ParticipantsPane() {
<Button <Button
children = { t('participantsPane.actions.muteAll') } children = { t('participantsPane.actions.muteAll') }
labelStyle = { styles.muteAllLabel } labelStyle = { styles.muteAllLabel }
onPress = { muteAll }
style = { styles.muteAllButton } /> style = { styles.muteAllButton } />
<Button <Button
contentStyle = { styles.moreIcon } contentStyle = { styles.moreIcon }

View File

@ -12,8 +12,8 @@ const participantState = {
* The style for participant list. * The style for participant list.
*/ */
const participantList = { const participantList = {
marginLeft: 16, marginLeft: BaseTheme.spacing[4],
marginRight: 16, marginRight: BaseTheme.spacing[4],
position: 'relative' position: 'relative'
}; };
@ -22,8 +22,8 @@ const participantList = {
*/ */
const participantListDescription = { const participantListDescription = {
color: BaseTheme.palette.text01, color: BaseTheme.palette.text01,
paddingBottom: 8, paddingBottom: BaseTheme.spacing[3],
paddingTop: 8, paddingTop: BaseTheme.spacing[3],
position: 'relative', position: 'relative',
width: '55%' width: '55%'
}; };
@ -46,7 +46,7 @@ const button = {
backgroundColor: BaseTheme.palette.action02, backgroundColor: BaseTheme.palette.action02,
borderRadius: BaseTheme.shape.borderRadius, borderRadius: BaseTheme.shape.borderRadius,
display: 'flex', display: 'flex',
height: 48, height: BaseTheme.spacing[7],
justifyContent: 'center', justifyContent: 'center',
marginLeft: 'auto' marginLeft: 'auto'
}; };
@ -56,7 +56,7 @@ const button = {
*/ */
const smallButton = { const smallButton = {
...button, ...button,
width: 48 width: BaseTheme.spacing[7]
}; };
/** /**
@ -81,49 +81,22 @@ export default {
zIndex: 1 zIndex: 1
}, },
participantActionsHover: {
backgroundColor: '#292929',
bottom: 1,
display: 'none',
position: 'absolute',
right: 8,
top: 0,
zIndex: 1,
after: {
backgroundColor: 'linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, #292929 100%)',
content: '',
bottom: 0,
display: 'block',
left: 0,
pointerEvents: 'none',
position: 'absolute',
top: 0,
transform: 'translateX(-100%)',
width: 40
}
},
participantActionsPermanent: {
display: 'flex',
zIndex: 1
},
participantActionsButtonAdmit: { participantActionsButtonAdmit: {
backgroundColor: BaseTheme.palette.action01, backgroundColor: BaseTheme.palette.action01,
borderRadius: BaseTheme.shape.borderRadius, borderRadius: BaseTheme.shape.borderRadius,
height: 32 height: BaseTheme.spacing[5]
}, },
participantActionsButtonReject: { participantActionsButtonReject: {
backgroundColor: BaseTheme.palette.action01, backgroundColor: BaseTheme.palette.action01,
borderRadius: BaseTheme.shape.borderRadius, borderRadius: BaseTheme.shape.borderRadius,
height: 32 height: BaseTheme.spacing[5]
}, },
participantActionsButtonContent: { participantActionsButtonContent: {
alignItems: 'center', alignItems: 'center',
display: 'flex', display: 'flex',
height: 32 height: BaseTheme.spacing[5]
}, },
participantActionsButtonText: { participantActionsButtonText: {
@ -144,7 +117,7 @@ export default {
borderBottomWidth: 2, borderBottomWidth: 2,
display: 'flex', display: 'flex',
flexDirection: 'row', flexDirection: 'row',
height: 64, height: BaseTheme.spacing[9],
width: '100%' width: '100%'
}, },
@ -160,8 +133,8 @@ export default {
participantNameContainer: { participantNameContainer: {
display: 'flex', display: 'flex',
flexDirection: 'row', flexDirection: 'row',
marginLeft: BaseTheme.spacing[2],
overflow: 'hidden', overflow: 'hidden',
paddingLeft: BaseTheme.spacing[2],
width: '63%' width: '63%'
}, },
@ -181,7 +154,7 @@ export default {
participantStatesContainer: { participantStatesContainer: {
display: 'flex', display: 'flex',
flexDirection: 'row', flexDirection: 'row',
marginLeft: 16 marginLeft: BaseTheme.spacing[3]
}, },
participantStateAudio: { participantStateAudio: {
@ -190,29 +163,28 @@ export default {
participantStateVideo: { participantStateVideo: {
...participantState, ...participantState,
marginRight: 8 paddingRight: BaseTheme.spacing[2]
}, },
raisedHandIndicator: { raisedHandIndicator: {
backgroundColor: BaseTheme.palette.warning02, backgroundColor: BaseTheme.palette.warning02,
borderRadius: BaseTheme.shape.borderRadius / 2, borderRadius: BaseTheme.shape.borderRadius / 2,
height: 24, height: BaseTheme.spacing[4],
marginRight: 8, marginRight: BaseTheme.spacing[2],
width: 24 width: BaseTheme.spacing[4]
}, },
raisedHandIcon: { raisedHandIcon: {
...flexContent, ...flexContent,
top: 4 top: BaseTheme.spacing[1]
}, },
lobbyList: { lobbyList: {
...participantList, ...participantList
marginTop: 8
}, },
meetingList: { meetingList: {
...participantList, ...participantList,
marginTop: 16 marginTop: BaseTheme.spacing[3]
}, },
lobbyListDetails: { lobbyListDetails: {
@ -234,33 +206,33 @@ export default {
lobbyListActions: { lobbyListActions: {
flexDirection: 'row', flexDirection: 'row',
left: 0 right: BaseTheme.spacing[2]
}, },
header: { header: {
alignItems: 'center', alignItems: 'center',
backgroundColor: BaseTheme.palette.ui01, backgroundColor: BaseTheme.palette.ui01,
top: 0, top: BaseTheme.spacing[0],
display: 'flex', display: 'flex',
flexDirection: 'row', flexDirection: 'row',
height: 88, height: BaseTheme.spacing[10],
paddingRight: 16, paddingRight: BaseTheme.spacing[3],
position: 'relative', position: 'relative',
right: 0, right: BaseTheme.spacing[0],
left: 0 left: BaseTheme.spacing[0]
}, },
footer: { footer: {
alignItems: 'center', alignItems: 'center',
backgroundColor: BaseTheme.palette.ui01, backgroundColor: BaseTheme.palette.ui01,
bottom: 0, bottom: BaseTheme.spacing[0],
display: 'flex', display: 'flex',
flexDirection: 'row', flexDirection: 'row',
height: 88, height: BaseTheme.spacing[10],
paddingRight: 16, paddingRight: BaseTheme.spacing[3],
position: 'relative', position: 'relative',
right: 0, right: BaseTheme.spacing[0],
left: 0 left: BaseTheme.spacing[0]
}, },
closeButton: { closeButton: {
@ -269,7 +241,7 @@ export default {
closeIcon: { closeIcon: {
...buttonContent, ...buttonContent,
left: 8 left: BaseTheme.spacing[2]
}, },
moreButton: { moreButton: {
@ -278,7 +250,7 @@ export default {
inviteButton: { inviteButton: {
backgroundColor: BaseTheme.palette.action01, backgroundColor: BaseTheme.palette.action01,
marginTop: 8 marginTop: BaseTheme.spacing[2]
}, },
inviteLabel: { inviteLabel: {
@ -288,12 +260,12 @@ export default {
moreIcon: { moreIcon: {
...buttonContent, ...buttonContent,
left: 8 left: BaseTheme.spacing[2]
}, },
muteAllButton: { muteAllButton: {
...button, ...button,
left: 80 left: BaseTheme.spacing[10] + BaseTheme.spacing[2]
}, },
muteAllLabel: { muteAllLabel: {