moderator-toolbox-nxg-for-reddit / shared/controls/SortToggleButton
shared/controls/SortToggleButton¶
Functions¶
SortToggleButton()¶
SortToggleButton(
__namedParameters):Element
Defined in: extension/data/shared/controls/SortToggleButton.tsx:46
Footer button that toggles a card list’s compact sort view through a SortModeRef, flipping its label between “Collapse for sorting” and “Expand cards” as the list reports state changes. (Cards can be dragged in either view; collapsing just makes large shuffles easier.)
Parameters¶
__namedParameters¶
sortRef¶
Returns¶
Element
useSortMode()¶
useSortMode(
sortRef?):boolean
Defined in: extension/data/shared/controls/SortToggleButton.tsx:23
List-side hook for SortModeRef: exposes the toggle to the footer button and reports flips back so the footer can update its label.
Parameters¶
sortRef?¶
Returns¶
boolean
Whether sort mode is currently active.
Interfaces¶
SortModeRef¶
Defined in: extension/data/shared/controls/SortToggleButton.tsx:13
Two-slot ref connecting a card list to its footer’s Reorder toggle: the
list assigns toggle, the footer assigns onChange to be told the new
sort-mode state whenever it flips.
Properties¶
onChange¶
onChange: ((
sorting) =>void) |null
Defined in: extension/data/shared/controls/SortToggleButton.tsx:15
toggle¶
toggle: (() =>
void) |null
Defined in: extension/data/shared/controls/SortToggleButton.tsx:14