Skip to main content

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

KeyTypeDescriptionOptional
selectedTabstringCurrently selected moderation tab.Yes
selectTab(tab: string) => voidFunction to change the selected tab.Yes
isPostApprovalEnabledbooleanIndicates if post approval is enabled.Yes
reportsGroupReport[]List of reported posts.Yes
postsRecord<string, Post>Collection of posts.Yes
commentsRecord<string, Comment>Collection of comments.No
usersRecord<string, User>Collection of users.Yes
widgetsRecord<string, Widget>Collection of widgets.Yes
topicsRecord<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() => voidFunction triggered on leading header tap.Yes
handleHeaderTextTap() => voidFunction triggered on header text tap.Yes
handleHeaderTrailingTap() => voidFunction triggered on trailing header tap.Yes
memberRightsMemberRights[]List of member rights.Yes
isEditPermissionDialogOpenbooleanIndicates if the edit permission dialog is open.Yes
setIsEditPermissionDialogOpenReact.Dispatch<React.SetStateAction<boolean>>Function to toggle the edit permission dialog.No
modifiedRightsMemberRights[]List of modified rights.No
setModifiedRightsReact.Dispatch<React.SetStateAction<MemberRights[] >>Function to set modified rights.No
customTitlestringCustom title for the moderation section.No
setCustomTitleReact.Dispatch<React.SetStateAction<string>>Function to set the custom title.No
currentReportGroupReport | nullCurrently selected report.Yes
setCurrentReportReact.Dispatch<React.SetStateAction<GroupReport | null>>Function to set the current report.No
loadMoreFeedsbooleanIndicates if more feeds should be loaded.Yes
getNextPage() => voidFunction to fetch the next page of moderation data.Yes
isLoadingbooleanIndicates if data is currently being loaded.Yes

Example

For an example implementation, check out this reference.