Fix broken threads list timestamp layout (#9922)

* Add option to show full identifier as tooltip on sender profiles
* Show full user id as tooltip on threads list entries
* Fix broken threads list timestamp layout

Previously, thread list timestamps would overflow
into the unread messages bubble on the right.

This is fixed by resetting the width of the
timestamp and ensuring both the timestamp and the
display name can shrink if necessary.
Both now also use ellipses if necessary.
This commit is contained in:
Janne Mareike Koschinski 2023-01-18 15:56:43 +01:00 committed by GitHub
parent 6d354e3e10
commit 4d2b27a96d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 40 additions and 15 deletions

View file

@ -1,4 +1,5 @@
/*
Copyright 2023 The Matrix.org Foundation C.I.C.
Copyright 2015, 2016 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
@ -24,9 +25,10 @@ import { useRoomMemberProfile } from "../../../hooks/room/useRoomMemberProfile";
interface IProps {
mxEvent: MatrixEvent;
onClick?(): void;
withTooltip?: boolean;
}
export default function SenderProfile({ mxEvent, onClick }: IProps): JSX.Element {
export default function SenderProfile({ mxEvent, onClick, withTooltip }: IProps): JSX.Element {
const member = useRoomMemberProfile({
userId: mxEvent.getSender(),
member: mxEvent.sender,
@ -39,6 +41,7 @@ export default function SenderProfile({ mxEvent, onClick }: IProps): JSX.Element
member={member}
colored={true}
emphasizeDisplayName={true}
withTooltip={withTooltip}
/>
) : null;
}