moderator-toolbox-nxg-for-reddit / modules/shared/redditElements/thingParts

modules/shared/redditElements/thingParts

Functions

buildAuthorAttrs()

buildAuthorAttrs(thing, submitterHref): object

Defined in: extension/data/modules/shared/redditElements/thingParts.tsx:60

Computes the author status class and the inline author-attribute badges (submitter, admin, moderator, unknown distinguish) for a thing’s tagline.

Parameters

thing

ThingModData

The raw Reddit API thing data.

submitterHref

string

Where the “S” (submitter) badge links - the thread permalink for comments, the post permalink for submissions.

Returns

object

authorAttrs

authorAttrs: ReactNode[]

authorStatus

authorStatus: string


getVoteState()

getVoteState(likes): "neutral" | "liked" | "disliked"

Defined in: extension/data/modules/shared/redditElements/thingParts.tsx:47

Maps a thing’s likes value to a vote-state class fragment.

Parameters

likes

boolean | null

Returns

"neutral" | "liked" | "disliked"


ThingReports()

ThingReports(__namedParameters): Element

Defined in: extension/data/modules/shared/redditElements/thingParts.tsx:116

Renders the user-reports list, the “reports ignored” notice, and the mod-reports list for a thing, in that order. Each section is gated exactly as the original components.

Parameters

__namedParameters

ThingReportsProps

Returns

Element


useFilteredFromQueue()

useFilteredFromQueue(thing, status): boolean

Defined in: extension/data/modules/shared/redditElements/thingParts.tsx:25

On mount, asks the background page whether a removed/spammed thing is still sitting in the modqueue (so mod-action buttons can be offered). Returns the resolved flag.

Parameters

thing

ThingModData

The raw Reddit API thing data (comment.data / submission.data).

status

string

The derived moderation status from deriveThingStatus.

Returns

boolean