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.
onSelection
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.
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.
Methods | Type | Description |
---|---|---|
setLimit | number | sets the number 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 | Array<string> | used for fetching users containing the passed tags |
setTags | Array<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 | Array<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 |
Avatar
component in the Add Members Component, you can use the following code snippet. For further insights on Avatar
Styles refer
ListItemStyle
component in the Add Members
Component, you can use the following code snippet. For further insights on ListItemStyle
Styles refer
Property | Description | Code |
---|---|---|
title | Used to set title in the app bar | title?: string; |
searchPlaceholderText | Used to set search placeholder text | searchPlaceholderText?: string; |
backButtonIcon | Used to set back button icon | backButtonIcon?: ImageURISource |
showBackButton | Used to toggle visibility for back button | showBackButton?: 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 |
disableUsersPresence | Used to control visibility of user indicator shown if user is online | disableUsersPresence?: boolean |
selectionIcon | Used to override the default selection complete icon | selectionIcon?: ImageURISource |
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 |
group | Used to pass group object of which group members will be shown | group={chatGroup} |
LoadingStateView
to match the loading view of your app.
EmptyStateView
using EmptyStateView
to match the empty view of your app.