Skip to content

Commit d881769

Browse files
committed
docs: clarify resolveUnreadBadgeMode usage
1 parent f24cf52 commit d881769

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/app/components/unread-badge/UnreadBadge.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ type ResolveUnreadBadgeModeOptions = Omit<UnreadBadgeProps, 'mode'> & {
1919

2020
export type UnreadBadgeMode = 'dot' | 'count';
2121

22+
/**
23+
* Resolve whether an unread badge should render as a dot or a numeric count.
24+
*
25+
* @param options.count The unread count backing this badge. Non-positive counts always resolve to dot mode.
26+
* @param options.dm Whether the badge belongs to a direct message.
27+
* @param options.highlight Whether the badge represents a mention or keyword highlight.
28+
* @param options.showUnreadCounts Whether regular room unread badges should show counts.
29+
* @param options.badgeCountDMsOnly Whether direct message unread badges should show counts.
30+
* @param options.showPingCounts Whether highlight badges should show counts.
31+
* @returns `'count'` when the current badge context is allowed to show a number, otherwise `'dot'`.
32+
*/
2233
export function resolveUnreadBadgeMode({
2334
highlight,
2435
count,

0 commit comments

Comments
 (0)