web/timeline: add class to events sent by self

Also add to reply body
This commit is contained in:
Jade Ellis 2024-11-27 01:24:05 +00:00
parent 297193fa73
commit 0a63a79824
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2
2 changed files with 6 additions and 0 deletions

View file

@ -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}>

View file

@ -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 && (