MessageContent
Component to render content of a message within the MessageList
. Message avatar and reactions are not part of MessageContent
.
This is the default component provided to the prop MessageContent
on the Channel
component.
#
Propsoverrides the value from MessagesContext additionalTouchableProps#
Additional props provided to the underlying TouchableOpacity used by components within a message such as MessageContent
.
Type |
---|
object |
overrides the value from MessageContext alignment#
Sets if the message should be aligned to right or left side of list.
Type | Default |
---|---|
enum('right', 'left') | 'right' |
overrides the value from MessageContext disabled#
True if channel is frozen and disableIfFrozenChannel is true.
Type |
---|
boolean |
overrides the value from MessagesContext formatDate
#
Format function that returns a string to be used for the date in the message status and delete message component.
Type |
---|
function |
Parameter | Description |
---|---|
date | date to format provided as a string, Date, or number (Unix Timestamp) |
overrides the value from MessageContext groupStyles
#
Position of message in the group. A message group is a group of consecutive messages from the same user. groupStyles
can be used to style the message as per their position in message group.
for example user avatar (to which message belongs to) is only showed for last (bottom) message in group.
Type |
---|
array of enum('top', 'bottom', 'middle', 'single') |
overrides the value from MessageContext hasReactions#
True if the message has at least 1 reaction.
Type |
---|
boolean |
overrides the value from MessageContext isMyMessage#
True if the message is sent by current user (connected to chat).
Type |
---|
boolean |
overrides the value from MessageContext lastGroupMessage#
Whether or not this is the last message in a group of messages.
Type |
---|
boolean |
overrides the value from MessageContext members#
Members of current channel. This value is received from backend when you query a channel, either using client.queryChannels()
or channel.watch()
API call.
caution
client.queryChannels()
or channel.watch()
returns only up to 100 members of channel. So if you expect total number of members to be > 100, its better to use client.queryMembers()
API endpoint separately to get the list of members.
Record<
string, // userId
{
banned?: boolean;
created_at?: string;
invite_accepted_at?: string;
invite_rejected_at?: string;
invited?: boolean;
is_moderator?: boolean;
role?: string;
shadow_banned?: boolean;
updated_at?: string;
user?: UserResponse<UserType>;
user_id?: string;
}
>;
Type |
---|
object |
overrides the value from MessageContext message#
Message object
Type |
---|
object |
overrides the value from MessageContext messageContentOrder#
Order of message content.
for example ['quoted_reply', 'attachments', 'file', 'gallery', 'text']
Type |
---|
array |
overrides the value from MessageContext onLongPress#
Default long press handler for message UI.
Type |
---|
function |
overrides the value from MessageContext onlyEmojis
#
True if the message text only contains emojis and nothing else.
Type |
---|
boolean |
overrides the value from MessageContext onPress
#
Default press handler for message UI.
Type |
---|
function |
overrides the value from MessageContext onPressIn#
Default pressIn
handler for message UI.
Type |
---|
function |
overrides the value from MessageContext otherAttachments
#
All the attachments on the message except for types file
and image
.
Type |
---|
array |
overrides the value from MessageContext showMessageStatus#
When false, message status (read receipt, pending state indicator) won't be rendered. By default, this value is true for messages sent by current user of chat.
Type |
---|
boolean |
overrides the value from MessagesContext quotedRepliesEnabled#
Allow messages to be replied to using inline quotation.
Type | Default |
---|---|
boolean | true |
overrides the value from MessageContext threadList
#
True if current message is part of a message thread.
Type |
---|
boolean |
overrides the value from MessagesContext threadRepliesEnabled#
Allow messages to be replied to in a thread. The default value is supplied by the channel config.
Type |
---|
boolean |
overrides the value from MessagesContext Attachment#
Component for rendering attachments in MessageList.
Available props:
attachment
{object}
Type | Default |
---|---|
component | Attachment |
overrides the value from MessagesContext FileAttachmentGroup#
Component to render group of file
type attachments, when there are multiple file
type attachments in message.
Type | Default |
---|---|
component | FileAttachmentGroup |
overrides the value from MessagesContext Gallery#
Component to render 'image' type attachments in the MessageList
.
Type | Default |
---|---|
component | Gallery |
overrides the value from MessagesContext MessageDeleted#
Component to render deleted message.
Type | Default |
---|---|
component | MessageDeleted |
overrides the value from MessagesContext MessageFooter#
Component to render footer for message, within MessageList
.
Type | Default |
---|---|
component | MessageFooter |
overrides the value from MessagesContext MessageHeader#
Component to render header for message, within MessageList
.
Type |
---|
component |
overrides the value from MessagesContext MessageReplies#
Component to show number of thread replies and avatars of members who replied on message
Type | Default |
---|---|
component | MessageReplies |
overrides the value from MessagesContext MessageStatus#
Component to render status of message, which includes time and read-receipts.
Type | Default |
---|---|
component | MessageStatus |
overrides the value from MessagesContext Reply#
Component to render preview of parent of message for quoted reply.
Type | Default |
---|---|
component | Reply |