From 3eb6a55b93ca84547075d387672f123f340d3d54 Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Wed, 22 Mar 2023 13:27:24 +0100 Subject: [PATCH] Tweak pill UI (#10417) --- res/css/views/elements/_Pill.pcss | 6 -- src/components/views/elements/Pill.tsx | 43 +++++---- src/hooks/usePermalink.ts | 8 +- src/i18n/strings/en_EN.json | 4 +- .../elements/__snapshots__/Pill-test.tsx.snap | 6 +- .../views/messages/TextualBody-test.tsx | 91 +++++++++++++++---- .../__snapshots__/TextualBody-test.tsx.snap | 71 ++++++++++++++- test/test-utils/test-utils.ts | 2 +- 8 files changed, 177 insertions(+), 54 deletions(-) diff --git a/res/css/views/elements/_Pill.pcss b/res/css/views/elements/_Pill.pcss index 6cced8b8b5d..aa9c236f8b3 100644 --- a/res/css/views/elements/_Pill.pcss +++ b/res/css/views/elements/_Pill.pcss @@ -59,12 +59,6 @@ limitations under the License. min-width: $font-16px; /* ensure the avatar is not compressed */ } - &.mx_EventPill .mx_BaseAvatar { - /* Event pill avatars are inside the text. */ - margin-inline-start: 0.2em; - margin-inline-end: 0.2em; - } - .mx_Pill_text { min-width: 0; overflow: hidden; diff --git a/src/components/views/elements/Pill.tsx b/src/components/views/elements/Pill.tsx index ab0c2b7e2f8..67d0f6d6d65 100644 --- a/src/components/views/elements/Pill.tsx +++ b/src/components/views/elements/Pill.tsx @@ -45,6 +45,8 @@ export const pillRoomNotifLen = (): number => { return "@room".length; }; +const linkIcon = ; + const PillRoomAvatar: React.FC<{ shouldShowPillAvatar: boolean; room: Room | null; @@ -56,7 +58,7 @@ const PillRoomAvatar: React.FC<{ if (room) { return