Change 'type' prop on badges to 'forceDot' (#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 https://github.com/matrix-org/matrix-react-sdk/pull/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>
This commit is contained in:
parent
e3ba643bdc
commit
bd6ebc9630
5 changed files with 49 additions and 10 deletions
|
@ -35,4 +35,23 @@ describe("StatelessNotificationBadge", () => {
|
|||
expect(container.querySelector(".mx_NotificationBadge_dot")).not.toBeInTheDocument();
|
||||
expect(container.querySelector(".mx_NotificationBadge_knocked")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("has badge style for notification", () => {
|
||||
const { container } = render(
|
||||
<StatelessNotificationBadge symbol={null} count={3} level={NotificationLevel.Notification} />,
|
||||
);
|
||||
expect(container.querySelector(".mx_NotificationBadge_dot")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("has dot style for notification when forced", () => {
|
||||
const { container } = render(
|
||||
<StatelessNotificationBadge
|
||||
symbol={null}
|
||||
count={3}
|
||||
level={NotificationLevel.Notification}
|
||||
forceDot={true}
|
||||
/>,
|
||||
);
|
||||
expect(container.querySelector(".mx_NotificationBadge_dot")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue