LMFeedModerationContext
Introduction
The LMFeedModerationContext
provides data and functions for LMFeedModeration
and its children. It allows for building a custom UI for moderation, post approval, and member rights management.
Context Properties
Key | Type | Description | Optional |
---|---|---|---|
selectedTab | string | Currently selected moderation tab. | Yes |
selectTab | (tab: string) => void | Function to change the selected tab. | Yes |
isPostApprovalEnabled | boolean | Indicates if post approval is enabled. | Yes |
reports | GroupReport[] | List of reported posts. | Yes |
posts | Record<string, Post> | Collection of posts. | Yes |
comments | Record<string, Comment> | Collection of comments. | No |
users | Record<string, User> | Collection of users. | Yes |
widgets | Record<string, Widget> | Collection of widgets. | Yes |
topics | Record<string, Topic> | Collection of topics. | Yes |
handleOnApprovedPostClicked | (reportIds: number[]) => Promise<void> | Function to approve posts. | No |
handleOnRejectedPostClicked | (reportIds: number[]) => Promise<void> | Function to reject posts. | No |
onApprovedCallback | (groupReport: GroupReport) => Promise<void> | Callback triggered after a post is approved. | No |
onRejectedCallback | (groupReport: GroupReport, postId: string) => Promise<void> | Callback triggered after a post is rejected. | No |
editMemberPermissionsHandler | (uuid: string) => Promise<void> | Function to edit member permissions. | No |
updateMemberRightsHandler | () => Promise<void> | Function to update member rights. | No |
handleHeaderLeadingTap | () => void | Function triggered on leading header tap. | Yes |
handleHeaderTextTap | () => void | Function triggered on header text tap. | Yes |
handleHeaderTrailingTap | () => void | Function triggered on trailing header tap. | Yes |
memberRights | MemberRights[] | List of member rights. | Yes |
isEditPermissionDialogOpen | boolean | Indicates if the edit permission dialog is open. | Yes |
setIsEditPermissionDialogOpen | React.Dispatch<React.SetStateAction<boolean>> | Function to toggle the edit permission dialog. | No |
modifiedRights | MemberRights[] | List of modified rights. | No |
setModifiedRights | React.Dispatch<React.SetStateAction<MemberRights[] >> | Function to set modified rights. | No |
customTitle | string | Custom title for the moderation section. | No |
setCustomTitle | React.Dispatch<React.SetStateAction<string>> | Function to set the custom title. | No |
currentReport | GroupReport | null | Currently selected report. | Yes |
setCurrentReport | React.Dispatch<React.SetStateAction<GroupReport | null>> | Function to set the current report. | No |
loadMoreFeeds | boolean | Indicates if more feeds should be loaded. | Yes |
getNextPage | () => void | Function to fetch the next page of moderation data. | Yes |
isLoading | boolean | Indicates if data is currently being loaded. | Yes |
Example
For an example implementation, check out this reference.