Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(native-participants-pane) removed button component, fixed icons inside paper button component and reverted actions.js files

Calin Chitucb0b68f84011
diff --git a/react/features/lobby/actions.any.js b/react/features/lobby/actions.any.js
index 6ae4745a70..75f6f5b899 100644
--- a/react/features/lobby/actions.any.js
+++ b/react/features/lobby/actions.any.js
@@ -23,24 +23,3 @@ export function toggleLobbyMode(enabled: boolean) {
}
};
}
-
-/**
- * Approves (lets in) or rejects a knocking participant.
- *
- * @param {string} id - The id of the knocking participant.
- * @param {boolean} approved - True if the participant is approved, false otherwise.
- * @returns {Function}
- */
-export function setKnockingParticipantApproval(id: string, approved: boolean) {
- return async (dispatch: Dispatch<any>, getState: Function) => {
- const conference = getCurrentConference(getState);
-
- if (conference) {
- if (approved) {
- conference.lobbyApproveAccess(id);
- } else {
- conference.lobbyDenyAccess(id);
- }
- }
- };
-}
diff --git a/react/features/lobby/actions.native.js b/react/features/lobby/actions.native.js
index b35b46839d..19f68c8087 100644
--- a/react/features/lobby/actions.native.js
+++ b/react/features/lobby/actions.native.js
@@ -5,7 +5,6 @@ import { openDialog } from '../base/dialog';
import { DisableLobbyModeDialog, EnableLobbyModeDialog } from './components/native';
export * from './actions.web';
-export * from './actions.any';
/**
* Action to show the dialog to disable lobby mode.
diff --git a/react/features/participants-pane/actions.native.js b/react/features/participants-pane/actions.native.js
deleted file mode 100644
index 7e5279fe73..0000000000
--- a/react/features/participants-pane/actions.native.js
+++ /dev/null
@@ -1,3 +0,0 @@
-// @flow
-
-export * from './actions.any';
diff --git a/react/features/participants-pane/actions.web.js b/react/features/participants-pane/actions.web.js
deleted file mode 100644
index 7e5279fe73..0000000000
--- a/react/features/participants-pane/actions.web.js
+++ /dev/null
@@ -1,3 +0,0 @@
-// @flow
-
-export * from './actions.any';
diff --git a/react/features/participants-pane/components/native/Button.js b/react/features/participants-pane/components/native/Button.js
deleted file mode 100644
index 60b6d714c7..0000000000
--- a/react/features/participants-pane/components/native/Button.js
+++ /dev/null
@@ -1,115 +0,0 @@
-// @flow
-
-import React from 'react';
-import { View } from 'react-native';
-import { Button as PaperButton } from 'react-native-paper';
-
-import { Icon } from '../../../base/icons';
-
-let buttonContent;
-
-/**
- * The type of the React {@code Component} props of {@link Button}
- */
-type Props = {
-
- /**
- * Button content.
- */
- content?: string,
-
- /**
- * Is the button icon type?
- */
- iconButton?: boolean,
-
- /**
- * Style for the icon
- */
- iconStyle?: Object,
-
- /**
- * Size of the icon.
- */
- iconSize?: number,
-
- /**
- * Icon component source.
- */
- iconSrc?: Object,
-
- /**
- * Button mode.
- */
- mode?: string,
-
- /**
- * Style of button's inner content.
- */
- contentStyle?: Object,
-
- /**
- * The action to be performed when the button is pressed.
- */
- onPress?: Function,
-
- /**
- * An external style object passed to the component.
- */
- style?: Object,
-
- /**
- * Theme to be applied.
- */
- theme?: Object
-};
-
-/**
- * Close button component.
- *
- * @returns {React$Element<any>}
- */
-function Button({
- iconButton,
- iconStyle,
- iconSize,
- iconSrc,
- content,
- contentStyle,
- mode,
- onPress,
- style,
- theme
-}: Props) {
-
- if (iconButton) {
- buttonContent
- = (<View
- /* eslint-disable-next-line react-native/no-inline-styles */
- style = {{
- height: 0,
- width: 0
- }}>
- <Icon
- size = { iconSize }
- src = { iconSrc }
- style = { iconStyle } />
- </View>);
-
- } else {
- buttonContent = content;
- }
-
- return (
- <PaperButton
- contentStyle = { contentStyle }
- mode = { mode }
- onPress = { onPress }
- style = { style }
- theme = { theme }>
- { buttonContent }
- </PaperButton>
- );
-}
-
-export default Button;
diff --git a/react/features/participants-pane/components/native/ParticipantsPane.js b/react/features/participants-pane/components/native/ParticipantsPane.js
index 9a2ddf99e2..2a1b515a1c 100644
--- a/react/features/participants-pane/components/native/ParticipantsPane.js
+++ b/react/features/participants-pane/components/native/ParticipantsPane.js
@@ -3,16 +3,14 @@
import React, { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { View } from 'react-native';
-import { withTheme } from 'react-native-paper';
+import { Button, withTheme } from 'react-native-paper';
import { useDispatch, useSelector } from 'react-redux';
-import { IconClose, IconHorizontalPoints } from '../../../base/icons';
+import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
import { JitsiModal } from '../../../base/modal';
import { isLocalParticipantModerator } from '../../../base/participants';
import { close } from '../../actions.any';
-import Button from './Button';
-import { LobbyParticipantList } from './LobbyParticipantList';
import styles from './styles';
@@ -47,11 +45,13 @@ function ParticipantsPane({ theme }: Props) {
style = { styles.participantsPane }>
<View style = { styles.header }>
<Button
- contentStyle = { styles.muteAllContent }
- iconButton = { true }
- iconSize = { 16 }
- iconSrc = { IconClose }
- iconStyle = { styles.closeIcon }
+ contentStyle = { styles.closeIcon }
+ /* eslint-disable-next-line react/jsx-no-bind */
+ icon = { () =>
+ (<Icon
+ size = { 16 }
+ src = { IconClose } />)
+ }
mode = 'contained'
onPress = { closePane }
style = { styles.closeButton }
@@ -61,31 +61,30 @@ function ParticipantsPane({ theme }: Props) {
}
}} />
</View>
- <LobbyParticipantList />
- {
- isLocalModerator
- && <View style = { styles.footer }>
- <Button
- content = { t('participantsPane.actions.muteAll') }
- contentStyle = { styles.muteAllContent }
- onPress = { closePane }
- style = { styles.muteAllButton } />
- <Button
- contentStyle = { styles.muteAllContent }
- iconButton = { true }
- iconSize = { 16 }
- iconSrc = { IconHorizontalPoints }
- iconStyle = { styles.moreIcon }
- mode = 'contained'
- onPress = { closePane }
- style = { styles.moreButton }
- theme = {{
- colors: {
- primary: palette.action02
- }
- }} />
- </View>
- }
+ <View style = { styles.footer }>
+ <Button
+ contentStyle = { styles.muteAllContent }
+ onPress = { closePane }
+ style = { styles.muteAllButton } >
+ { t('participantsPane.actions.muteAll') }
+ </Button>
+ <Button
+ contentStyle = { styles.moreIcon }
+ /* eslint-disable-next-line react/jsx-no-bind */
+ icon = { () =>
+ (<Icon
+ size = { 16 }
+ src = { IconHorizontalPoints } />)
+ }
+ mode = 'contained'
+ onPress = { closePane }
+ style = { styles.moreButton }
+ theme = {{
+ colors: {
+ primary: palette.action02
+ }
+ }} />
+ </View>
</JitsiModal>
);
}
diff --git a/react/features/participants-pane/components/native/styles.js b/react/features/participants-pane/components/native/styles.js
index ccf44a04f7..353931f58a 100644
--- a/react/features/participants-pane/components/native/styles.js
+++ b/react/features/participants-pane/components/native/styles.js
@@ -147,16 +147,6 @@ export default {
...buttonContent
},
- moreButtonPaper: {
- ...smallButton,
- height: 48
- },
-
- moreIconPaper: {
- alignItems: 'center',
- flexDirection: 'row-reverse'
- },
-
muteAllButton: {
...button,
paddingBottom: 12,