Function ParticipantsModal

ParticipantsModal displays a list of participants in a modal, with options for filtering, muting, messaging, or removing participants based on user permissions and event type.

import React, { useState } from 'react';
import { ParticipantsModal } from 'mediasfu-reactnative';

function App() {
const [isModalVisible, setIsModalVisible] = useState(false);
const participantsParameters = {
position: 'topRight',
backgroundColor: '#83c0e9',
coHostResponsibility: [{ name: 'participants', value: true }],
coHost: 'JaneDoe',
member: 'JohnDoe',
islevel: '2',
participants: [
{ name: 'Alice', id: '1', islevel: '1', muted: false },
{ name: 'Bob', id: '2', islevel: '1', muted: true },
],
eventType: 'webinar',
filteredParticipants: [],
socket: socketInstance,
showAlert: showAlertFunction,
roomName: 'MainRoom',
updateIsMessagesModalVisible: setIsMessagesModalVisible,
updateDirectMessageDetails: setDirectMessageDetails,
updateStartDirectMessage: setStartDirectMessage,
updateParticipants: setParticipants,
getUpdatedAllParams: () => participantsParameters,
};

return (
<ParticipantsModal
isParticipantsModalVisible={isModalVisible}
onParticipantsClose={() => setIsModalVisible(false)}
onParticipantsFilterChange={(filter) => handleFilterChange(filter)}
participantsCounter={participantsParameters.participants.length}
parameters={participantsParameters}
/>
);
}

export default App;

Properties

propTypes?: WeakValidationMap<ParticipantsModalOptions>

Used to declare the types of the props accepted by the component. These types will be checked during rendering and in development only.

We recommend using TypeScript instead of checking prop types at runtime.

contextTypes?: ValidationMap<any>

Lets you specify which legacy context is consumed by this component.

defaultProps?: Partial<ParticipantsModalOptions>

Used to define default values for the props accepted by the component.

type Props = { name?: string }

const MyComponent: FC<Props> = (props) => {
return <div>{props.name}</div>
}

MyComponent.defaultProps = {
name: 'John Doe'
}
displayName?: string

Used in debugging messages. You might want to set it explicitly if you want to display a different name for debugging purposes.


const MyComponent: FC = () => {
return <div>Hello!</div>
}

MyComponent.displayName = 'MyAwesomeComponent'