Function ConfirmExitModal

ConfirmExitModal provides a modal interface to confirm user exit or end an event, with the option for admin-level users to end the event for all participants.

import React, { useState } from 'react';
import { ConfirmExitModal } from 'mediasfu-reactnative';
import { io } from 'socket.io-client';

const socket = io('https://your-server-url.com');

function App() {
const [isModalVisible, setModalVisible] = useState(true);

return (
<View>
<Button title="Confirm Exit" onPress={() => setModalVisible(true)} />
<ConfirmExitModal
isConfirmExitModalVisible={isModalVisible}
onConfirmExitClose={() => setModalVisible(false)}
position="bottomLeft"
backgroundColor="#ffcccc"
exitEventOnConfirm={() => console.log("Exit confirmed")}
member="John Doe"
ban={false}
roomName="MainRoom"
socket={socket}
islevel="2"
/>
</View>
);
}

export default App;

Properties

propTypes?: WeakValidationMap<ConfirmExitModalOptions>

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

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'