moderator-toolbox-nxg-for-reddit / modules/removalreasons/components/RemovalReasonList
modules/removalreasons/components/RemovalReasonList¶
Functions¶
RemovalReasonList()¶
RemovalReasonList(
__namedParameters):Element
Defined in: extension/data/modules/removalreasons/components/RemovalReasonList.tsx:679
Renders the full list of editable removal reasons for a subreddit’s toolbox config.
Parameters¶
__namedParameters¶
Returns¶
Element
Interfaces¶
RemovalReasonListProps¶
Defined in: extension/data/modules/removalreasons/components/RemovalReasonList.tsx:646
Props for the RemovalReasonList component.
Properties¶
addRef?¶
optionaladdRef?:AddRef
Defined in: extension/data/modules/removalreasons/components/RemovalReasonList.tsx:650
Optional ref wired up so the parent can open the add-reason form programmatically.
disabledRef?¶
optionaldisabledRef?:DisabledRef
Defined in: extension/data/modules/removalreasons/components/RemovalReasonList.tsx:652
Optional ref wired up so the parent can disable controls while the add form is open.
onSave¶
onSave: (
config,reason) =>void|Promise<unknown>
Defined in: extension/data/modules/removalreasons/components/RemovalReasonList.tsx:661
Persists the config. May return a promise: the sync toggle has to wait for the write before syncing, because the sync re-reads the config from the wiki.
Parameters¶
config¶
reason¶
string
Returns¶
void | Promise<unknown>
sortRef?¶
optionalsortRef?:SortModeRef
Defined in: extension/data/modules/removalreasons/components/RemovalReasonList.tsx:654
Optional ref connecting the list to a footer Reorder toggle.
state¶
state:
ConfigState
Defined in: extension/data/modules/removalreasons/components/RemovalReasonList.tsx:648
Config state object for the current subreddit.
Variables¶
formOwnedKeys¶
constformOwnedKeys: readonly ["title","text","removePosts","removeComments","flairText","flairCSS","flairTemplateID","default_note","default_note_type"]
Defined in: extension/data/modules/removalreasons/components/RemovalReasonList.tsx:64
The reason fields this editor’s form owns: it writes every one of them on save, omitting the ones that are off rather than writing a falsy value.
Everything outside this list is carried across an edit untouched (see
handleSaveEdit). That default-preserve direction is deliberate: the form
rebuilds the reason object from its own state, so a field it does not re-emit
would otherwise be silently dropped every time a mod saves an edit.