lincd-cometchat Report, Block and Message Extension Functions Documentation
Introduction
This repository contains functions developed for integrating CometChat into the lincd platform.
Functions
1. loadMessageExtension()
Purpose
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.
Usage
import { loadMessageExtension } from 'lincd-cometchat';
loadMessageExtension();
2. Render the user interaction modal
Purpose
This function renders a modal allowing users to report messages and block other users within the CometChat environment.
Usage
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
Props and Dependencies
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}
Noted:
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.
Usage:
import React, { useEffect } from 'react';
import { loadMessageExtension, fetchMessageTemplates } from 'lincd-cometchat';
const ChatPage = () => {
useEffect(() => {
loadMessageExtension();
fetchMessageTemplates();
// Other necessary methods or options
}, []);
return (
{/* Your CometChat chat page components */}
);
};
export default ChatPage;