mediasfu-reactnative
Version:
MediaSFU Prebuilt React Native SDK
91 lines (90 loc) • 2.64 kB
TypeScript
import React from 'react';
import { EventType } from '../../@types/types';
/**
* Interface defining the options for the ShareEventModal component.
*/
export interface ShareEventModalOptions {
/**
* Background color of the modal content.
* Defaults to 'rgba(255, 255, 255, 0.25)'.
*/
backgroundColor?: string;
/**
* Flag to control the visibility of the modal.
*/
isShareEventModalVisible: boolean;
/**
* Callback function to handle the closing of the modal.
*/
onShareEventClose: () => void;
/**
* Flag to control the visibility of share buttons.
* Defaults to true.
*/
shareButtons?: boolean;
/**
* Position of the modal on the screen.
* Possible values: 'topLeft', 'topRight', 'bottomLeft', 'bottomRight', 'center'.
* Defaults to 'topRight'.
*/
position?: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'center';
/**
* The name of the room to be shared.
*/
roomName: string;
/**
* The admin passcode for the meeting.
*/
adminPasscode?: string;
/**
* The level of the user.
*/
islevel?: string;
/**
* The type of the event.
*/
eventType: EventType;
/**
* The link to the local server.
*/
localLink?: string;
}
export type ShareEventModalType = (options: ShareEventModalOptions) => JSX.Element;
/**
* ShareEventModal component displays a modal that allows users to share event details,
* including the room name and an optional admin passcode, with other participants.
* This modal provides customizable options for positioning, appearance, and shared content.
*
* @component
* @param {ShareEventModalOptions} props - The properties for the ShareEventModal component.
* @returns {JSX.Element} The rendered ShareEventModal component.
*
* @example
* ```tsx
* import React, { useState } from 'react';
* import { ShareEventModal } from 'mediasfu-reactnative';
*
* function App() {
* const [modalVisible, setModalVisible] = useState(true);
*
* return (
* <ShareEventModal
* isShareEventModalVisible={modalVisible}
* onShareEventClose={() => setModalVisible(false)}
* roomName="Room123"
* adminPasscode="Passcode456"
* islevel="2"
* eventType="conference"
* backgroundColor="rgba(255, 255, 255, 0.8)"
* shareButtons={true}
* position="topRight"
* localLink="https://example.com"
* />
* );
* }
*
* export default App;
* ```
*/
declare const ShareEventModal: React.FC<ShareEventModalOptions>;
export default ShareEventModal;