CometChatDetails
is a Component that provides additional information and settings related to a specific group.
The details screen includes the following elements and functionalities:
onBack
event is typically triggered when the back button is clicked and it does not carry a default action.
With the following code snippet, you can effortlessly override this default operation.
CometChatDetails
component does not have available filters.
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.
The list of Group Related Events
emitted by the Details component is as follows:
Event | Description |
---|---|
ccGroupLeft | This event is triggered when the group member leaves the group successfully |
ccGroupDeleted | This event is triggered when the group member deletes the group successfully |
DetailsStyle
to the User Details Component to customize the styling.
Property | Description | Code |
---|---|---|
height | Used to set height | height?: string; |
width | Used to set width | width?: string; |
backgroundColor | Used to set background colour | backgroundColor?: string; |
border | Used to set border | border?: BorderStyleInterface, |
borderRadius | Used to set border radius | borderRadius?: string; |
titleFont | Used to customise the font of the title in the app bar | titleFont?: FontStyleInterface; |
titleColor | Used to customise the color of the title in the app bar | titleColor?: string; |
backIconTint | Sets the color of the back icon of the component | backIconTint?: string; |
closeIconTint | Sets the color of the close icon of the component | closeIconTint?: string; |
onlineStatusColor | Sets the color of the status indicator representing the user’s online status | onlineStatusColor?: string; |
StatusIndicator
component in the Details
Component, you can use the following code snippet. For further insights on StatusIndicator
Styles refer
Avatar
component in the Conversations
Component, you can use the following code snippet. For further insights on Avatar
Styles refer
Property | Description | Code |
---|---|---|
group | Used to set the group | user: CometChat.User; |
title | Used to set title in the app bar | title?: string; |
showCloseButton | Used to toggle visibility for back button | showCloseButton?: boolean |
closeButtonIcon | Used to override the default close/back icon | closeButtonIcon?: ImageURISource |
hideProfile | Used to hide user profile view | hideProfile?: boolean; |
disableUsersPresence | Used to control visibility of user indicator shown if user is online | disableUsersPresence?: boolean |
searchBoxIcon | Used to set search Icon in the search field | searchBoxIcon?: ImageURISource |
hideSearch | Used to toggle visibility for search box | hideSearch?: boolean |
hideError | Used to hide error on fetching users | hideError?: boolean |
hideSeparator | Used to hide the divider separating the user items | hideSeparator?: boolean |
emptyStateText | Used to set a custom text response when fetching the users has returned an empty list | emptyStateText?: string |
errorStateText | Used to set a custom text response when some error occurs on fetching the list of users | errorStateText?: string |
data | Used to pass custom details template | data?: ({user, group,}: {user?: CometChat.User;group?: CometChat.Group;}) => CometChatDetailsTemplate[]; |
leaveGroupButtonText | Used to set custom leave group button text | leaveGroupButtonText='Your Custom Leave Button Text' |
leaveGroupCancelButtonText | Used to set cancel leave group button text | leaveGroupCancelButtonText='Your Custom Cancel Button Text' |
deleteGroupButtonText | Used to set delete group button text | deleteGroupButtonText='Your Custom delete Button Text' |
deleteGroupCancelButtonText | Used to set cancel delete group button text | deleteGroupCancelButtonText='Your Custom transfer Button Text' |
leaveGroupConfirmDialogMessage | Custom message for leave confirm dialog | leaveGroupConfirmDialogMessage?: string |
deleteGroupConfirmDialogMessage | Custom message for delete confirm dialog | deleteGroupConfirmDialogMessage?: string |
SubtitleView
to the Details Component.
Custom ProfileView
to the Details Component.
CometChatDetailsTemplate
offers a structure for organizing information in the CometChat details component. It serves as a blueprint, defining how user-related details are presented. This structure allows for customization and organization within the CometChat interface.
This defines the structure of template data for the details component.
Name | Type | Description |
---|---|---|
id | string | number | Identifier for the template option |
title | string | Heading text for the template option |
titleColor | string | User-defined UI component to customise the trailing view for each option in a template. |
titleFont | FontStyleInterface | User-defined UI component to override the default view for the option. |
titleStyle | TextStyle | Function invoked when user clicks on the option. |
sectionSeparatorColor | string | Sets all the different properties of font for the title text |
itemSeparatorColor | string | Sets the foreground colour of title text |
hideSectionSeparator | boolean | Image url for the icon to symbolise an option |
hideItemSeparator | boolean | Color applied to the icon of the option |
options | CometChatDetailsOption[] | Sets the CometChatDetailsOption s |
DetailsOption
defines the structure for individual options within the CometChat details component, facilitating customization and functionality for user interactions.
This defines the structure of each option for a template in the details component.
Property | Type | Description |
---|---|---|
id | string | number | Identifier for the template |
title | string | Heading text for the template |
titleStyle | TextStyle | Sets the title style |
icon | ImageType | Sets all the different properties of font for the title text |
iconTint | string | Sets the icon tint` |
backgroundColor | string | Sets the background color |
CustomView | () => JSX.Element | Sets custom view for the option |
Tail | () => JSX.Element | Sets the tail view for the option |
height | number | Sets the height |
onClick | ({ user, group }: { user?: any; group?: any }) => void; | Sets the onClick Handler for the option |
Add Members
, Banned Members
, Transfer Ownership
and Group Members
component. Hence, each of these components will have its individual `Configuration“.
Configurations
expose properties that are available in its individual components.groupMembersConfiguration
. You can accomplish this by employing the groupMembersConfiguration
props as demonstrated below:
GroupMembersConfiguration
can be found under Group Members. 🛑 symbol are not accessible within the Configuration Object.
Example
Let’s say you want to change the style of the Group Member subcomponent and, in addition, you only want to hide separator and left allign the title.
You can change the title using title
property and hide the separator using hideSeperator
property.
AddMembersConfiguration
. You can accomplish this by employing the addMembersConfiguration
props as demonstrated below:
AddMembersConfiguration
can be found under Add Members. 🛑 symbol are not accessible within the Configuration Object.
Example
Let’s say you want to change the style of the Add Members subcomponent and, in addition, you only want to show section header.
You can modify the style using the addMembersStyle
property and shide the separator using hideSeparator
property.
BannedMembersConfiguration
. You can accomplish this by employing the bannedMembersConfiguration
props as demonstrated below:
BannedMembersConfiguration
can be found under Banned Members. 🛑 symbol are not accessible within the Configuration Object.
Example
Let’s say you want to change the style of the Banned Members subcomponent and, in addition, you only want to hide the search bar.
You can modify the style using the bannedMembersStyle
property and hide the search bar using hideSearch
property.
TransferOwnershipConfiguration
. You can accomplish this by employing the transferOwnershipConfiguration
props as demonstrated below:
TransferOwnershipConfiguration
can be found under Transfer Ownership. 🛑 symbol are not accessible within the Configuration Object.
Example
Let’s say you want to change the style of the Transfer Ownership subcomponent and, in addition, you only want to disable the users presence.
You can modify the style using the transferOwnershipStyle
property and disable the users presence using disableUsersPresence
property.