This repository contains functions developed for integrating CometChat into the lincd platform.
This function is responsible for ensuring the smooth loading of the CometChat extension on the CometChat frontend, particularly when fetching group information and related data.
import { loadMessageExtension } from 'lincd-cometchat';
loadMessageExtension();
This function renders a modal allowing users to report messages and block other users within the CometChat environment.
import {ReportMessageModal} from 'lincd-cometchat/lib/MessageExtension
return(
<ReportMessageModal
..props
blockUser={blockUser}
message={messageSelected}
onClose={() => setOnReport(false)}
getReason={(reason) => setReasonReported(reason)}
deleteAndReportMessage={deleteAndReportMessage}
handleReportError={handleReportError}
/>
)
Check all the props on interface
These functions require certain props and methods extracted from the chat pages (initial pages). The following props and methods are necessary:
blockUser={blockUser}
message={messageSelected}
onClose={() => setOnReport(false)}
getReason={(reason) => setReasonReported(reason)}
deleteAndReportMessage={deleteAndReportMessage}
handleReportError={handleReportError}
loadMessageExtension: Ensures smooth loading of the CometChat extension. fetchMessageTemplates: Retrieves CometChat message template categories and messages. Other optional methods or options necessary for the proper functioning of the required extensions. Ensure all required props and methods are imported from the previous project for seamless integration and functionality.
import React, { useEffect } from 'react'; import { loadMessageExtension, fetchMessageTemplates } from 'lincd-cometchat';
const ChatPage = () => { useEffect(() => { loadMessageExtension(); fetchMessageTemplates(); // Other necessary methods or options }, []);
return (
export default ChatPage;