Skip to main content
Version: v4

Banned Members

This component lists all the users who have been restricted or prohibited from participating in specific groups or conversations. When the user is banned, they are no longer able to access or engage with the content and discussions within the banned group.

Here are a few key points related to banned members:

  1. Administrative Control: Group administrators or owners have the authority to ban members from specific groups they manage. They can review user activity, monitor behavior, and take appropriate actions, including banning users when necessary.
  2. Restrictions on Participation: Banned members are denied access to the group they were banned from. They cannot view or interact with the group's messages, shared content, or other group members. Banning effectively removes their presence and contribution from the group.

Properties

Group Information

Group details associated with the group members.

NameTypeDescription
groupGroup ClassBan members of this particular CometChat group

Title

Heading text for the component

NameTypeDescription
titlestringHeading text for the component
titleAlignmentstringAlignment of the heading text for the component

This involves keywords, phrases, or criteria into the search bar and retrieving relevant results based on the search query.

NameTypeDescription
searchPlaceholderstringSample text that appears in the search input as a prompt or suggestion
searchIconURLstringAsset URL for the search icon.
hideSearchbooleanWhen set to true, hides the search input.

Loading state

This refers to the state of the groups component when it is actively retrieving or fetching data.

NameTypeDescription
loadingIconURLstringAsset URL for the loading indicator icon
loadingStateViewviewUser-defined component to customise the loading indicator

Empty state

This refers to the state of the groups component when it has no content or data to display

NameTypeDescription
emptyStateTextstringThe textual content displayed in the empty state of the component.
emptyStateViewviewUser-defined component to customise the empty state of the component.

Error state

This refers to the state of the groups component when an error occurs during the retrieval of the data.

NameTypeDescription
errorStateTextstringThe textual content displayed in the error state of the component.
errorStateViewviewUser-defined component to customise the error state of the component.

RequestBuilder

This provides set of methods that allow developers to easily create and configure group members before fetching them for the intended recipients.

NameTypeDescription
searchRequestBuilderCometChat.BannedMembersRequestBuilderClass that allows you to set various parameters to the BannedMembersRequestBuilder class based on which the group members are searched
bannedMembersRequestBuilderCometChat.BannedMembersRequestBuilderClass that allows you to set various parameters to the BannedMembersRequestBuilder class based on which the group members are fetched

Asset URLs

Custom asset URL used for graphical representation

NameTypeDescription
unbanIconURLstringAsset URL for the unban icon

Toggle

Switch to hide or show the separators, and error message.

NameTypeDescription
hideErrorbooleanWhen set to true, hides the error messages displayed within the component
hideSeparatorbooleanWhen set to true, hides the separator between the individual elements in the list.
disableUsersPresencebooleanWhen set to true, Users will not be able to see whether a particular user is currently online or offline.

selectionMode

Allows user to choose individual or multiple items.

NameTypeDescription
selectionModeSelectionModeAllows user to select individual or multiple items for applying specific operations.
onSelectFunction as PropType<(bannedMember: CometChat.GroupMember[]) => void>Method invoked which returns the selected group members.

Custom view

UI component created and customised by the developer to meet your design or functional requirements.

NameTypeDescription
subtitleViewFunction as PropType<(bannedMember: CometChat.GroupMember) => ViewType>User-defined component to customise the secondary text shown in the banned member profile.
tailViewFunction as PropType<(bannedMember: CometChat.GroupMember) => ViewType>User-defined component to customise the trailing view of the banned member profile.

UI component created and customised by the developer to meet your design or functional requirements representing the button actions in the header section.

NameTypeDescription
menuviewUser-defined component to showcase options related to the group members in the header section.

Actions

This includes action buttons or icons that allow users to perform common actions or tasks, such as muting the notification etc.

NameTypeDescription
optionsFunction as PropType<(bannedMember: CometChat.GroupMember) => CometChatOption[]>User-defined actions which appears for each banned member on mouseover.

Function Callback

Functions that can be invoked by the user in response to a specific event or condition.

NameTypeDescription
onBackFunction as PropType<()=>void>Override the method that is invoked when the user clicks on the back button.
onErrorFunction as PropType<(error: CometChat.CometChatException) => void>Override the method that is invoked when an error is encountered within the component

Back button

This allows users to navigate to the previous screen or page they were viewing.

NameTypeDescription
backButtonIconURLstringAsset URL for the back button icon
showBackButtonbooleanWhen set to true, displays the back button

Style

Styling properties and values of the groups component

NameTypeDescription
avatarStyleAvatarStyleStyling properties and values of the Avatar component
statusIndicatorStyleStatusIndicatorStyling properties and values of the StatusIndicator component
listItemStyleListItemStyleStyling properties and values of the ListItem component
bannedMembersStyleBannedMembersStyleStyling properties and values of the Banned Members component

Events

To handle events supported by CometChatBannedMembers component you have to add the listeners mentioned here.

onBeforeMount(() => {
CometChatGroupEvents.ccGroupMemberBanned.subscribe(
({ item: IGroupMemberKickedBanned }) => {
//Proceed with UI updates
}
);

CometChatGroupEvents.ccGroupMemberUnbanned.subscribe(
({ item: IGroupMemberKickedBanned }) => {
//Proceed with UI updates
}
);
});

onBeforeUnmount(() => {
CometChatGroupEvents.ccGroupMemberBanned.unsubscribe();
CometChatGroupEvents.ccGroupMemberUnbanned.unsubscribe();
});

Usage

//custom request builder
const requestBuilder:CometChat.BannedMembersRequestBuilder = new CometChat.BannedMembersRequestBuilder()
.setLimit(30)
.setSearchKeyword("xyz")
.build();

//apply custom request builder to CometChatBannedMembers component
<CometChatBannedMembers :bannedMembersRequestBuilder="requestBuilder"></CometChatBannedMembers>