Function WaitingRoomModal

WaitingRoomModal displays a modal interface for managing participants in a waiting room. It allows for accepting or rejecting participants and filtering the list in real time.

import { WaitingRoomModal } from 'mediasfu-reactjs';
import { io } from 'socket.io-client';

const waitingRoomList = [
{ id: "1", name: "John Doe" },
{ id: "2", name: "Jane Smith" },
];

const parameters = {
filteredWaitingRoomList: waitingRoomList,
getUpdatedAllParams: () => ({ filteredWaitingRoomList: waitingRoomList }),
};

const socket = io("http://localhost:3000");

// Render the WaitingRoomModal
<WaitingRoomModal
isWaitingModalVisible={true}
onWaitingRoomClose={() => console.log("Waiting room modal closed")}
waitingRoomCounter={2}
onWaitingRoomFilterChange={(text) => console.log("Filter changed to:", text)}
waitingRoomList={waitingRoomList}
updateWaitingList={(updatedList) => console.log("Updated waiting list:", updatedList)}
roomName="Room 1"
socket={socket}
onWaitingRoomItemPress={(options) => console.log("Action taken on participant:", options)}
position="topRight"
backgroundColor="#83c0e9"
parameters={parameters}
/>

Properties

propTypes?: WeakValidationMap<WaitingRoomModalOptions>

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<WaitingRoomModalOptions>

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'