mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 10:33:41 -05:00
web/timeline: add a bubble around reactions
This commit is contained in:
parent
f5eeb8461a
commit
293a6416fc
2 changed files with 21 additions and 3 deletions
|
@ -136,6 +136,24 @@ div.timeline-event {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.event-content > div.event-reactions {
|
||||||
|
display: flex;
|
||||||
|
gap: .25rem;
|
||||||
|
margin: .25rem 0;
|
||||||
|
|
||||||
|
> span.reaction {
|
||||||
|
background-color: #efe;
|
||||||
|
border: 1px solid #ada;
|
||||||
|
border-radius: 2rem;
|
||||||
|
padding: 0 .5rem;
|
||||||
|
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
max-width: 20rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
div.hidden-event > div.sender-avatar, blockquote.reply-body > div.reply-sender > div.sender-avatar {
|
div.hidden-event > div.sender-avatar, blockquote.reply-body > div.reply-sender > div.sender-avatar {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -41,9 +41,9 @@ const formatShortTime = (time: Date) =>
|
||||||
|
|
||||||
const EventReactions = ({ reactions }: { reactions: Record<string, number> }) => {
|
const EventReactions = ({ reactions }: { reactions: Record<string, number> }) => {
|
||||||
return <div className="event-reactions">
|
return <div className="event-reactions">
|
||||||
{Object.entries(reactions).map(([reaction, count]) => <span key={reaction} className="reaction">
|
{Object.entries(reactions).map(([reaction, count]) => count > 0 ? <span key={reaction} className="reaction" title={reaction}>
|
||||||
{reaction} {count}
|
<span className="reaction">{reaction}</span> <span className="reaction-count">{count}</span>
|
||||||
</span>)}
|
</span> : null)}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue