CometChatDetails
is a Component that provides additional information and settings related to a specific group.
The details screen includes the following elements and functionalities:
onClose
event is typically triggered when the close button is clicked and it carries a default action. However, with the following code snippet, you can effortlessly override this default operation.
This action does not come with any predefined behavior. However, you have the flexibility to override this event and tailor it to suit your needs using the following code snippet.
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.
To handle events supported by Groups you have to add corresponding listeners by using CometChatGroupEvents
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. |
CometChatGroupEvents
Listener’s
DetailsStyle
to the Details Component to customize the styling.
Property | Description | Code |
---|---|---|
border | Used to set border | border?: string, |
borderRadius | Used to set border radius | borderRadius?: string; |
background | Used to set background colour | background?: string; |
height | Used to set height | height?: string; |
width | Used to set width | width?: string; |
titleTextFont | Used to customise the font of the title in the app bar | titleTextFont?: string; |
titleTextColor | Used to customise the color of the title in the app bar | titleTextColor?: string; |
onlineStatusColor | Sets the color of the status indicator representing the user’s online status | onlineStatusColor?: string; |
subtitleTextFont | Sets all the different properties of font for the subtitle text | subtitleTextFont?: string; |
subtitleTextColor | Sets the color of the subtitle text | subtitleTextColor?: string; |
closeButtonIconTint | Sets the color of the close icon of the component | closeButtonIconTint?: string; |
privateGroupIconBackground | Used to set private group icon background | privateGroupIconBackground?: string, |
passwordGroupIconBackground | Used to set password group icon background | passwordGroupIconBackground?: string; |
padding | Used to set padding | padding?:string; |
leaveGroupDialogStyle
to the Details Component to customize the styling.
deleteGroupDialogStyle
to the Details Component to customize the styling.
Avatar
component in the Details Component, you can use the following code snippet. For further insights on Avatar
Styles refer
List Item
component in the Details
Component, you can use the following code snippet. For further insights on List Item
Styles refer
Backdrop
component in the Details
Component, you can use the following code snippet, you can use the following code snippet. For further insights on Backdrop
Styles refer
Property | Description | Code |
---|---|---|
title | Used to set title in the app heading | [title]="'Your Custom Title'" |
leaveButtonText | Used to set custom leave button text | [leaveButtonText]="'Your Custom Leave Button Text'" |
cancelButtonText | Used to set custom cancel button text | [cancelButtonText]="'Your Custom Cancel Button Text'" |
deleteButtonText | Used to set delete cancel button text | [deleteButtonText]="'Your Custom delete Button Text'" |
transferButtonText | Used to set transfer cancel button text | [transferButtonText]="'Your Custom transfer Button Text'" |
closeButtonIconURL | Used to set close button Icon | [closeButtonIconURL]="closeButtonIconURL" |
hideProfile | Used to hide profile | [hideProfile]="true" |
disableUsersPresence | Used to toggle functionality to show user’s presence | [disableUsersPresence]="true" |
group | Used to pass group object of which group details to be shown | [group]="groupObject" |
user | Used to pass user object of logged in user for the group | [user]="userObject" |
data | Used to pass custom details template | data?: ({user, group,}: {user?: CometChat.User;group?: CometChat.Group;}) => CometChatDetailsTemplate[]; |
leaveConfirmDialogMessage | Custom message for leave confirm dialog | [leaveConfirmDialogMessage]="'YOUR CUSTOM LEAVE CONFIRM DIALOG MESSAGE'" |
transferConfirmDialogMessage | Custom message for transfer confirm dialog | [transferConfirmDialogMessage]="'YOUR CUSTOM TRANSFER CONFIRM DIALOG MESSAGE'" |
deleteConfirmDialogMessage | Custom message for delete confirm dialog | [deleteConfirmDialogMessage]="'YOUR CUSTOM DELETE CONFIRM DIALOG MESSAGE'" |
CometChatDetailsTemplate
offers a structure for organizing information in the CometChat details component. It serves as a blueprint, defining how group-related details are presented. This structure allows for customization and organization within the CometChat interface.
Name | Type | Description |
---|---|---|
id | String | Identifier for the template |
title | String | Heading text for the template |
titleFont | String | Sets all the different properties of font for the title text |
titleColor | String | Sets the foreground color of title text |
itemSeparatorColor | String | Sets the color of the template’s option separator |
hideItemSeparator | Boolean | When set to true, hides the separator under each option in a template |
sectionSeparatorColor | String | Sets the color of the template separator |
hideSectionSeparator | Boolean | When set to true, hides the separator for the template |
options | CometChatDetailsTemplate.options?: ((loggedInUser: User | null, group: Group | null, section: string) => CometChatDetailsOption[]) | null | undefined | defines the structure for individual options |
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.
Name | Type | Description |
---|---|---|
id | String | Identifier for the template option |
title | String | Heading text for the template option |
tail | any | User-defined UI component to customise the trailing view for each option in a template. |
customView | any | User-defined UI component to override the default view for the option. |
onClick | ((item: CometChat.User | CometChat.Group) => void) | null; | Function invoked when user clicks on the option. |
titleFont | String | Sets all the different properties of font for the title text |
titleColor | String | Sets the foreground colour of title text |
iconURL | String | Image url for the icon to symbolise an option |
iconTint | String | Color applied to the icon of the option |
backgroundColor | String | Color applied to the background of 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:
All exposed properties of GroupMembersConfiguration
can be found under Group Members. Properties marked with the 🛑 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 modify the style using the groupMembersStyle
property, hide the separator using hideSeparator
property and allign the title using titleAlignment
property.
AddMembersConfiguration
. You can accomplish this by employing the addMembersConfiguration
props as demonstrated below:
All exposed properties of AddMembersConfiguration
can be found under Add Members. Properties marked with the 🛑 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 show the section header using showSectionHeader
property.
BannedMembersConfiguration
. You can accomplish this by employing the bannedMembersConfiguration
props as demonstrated below:
All exposed properties of BannedMembersConfiguration
can be found under Banned Members. Properties marked with the 🛑 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:
All exposed properties of TransferOwnershipConfiguration
can be found under Transfer Ownership. Properties marked with the 🛑 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.