hamrochat-snippet
v1.0.5
Published
library to load messages in hamro chat
Downloads
3
Maintainers
Readme
hamrochat-snippet
library to load messages in hamro chat
Installation
Use the package manager to install hamrochat-snippet.
npm install hamrochat-snippet
Usage
import "hamrochat-snippet/dist/index.css"; //in the root file
import { loadSnippet } from "hamrochat-snippet";
<div>
<div id="chat-snippet"></div>
{loadSnippet("chat-snippet", message, true, click, longPress, dataObject)}
</div>
Parameters in order
snippetId: string, //id of the container where you want to load message snippet.
message: Message //chat message object.
isMyMessage: boolean,
onClickHandler ?: () => any, //callback to handle event on click.
onLongPressHandler ?: () => any, //callback to handle event on long press
metaData ?: MetaDataObject, //overrides message object and loads card/snippet component