CometChatAddMembers
is a Component that allows administrators or group owners to add new members to a specific group. It enables administrators or group owners to extend the membership of a group by adding new users to participate in the group’s discussions and activities. By utilising this feature, administrators can manage group membership, and control access to group content. The administrator can select the desired users to be added to the group. This can be done by searching for specific users, selecting from a list of available users. The selected users will receive notifications to join the group.
Components | Description |
---|---|
cometchat-button | This component represents a button with optional icon and text. |
CometChatUsers | This component the list of users |
onSelect
action is activated when you select the done icon while in selection mode. This returns a list of all the users that you have selected.
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.
onAddMembersButtonClick
action is triggered when you click the add member button after choosing the users you wish to add in the group. By default, it returns the group GUID and an array of members to be added. However, you have the flexibility to override this event and tailor it to suit your needs using the following code snippet.
OnBack
is triggered when you click on the back button of the Add Members component. You can override this action using the following code snippet.
onClose
is triggered when you click on the close button of the Add Members component. You can override this action using the following code snippet.
Methods | Type | Description |
---|---|---|
setLimit | number | sets the number of users that can be fetched in a single request, suitable for pagination |
setSearchKeyword | String | used for fetching users matching the passed string |
hideBlockedUsers | boolean | used for fetching all those users who are not blocked by the logged in user |
friendsOnly | boolean | used for fetching only those users in which logged in user is a member |
setRoles | List<String> | used for fetching users containing the passed tags |
setTags | List<String> | used for fetching users containing the passed tags |
withTags | boolean | used for fetching users containing tags |
setStatus | String | used for fetching users by their status online or offline |
setUIDs | List<String> | used for fetching users containing the passed users |
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.
Events emitted by the Add Members component is as follows.
Event | Description |
---|---|
ccGroupMemberAdded | Triggers when a user added to a group successfully |
CometChatGroupEvents
Listener’s
AddMembersStyle
to the Add Members 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 set title text font | titleTextFont?: string, |
titleTextColor | Used to set title text color | titleTextColor?: string; |
searchPlaceholderTextFont | Used to set search placeholder font | searchPlaceholderTextFont?: string; |
searchPlaceholderTextColor | Used to set search placeholder color | searchPlaceholderTextColor?: string; |
searchTextFont | Used to set search text font | searchTextFont?: string; |
searchTextColor | Used to set search text color | searchTextColor?: string; |
emptyStateTextFont | Used to set empty state text font | emptyStateTextFont?: string; |
emptyStateTextColor | Used to set empty state text color | emptyStateTextColor?: string; |
errorStateTextFont | Used to set error state text font | errorStateTextFont?: string; |
errorStateTextColor | Used to set error state text color | errorStateTextColor?: string; |
loadingIconTint | Used to set loading icon tint | loadingIconTint?: string; |
searchIconTint | Used to set search icon tint | searchIconTint?: string; |
searchBorder | Used to set search border | searchBorder?: string; |
searchBorderRadius | Used to set search border radius | searchBorderRadius?: string; |
searchBackground | Used to set search background color | searchBackground?: string; |
onlineStatusColor | Used to set online status color | onlineStatusColor?: string; |
separatorColor | Used to set separator color | separatorColor?: string; |
sectionHeaderTextFont | Used to set section header text font | sectionHeaderTextFont?: string; |
sectionHeaderTextColor | Used to set section header text color | sectionHeaderTextColor?: string; |
boxShadow | Used to set box shadow | boxShadow?: string; |
backButtonIconTint | Used to set back button icon tint | backButtonIconTint?: string; |
closeButtonIconTint | Used to set close button icon tint | closeButtonIconTint?: string; |
addMembersButtonBackground | Used to set add members button background color | addMembersButtonBackground?: string; |
addMembersButtonTextColor | Used to set add members button text color | addMembersButtonTextColor?: string; |
addMembersButtonTextFont | Used to set add members button text font | addMembersButtonTextFont?: string; |
padding | Used to set padding | padding?: string; |
Avatar
component in the Add Members Component, you can use the following code snippet. For further insights on Avatar
Styles refer
List Item
component in the Add Members
Component, you can use the following code snippet. For further insights on List Item
Styles refer
Property | Description | Code |
---|---|---|
title | Used to set title in the app heading | [title]="'Your Custom Title'" |
buttonText | Used to set a custom button text for the add members button | [buttonText]="'your custom button text'" |
errorStateText | Used to set a custom text response when some error occurs on fetching the list of users | [errorStateText]="'your custom error state text'" |
emptyStateText | Used to set a custom text response when fetching the users has returned an empty list | [emptyStateText]="'your custom empty state text'" |
searchPlaceholder | Used to set custom search placeholder text | [searchPlaceholder]="'Custom Search PlaceHolder'" |
searchIconURL | Used to set search Icon in the search field | [searchIconURL]="searchIconURL" |
loadingIconURL | Used to set loading Icon | [loadingIconURL]="loadingIconURL" |
closeButtonIconURL | Used to set close button Icon | [closeButtonIconURL]="closeButtonIconURL" |
backButtonIconURL | Used to set the back button Icon | [backButtonIconURL]="backButtonIconURL" |
hideError | Used to hide error on fetching users | [hideError]="true" |
hideSearch | Used to toggle visibility for search box | [hideSearch]="true" |
hideSeparator | Used to hide the divider separating the user items | [hideSeparator]="true" |
disableUsersPresence | Used to toggle functionality to show user’s presence | [disableUsersPresence]="true" |
showBackButton | Hides / shows the back button as per the boolean value | [showBackButton]="true" |
sectionHeaderField | used to extract the section header character from the user object and show on the section header | [sectionHeaderField]="sectionHeaderField" |
showSectionHeader | Hides / shows the section header as per the boolean value | [showSectionHeader]="true" |
selectionMode | set the number of users that can be selected, SelectionMode can be single, multiple or none. | [selectionMode]="selectionMode" |
titleAlignment | Alignment of the heading text for the component | [titleAlignment]="titleAlignment" |
group | Used to pass group object of which group members will be shown | [group]="groupObject" |
loadingStateView
to match the loading view of your app.
Default:
EmptyStateView
using emptyStateView
to match the empty view of your app.
Default:
ErrorStateView
using errorStateView
to match the error view of your app.
Default: