From 400f47963daee7d96c494b621f787e8d41a62300 Mon Sep 17 00:00:00 2001 From: Calin Chitu Date: Fri, 11 Jun 2021 10:15:20 +0300 Subject: [PATCH] feat(native-participants-pane) open/close pane native actions --- .../participants-pane/actions.native.js | 26 ++++++++++++ .../components/native/ParticipantsPane.js | 41 ++++++++++++++++--- .../native/ParticipantsPaneButton.js | 6 +-- react/features/participants-pane/constants.js | 2 + 4 files changed, 66 insertions(+), 9 deletions(-) diff --git a/react/features/participants-pane/actions.native.js b/react/features/participants-pane/actions.native.js index 048ac56d2..6c660c569 100644 --- a/react/features/participants-pane/actions.native.js +++ b/react/features/participants-pane/actions.native.js @@ -1,7 +1,33 @@ import { openDialog } from '../base/dialog'; +import { PARTICIPANTS_PANE_CLOSE, PARTICIPANTS_PANE_OPEN } from './actionTypes'; import { ContextMenuLobbyParticipantReject, ContextMenuMeetingParticipantDetails } from './components/native'; + +/** + * Action to open the participants pane. + * + * @returns {Object} + */ +export function open() { + console.log(2); + + return { + type: PARTICIPANTS_PANE_OPEN + }; +} + +/** + * Action to close the participants pane. + * + * @returns {Object} + */ +export function close() { + return { + type: PARTICIPANTS_PANE_CLOSE + }; +} + /** * Displays the context menu for the selected lobby participant. * diff --git a/react/features/participants-pane/components/native/ParticipantsPane.js b/react/features/participants-pane/components/native/ParticipantsPane.js index ef7180bbd..2aff92590 100644 --- a/react/features/participants-pane/components/native/ParticipantsPane.js +++ b/react/features/participants-pane/components/native/ParticipantsPane.js @@ -4,26 +4,37 @@ import React, { useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { ScrollView, View } from 'react-native'; import { Button } from 'react-native-paper'; -import { useDispatch, useSelector } from 'react-redux'; +import { useDispatch, useSelector, connect } from 'react-redux'; import { hideDialog, openDialog } from '../../../base/dialog'; import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons'; import { JitsiModal } from '../../../base/modal'; -import { isLocalParticipantModerator } from '../../../base/participants'; +import { + isLocalParticipantModerator +} from '../../../base/participants'; import MuteEveryoneDialog from '../../../video-menu/components/native/MuteEveryoneDialog'; +import { PARTICIPANTS_PANE_ID } from '../../constants'; import { ContextMenuMore } from './ContextMenuMore'; import { LobbyParticipantList } from './LobbyParticipantList'; import { MeetingParticipantList } from './MeetingParticipantList'; import styles from './styles'; +type Props = { + + /** + * Is the participants pane open + */ + _isOpen: boolean +}; + /** * Participant pane. * * @returns {React$Element} */ -function ParticipantsPane() { +function ParticipantsPane({ _isOpen: paneOpen }: Props) { const dispatch = useDispatch(); const openMoreMenu = useCallback(() => dispatch(openDialog(ContextMenuMore)), [ dispatch ]); const closePane = useCallback(() => dispatch(hideDialog()), [ dispatch ]); @@ -33,8 +44,10 @@ function ParticipantsPane() { const { t } = useTranslation(); return ( -