OnItemPress
is triggered when you press on a ListItem of the Conversations component. The OnItemPress
action doesn’t have a predefined behavior. You can override this action using the following code snippet.
onItemLongPress
is triggered when you long press on a ListItem of the Conversations component. The onItemLongPress
action doesn’t have a predefined behavior. You can override this action using the following code snippet.
onSelection
event is triggered upon the completion of a selection in SelectionMode
. It does not have a default behavior. However, you can override its behavior using the following code snippet.
onBack
is triggered when you press the back button in the app bar. It does not have a default behavior. However, you can override its behavior using the following code snippet.
ConversationsRequestBuilder
in the Conversations Component to filter the conversation list. You can modify the builder as per your specific requirements with multiple options available to know more refer to ConversationRequestBuilder.
You can set filters using the following parameters.
User
or Groups
Tag
Tag
Tag
Component
. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.
ConversationsStyle
to the Conversations
Component to customize the styling.
Name | Type | Description |
---|---|---|
backgroundColor | string | Sets the background colour for Conversations |
height | number | string | Sets the height for Conversations |
borderRadius | number | Sets the border radius for Conversations |
width | number | string | Sets the width for Conversations |
border | BorderStyleInterface | Sets the border colour for Conversations |
titleColor | string | Sets the title colour for Conversations |
titleFont | FontStyleInterface | Sets the title font for Conversations |
backIconTint | string | Sets the back button tint colour for Conversations |
onlineStatusColor | string | Sets the online status colour for Conversations |
separatorColor | string | Sets the separator colour for Conversations |
loadingIconTint | string | Sets the loading icon colour for Conversations |
emptyTextColor | string | Sets the empty text colour for Conversations |
emptyTextFont | FontStyle | Sets the empty text font for Conversations |
errorTextColor | string | Sets the error text colour for Conversations |
errorTextFont | FontStyle | Sets the error text font for Conversations |
lastMessageTextColor | string | Sets the last message text text colour |
lastMessageTextFont | FontStyle | Sets the last message text font for Conversations |
typingIndictorTextColor | string | Sets the typing indicator colour for Conversations |
typingIndictorTextFont | FontStyle | Sets the typing indicator font for Conversations |
threadIndicatorTextFont | FontStyle | Sets the thread indicator text font for Conversations |
threadIndicatorTextColor | string | Sets the thread indicator text font for Conversations |
Avatar
component in the Conversations
Component, you can use the following code snippet. For further insights on Avatar
Styles refer
Conversations
Component, you can use the following code snippet. For further insights on Status Indicator Styles refer
Date
component in the Conversations
Component, you can use the following code snippet. For further insights on Date
Styles refer
Badge
component in the Conversations
Component, you can use the following code snippet. For further insights on Badge
Styles refer
delete dialog
component in the Conversations
Component, you can use the following code snippet.
ListItemStyle
component in the Conversations
Component, you can use the following code snippet. For further insights on ListItemStyle
Styles refer
Property | Description | Code |
---|---|---|
Title | Used to set custom title in the app bar. | title="Your Custom Title" |
EmptyState Text | Used to set a custom text response when fetching the conversations has returned an empty list | emptyStateText="Your Custom Empty State text" |
Selection Mode | Used to set a custom text response when fetching the conversations has returned an empty list | selectionMode={SelectionMode.multiple} |
ProtectedGroup Icon | Used to set icon shown in place of status indicator for password protected group | protectedGroupIcon={{uri: <image url>}} OR import customProtectedGroupIcon from "./customProtectedGroupIcon.svg"; ``protectedGroupIcon={customProtectedGroupIcon} |
privateGroupIcon | Used to set icon shown in place of status indicator for private group | privateGroupIcon={{uri: <image url>}} OR import customPrivateGroupIcon from "./customPrivateGroupIcon.svg"; privateGroupIcon={customPrivateGroupIcon} |
SentIcon | Used to customize the receipt icon shown in the subtitle of the conversation item if hideReceipt is false and if the status of the last message in the conversation is sent | sentIcon={{uri: <image url>}} OR import customSentIcon from "./secustomSentIconntIcon.svg"; sentIcon={customSentIcon} |
Delivered Icon | Used to customize the receipt icon shown in the subtitle of the conversation item if hideReceipt is false and if the status of the last message in the conversation is delivered | deliveredIcon={{uri: <image url>}} OR import customDeliveredIcon from "./customDeliveredIcon.svg"; ``deliveredIcon={customDeliveredIcon} |
Read Icon | Used to customize the receipt icon shown in the subtitle of the conversation item if hideReceipt is false and if the status of the last message in the conversation is read | readIcon={{uri: <image url>}} OR import customReadIcon from "./customReadIcon.svg"; readIcon={customReadIcon} |
errorIcon | Asset URL for the error state indicating that an error has occurred when the message was in transit. | errorIcon={{uri: <image url>}} OR import customErrorIcon from "./customErrorIcon.svg"; errorIcon={customErrorIcon} |
Hide Error | Used to hide error on fetching conversations | hideError={true} |
Hide Separator | Used to control visibility of Separators in the list view | hideSeparator={true} |
Disable UsersPresence | Used to control visibility of status indicator shown if user is online | disableUsersPresence={true} |
Hide Receipt | Used to control the visibility of read receipts without affecting the functionality of marking messages as read and delivered | hideReceipt={false} |
Disable Typing | Used to toggle visibility of typing indicator | disableTyping={true} |
disableSoundForMessages | When set to true, the component will not produce sound for all incoming messages.indicator | disableSoundForMessages={true} |
customSoundForMessages | mp3 file asset of your choice. | import customMessageSound from "./customMessageSound.wav"; customSoundForMessages={customMessageSound} |
disableMentions | Sets whether mentions in text should be disabled. Processes the text formatters If there are text formatters available and the disableMentions flag is set to true, it removes any formatters that are instances of CometChatMentionsFormatter. | disableMentions={true} |
getListItemView
function as follows:
getAppBarOptions
function as follows:
getSubtitleView
function as follows:
Name | Type | Description |
---|---|---|
options? | (item: CometChat.Conversation) => CometChatOptions[] | This prop will add the array of options on swipe to perform actions on Conversation. |
Name | Type | Description |
---|---|---|
id | String | Unique identifier for the option |
title | String | A text to display below the icon |
icon | ImageType | A image to display for the option |
titleStyle | CometChatOptionTitleStyle | Defines the style for the title containing color, fontWeight, fontSize, fontFamily properties |
iconTint | string | Defines the colour for the icon |
backgroundColor | string | Defines the colour for the option |
onPress | Function | The action to perform when user clicks on option |
LoadingStateView
to match the loading view of your app.
getLoadingStateView
function as follows: