From bdd6638067fa548b44b69d9ce1740c7c07483f9a Mon Sep 17 00:00:00 2001 From: Calin Chitu Date: Wed, 19 May 2021 14:05:28 +0300 Subject: [PATCH] feat(native-participants-pane) fixed lint errors --- .../components/native/Button.js | 24 ++++++------- .../components/native/LobbyParticipantList.js | 28 +++++++++++++-- .../native/MeetingParticipantItem.js | 19 ---------- .../native/MeetingParticipantList.js | 36 ------------------- .../components/native/ParticipantItem.js | 6 ---- .../components/native/ParticipantsPane.js | 2 +- 6 files changed, 39 insertions(+), 76 deletions(-) delete mode 100644 react/features/participants-pane/components/native/MeetingParticipantItem.js delete mode 100644 react/features/participants-pane/components/native/MeetingParticipantList.js diff --git a/react/features/participants-pane/components/native/Button.js b/react/features/participants-pane/components/native/Button.js index 56737f972..60b6d714c 100644 --- a/react/features/participants-pane/components/native/Button.js +++ b/react/features/participants-pane/components/native/Button.js @@ -13,35 +13,35 @@ let buttonContent; */ type Props = { + /** + * Button content. + */ + content?: string, + /** * Is the button icon type? */ - iconButton: boolean, + iconButton?: boolean, /** * Style for the icon */ - iconStyle: Object, + iconStyle?: Object, /** * Size of the icon. */ - iconSize: number, + iconSize?: number, /** * Icon component source. */ iconSrc?: Object, - /** - * Button content. - */ - content: string, - /** * Button mode. */ - mode: string, + mode?: string, /** * Style of button's inner content. @@ -51,17 +51,17 @@ type Props = { /** * The action to be performed when the button is pressed. */ - onPress: Function, + onPress?: Function, /** * An external style object passed to the component. */ - style: Object, + style?: Object, /** * Theme to be applied. */ - theme: Object + theme?: Object }; /** diff --git a/react/features/participants-pane/components/native/LobbyParticipantList.js b/react/features/participants-pane/components/native/LobbyParticipantList.js index 746d4d465..51aac09cd 100644 --- a/react/features/participants-pane/components/native/LobbyParticipantList.js +++ b/react/features/participants-pane/components/native/LobbyParticipantList.js @@ -1,12 +1,36 @@ // @flow import React from 'react'; +import { useTranslation } from 'react-i18next'; import { View } from 'react-native'; +import { Text } from 'react-native-paper'; import { useSelector } from 'react-redux'; -// import { getLobbyState } from '../../../lobby/functions'; +import { getLobbyState } from '../../../lobby/functions'; import { LobbyParticipantItem } from './LobbyParticipantItem'; import { participants } from './participants'; -export const LobbyParticipantList = () => null; +export const LobbyParticipantList = () => { + const { + lobbyEnabled + } = useSelector(getLobbyState); + const { t } = useTranslation(); + + if (!lobbyEnabled || !participants.length) { + return null; + } + + return ( + <> + {t('participantsPane.headings.lobby', { count: participants.length })} + + {participants.map(p => ( + ) + )} + + + ); +}; diff --git a/react/features/participants-pane/components/native/MeetingParticipantItem.js b/react/features/participants-pane/components/native/MeetingParticipantItem.js deleted file mode 100644 index 6c39a4a3c..000000000 --- a/react/features/participants-pane/components/native/MeetingParticipantItem.js +++ /dev/null @@ -1,19 +0,0 @@ -// @flow - -import React from 'react'; - -import ParticipantItem from './ParticipantItem'; - - -type Props = { - - /** - * Participant reference - */ - participant: Object -}; - -export const MeetingParticipantItem = ({ participant: p }: Props) => ( - -); diff --git a/react/features/participants-pane/components/native/MeetingParticipantList.js b/react/features/participants-pane/components/native/MeetingParticipantList.js deleted file mode 100644 index 59f7d3b87..000000000 --- a/react/features/participants-pane/components/native/MeetingParticipantList.js +++ /dev/null @@ -1,36 +0,0 @@ -// @flow - -import React from 'react'; -import { useTranslation } from 'react-i18next'; -import { View } from 'react-native'; -import { Text } from 'react-native-paper'; -import { useSelector } from 'react-redux'; - -import { getParticipants } from '../../../base/participants'; - -import { MeetingParticipantItem } from './MeetingParticipantItem'; -import styles from './styles'; - - -export const MeetingParticipantList = () => { - const participants = useSelector(getParticipants); - const { t } = useTranslation(); - - return ( - - - { - t('participantsPane.headings.participantsList', - { count: participants.length } - ) - } - - { - participants.map(p => ( - ) - )} - - ); -}; diff --git a/react/features/participants-pane/components/native/ParticipantItem.js b/react/features/participants-pane/components/native/ParticipantItem.js index 7ac3a813c..374df4d90 100644 --- a/react/features/participants-pane/components/native/ParticipantItem.js +++ b/react/features/participants-pane/components/native/ParticipantItem.js @@ -9,7 +9,6 @@ import { useSelector } from 'react-redux'; import { Avatar } from '../../../base/avatar'; import { getParticipantDisplayNameWithId } from '../../../base/participants'; import { - ActionTrigger, AudioStateIcons, MediaState, VideoStateIcons @@ -20,11 +19,6 @@ import styles from './styles'; type Props = { - /** - * Type of trigger for the participant actions - */ - actionsTrigger: ActionTrigger, - /** * Media state for audio */ diff --git a/react/features/participants-pane/components/native/ParticipantsPane.js b/react/features/participants-pane/components/native/ParticipantsPane.js index 6fbaf375f..9a2ddf99e 100644 --- a/react/features/participants-pane/components/native/ParticipantsPane.js +++ b/react/features/participants-pane/components/native/ParticipantsPane.js @@ -9,7 +9,7 @@ import { useDispatch, useSelector } from 'react-redux'; import { IconClose, IconHorizontalPoints } from '../../../base/icons'; import { JitsiModal } from '../../../base/modal'; import { isLocalParticipantModerator } from '../../../base/participants'; -import { close } from '../../actions.native'; +import { close } from '../../actions.any'; import Button from './Button'; import { LobbyParticipantList } from './LobbyParticipantList';