mediasfu-reactnative
Version:
MediaSFU Prebuilt React Native SDK
100 lines (99 loc) • 2.61 kB
TypeScript
import React from 'react';
import { CustomButton } from './CustomButtons';
import { EventType } from '../../@types/types';
/**
* Interface defining the options (props) for the MenuModal component.
*/
export interface MenuModalOptions {
/**
* The background color of the modal content.
* @default '#83c0e9'
*/
backgroundColor?: string;
/**
* Determines if the modal is visible.
*/
isVisible: boolean;
/**
* Function to call when the modal is closed.
*/
onClose: () => void;
/**
* An array of custom buttons to display in the modal.
*/
customButtons?: CustomButton[];
/**
* Determines if share buttons should be displayed.
* @default true
*/
shareButtons?: boolean;
/**
* Position of the modal on the screen.
* Possible values: 'topRight', 'topLeft', 'bottomRight', 'bottomLeft'
* @default 'bottomRight'
*/
position?: 'topRight' | 'topLeft' | 'bottomRight' | 'bottomLeft';
/**
* The name of the room.
*/
roomName: string;
/**
* The admin passcode for the meeting.
*/
adminPasscode: string;
/**
* The level of the user.
*/
islevel: string;
/**
* The type of event.
*/
eventType: EventType;
/**
* The link to the Commnity Edition server.
*/
localLink?: string;
}
export type MenuModalType = (options: MenuModalOptions) => JSX.Element;
/**
* MenuModal - A React Native component that displays a modal with various menu options and buttons.
*
* @component
* @param {MenuModalOptions} props - The properties passed to the MenuModal component.
* @returns {JSX.Element} - The MenuModal component JSX element.
* @example
* ```tsx
* import React from 'react';
* import { MenuModal } from 'mediasfu-reactnative';
*
* function App() {
* return (
* <MenuModal
* backgroundColor='#83c0e9'
* isVisible={true}
* onClose={() => console.log('Modal closed')}
* customButtons={[
* {
* action: () => console.log('Button pressed'),
* show: true,
* backgroundColor: '#4CAF50',
* icon: 'check-circle',
* text: 'Confirm',
* },
* ]}
* shareButtons={true}
* position='bottomRight'
* roomName='MeetingRoom123'
* adminPasscode='123456'
* islevel='2'
* eventType='video'
* localLink='http://localhost:3000'
* />
* );
* }
*
* export default App;
* ```
*/
declare const MenuModal: React.FC<MenuModalOptions>;
export default MenuModal;