mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 18:43:41 -05:00
web/timeline: add class to events sent by self
Also add to reply body
This commit is contained in:
parent
297193fa73
commit
0a63a79824
2 changed files with 6 additions and 0 deletions
|
@ -85,6 +85,9 @@ export const ReplyBody = ({ room, event, onClose, isThread, isEditing }: ReplyBo
|
|||
if (isEditing) {
|
||||
classNames.push("editing")
|
||||
}
|
||||
if (event.sender === use(ClientContext)?.userID) {
|
||||
classNames.push("sender-self")
|
||||
}
|
||||
const userColorIndex = getUserColorIndex(event.sender)
|
||||
classNames.push(`sender-color-${userColorIndex}`)
|
||||
return <blockquote data-reply-to={event.event_id} className={classNames.join(" ")} onClick={onClickReply}>
|
||||
|
|
|
@ -94,6 +94,9 @@ const TimelineEvent = ({ evt, prevEvt, disableMenu }: TimelineEventProps) => {
|
|||
if (BodyType === HiddenEvent) {
|
||||
wrapperClassNames.push("hidden-event")
|
||||
}
|
||||
if (evt.sender === client.userID) {
|
||||
wrapperClassNames.push("sender-self")
|
||||
}
|
||||
let dateSeparator = null
|
||||
const prevEvtDate = prevEvt ? new Date(prevEvt.timestamp) : null
|
||||
if (prevEvtDate && (
|
||||
|
|
Loading…
Add table
Reference in a new issue