UNPKG

@cometchat/chat-uikit-react-native

Version:

Ready-to-use Chat UI Components for React Native

55 lines (54 loc) 1.62 kB
import React from "react"; import { ImageSourcePropType, ImageStyle, ViewStyle } from "react-native"; /** * Props for the CometChatImageLoader component. */ export interface CometChatImageLoaderPropType { /** * Image URL passed as an object with a `uri` property. * Example: `{ uri: "dummyUrl" }` */ imageUrl: ImageSourcePropType; /** * Thumbnail image URL. * * @type {ImageSourcePropType} * @description Thumbnail image to display while the full image loads. */ thumbnailUrl?: ImageSourcePropType; /** * Placeholder image to display while loading. */ placeHolderImage?: ImageSourcePropType; /** * Custom callback function to execute when the image is pressed. */ onPress?: Function; /** * Custom style for the image. */ style?: ImageStyle; /** * Resize mode for the image. * * @default "cover" */ imageResizeMode?: "cover" | "contain" | "stretch" | "repeat" | "center"; /** * Size of the activity indicator. */ activityIndicatorSize: number; /** * Custom style for the view containing the activity indicator. */ activityIndicatorViewStyle: ViewStyle; } /** * CometChatImageLoader is a component that displays an image with an activity indicator * until the image is loaded. It supports thumbnail prefetching and opens an image viewer * modal on a quick tap. * * Props for the component. * The rendered image loader component. */ export declare const CometChatImageLoader: (props: CometChatImageLoaderPropType) => React.JSX.Element;