-
-
Notifications
You must be signed in to change notification settings - Fork 829
Change 'type' prop on badges to 'forceDot' #12327
Conversation
Which, hopefully, better represents what it actually does. Tidies up some of the logic. Split out from #12254
src/components/views/rooms/NotificationBadge/StatelessNotificationBadge.tsx
Outdated
Show resolved
Hide resolved
src/components/views/rooms/NotificationBadge/StatelessNotificationBadge.tsx
Outdated
Show resolved
Hide resolved
src/components/views/rooms/NotificationBadge/UnreadNotificationBadge.tsx
Outdated
Show resolved
Hide resolved
because it was also updating the logic for mark as unread badges and rewriting the ternary to the previous logic would be quite complex.
src/components/views/rooms/NotificationBadge/StatelessNotificationBadge.tsx
Outdated
Show resolved
Hide resolved
@@ -28,7 +28,12 @@ interface Props { | |||
count: number; | |||
level: NotificationLevel; | |||
knocked?: boolean; | |||
type?: "badge" | "dot"; | |||
/** | |||
* If true, where we would normally show a badge, we instead show a dot. Count will |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we mean count
the property here, or "Notification count" as a concept? Given the text about it affecting whether the dot is displayed, I think we mean count
? In which case, backticks and lower case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm... I would say more the notification count concept: I'm not clear what exactly it would mean to display or not display a prop. I've referenced the count in the class doc and updated this to hopefully be clearer in 940e9d3.
/** | ||
* If true, the badge will always be displayed as a dot. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs updating in much the same way as StatelessNotificationBadge
's version (though with differences to account for the fact that count
comes from a different place)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 37e972e
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
* Update `@vector-im/compound-design-tokens` in package.json (matrix-org#12339) * Change 'type' prop on badges to 'forceDot' (matrix-org#12327) * Change 'type' prop on badges tio 'forceDot' Which, hopefully, better represents what it actually does. Tidies up some of the logic. Split out from matrix-org#12254 * Missed a file * More comments * Oops, there is no count here. * Back out the logic refactor of StatelessNotificationBadge because it was also updating the logic for mark as unread badges and rewriting the ternary to the previous logic would be quite complex. * Fix doc comment Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Clarify doc on displaying the count * Update doc for the forceDot param here too. --------- Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * [Backport staging] Update `@vector-im/compound-design-tokens` in package.json (matrix-org#12340) (cherry picked from commit e3ba643) Co-authored-by: Florian Duros <florianduros@element.io> * Fix the image view (matrix-org#12341) * TAC: Fix hover state when expanded (matrix-org#12337) * Fix TAC hover state * Add playwright test * Update playwright snapshot after last compound style changes * v3.95.0-rc.0 * v3.95.0 * Reset matrix-js-sdk back to develop branch * TAC: Order rooms by most recent after notification level (matrix-org#12329) * Order room by thread timestamp * Fix key errors in test * Update jest snapshots * Update snapshots * Rename alpha/beta to numbers * Add playwright test * Replace forceCount prop with hideIfDot (matrix-org#12344) This replaces the `forceCount` prop on room badge components with `hideIfDot` which hopefully gives a better idea of what it does, since forceCount did not really force a count. Also remove the prop where it was just passing the default value anyway. --------- Co-authored-by: Florian Duros <florianduros@element.io> Co-authored-by: David Baker <dbkr@users.noreply.github.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Co-authored-by: ElementRobot <releases@riot.im> Co-authored-by: Robin <robin@robin.town>
* Change 'type' prop on badges tio 'forceDot' Which, hopefully, better represents what it actually does. Tidies up some of the logic. Split out from #12254 * Missed a file * More comments * Oops, there is no count here. * Back out the logic refactor of StatelessNotificationBadge because it was also updating the logic for mark as unread badges and rewriting the ternary to the previous logic would be quite complex. * Fix doc comment Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Clarify doc on displaying the count * Update doc for the forceDot param here too. --------- Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Which, hopefully, better represents what it actually does. Tidies up some of the logic. Also adds some tests.
Split out from #12254
Checklist
public
/exported
symbols have accurate TSDoc documentation.