forked from Mirrors/gomuks
web/roomlist: fix unread count positioning
This commit is contained in:
parent
572ef41b80
commit
d82f5404ec
2 changed files with 7 additions and 2 deletions
|
@ -55,11 +55,15 @@ div.space-bar {
|
|||
> div.room-entry-unreads {
|
||||
z-index: 2;
|
||||
height: 0;
|
||||
width: 0;
|
||||
margin-left: auto;
|
||||
position: relative;
|
||||
|
||||
> div.unread-count {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
/* This positioning doesn't feel very precise, but it looks correct enough */
|
||||
margin-top: .75rem;
|
||||
margin-right: .25rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,8 @@ const UnreadCount = ({ counts, space }: UnreadCountProps) => {
|
|||
if (!unreadCount && !counts.marked_unread) {
|
||||
return null
|
||||
}
|
||||
const countIsBig = !space && Boolean(counts.unread_notifications || counts.unread_highlights || counts.marked_unread)
|
||||
const countIsBig = !space
|
||||
&& Boolean(counts.unread_notifications || counts.unread_highlights || counts.marked_unread)
|
||||
let unreadCountDisplay = unreadCount.toString()
|
||||
if (unreadCount > 999 && countIsBig) {
|
||||
unreadCountDisplay = "99+"
|
||||
|
|
Loading…
Add table
Reference in a new issue