mediasfu-reactnative
Version:
MediaSFU Prebuilt React Native SDK
55 lines (54 loc) • 1.63 kB
TypeScript
import React from 'react';
/**
* Interface defining the props for the LoadingModal component.
*/
export interface LoadingModalOptions {
/**
* Determines if the modal is visible.
*/
isVisible: boolean;
/**
* The background color of the modal overlay.
* @default 'rgba(0, 0, 0, 0.5)'
*/
backgroundColor?: string;
/**
* The color of the loading spinner and text.
* @default 'black'
*/
displayColor?: string;
}
export type LoadingModalType = (options: LoadingModalOptions) => JSX.Element;
/**
* LoadingModal component displays a centered loading spinner with text in a modal overlay.
*
* This component is useful for indicating loading states with a customizable background and display color.
*
* @component
* @param {LoadingModalOptions} props - Configuration options for the LoadingModal component.
* @param {boolean} props.isVisible - Controls the visibility of the modal.
* @param {string} [props.backgroundColor='rgba(0, 0, 0, 0.5)'] - Background color of the modal overlay.
* @param {string} [props.displayColor='black'] - Color for the loading spinner and text.
*
* @returns {JSX.Element} The rendered LoadingModal component.
*
* @example
* ```tsx
* import React from 'react';
* import { LoadingModal } from 'mediasfu-reactnative';
*
* function App() {
* return (
* <LoadingModal
* isVisible={true}
* backgroundColor="rgba(0, 0, 0, 0.7)"
* displayColor="white"
* />
* );
* }
*
* export default App;
* ```
*/
declare const LoadingModal: React.FC<LoadingModalOptions>;
export default LoadingModal;