This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 829
Change 'type' prop on badges to 'forceDot' #12327
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9e732ae
Change 'type' prop on badges tio 'forceDot'
dbkr bf27839
Missed a file
dbkr 3d64986
More comments
dbkr 92cd4eb
Oops, there is no count here.
dbkr 42d63ef
Back out the logic refactor of StatelessNotificationBadge
dbkr bdd14b5
Fix doc comment
dbkr 940e9d3
Clarify doc on displaying the count
dbkr 37e972e
Update doc for the forceDot param here too.
dbkr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,11 +23,14 @@ import { StatelessNotificationBadge } from "./StatelessNotificationBadge"; | |
interface Props { | ||
room?: Room; | ||
threadId?: string; | ||
type?: "badge" | "dot"; | ||
/** | ||
* If true, the badge will always be displayed as a dot. | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this needs updating in much the same way as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in 37e972e |
||
forceDot?: boolean; | ||
} | ||
|
||
export function UnreadNotificationBadge({ room, threadId, type }: Props): JSX.Element { | ||
export function UnreadNotificationBadge({ room, threadId, forceDot }: Props): JSX.Element { | ||
const { symbol, count, level } = useUnreadNotifications(room, threadId); | ||
|
||
return <StatelessNotificationBadge symbol={symbol} count={count} level={level} type={type} />; | ||
return <StatelessNotificationBadge symbol={symbol} count={count} level={level} forceDot={forceDot} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 meancount
? 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.