From 455c82a2c4f7bd2c480156af06e054703e2c4acb Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Fri, 6 Dec 2024 01:46:41 -0700 Subject: [PATCH 1/2] web/roomview: render room topic in header Signed-off-by: Sumner Evans --- web/src/ui/roomview/RoomView.css | 2 +- web/src/ui/roomview/RoomViewHeader.css | 24 +++++++++++++++++++----- web/src/ui/roomview/RoomViewHeader.tsx | 9 +++++++-- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/web/src/ui/roomview/RoomView.css b/web/src/ui/roomview/RoomView.css index 0283d40d..9bc1efdb 100644 --- a/web/src/ui/roomview/RoomView.css +++ b/web/src/ui/roomview/RoomView.css @@ -5,7 +5,7 @@ div.room-view { display: grid; outline: none; grid-template: - "header" 3rem + "header" 3.5rem "messageview" 1fr "autocomplete" 0 "input" auto diff --git a/web/src/ui/roomview/RoomViewHeader.css b/web/src/ui/roomview/RoomViewHeader.css index d8248bda..aab85cd3 100644 --- a/web/src/ui/roomview/RoomViewHeader.css +++ b/web/src/ui/roomview/RoomViewHeader.css @@ -6,12 +6,26 @@ div.room-header { border-bottom: 1px solid var(--border-color); overflow: hidden; - > div.room-name { - font-weight: bold; - overflow: hidden; - text-overflow: ellipsis; - text-wrap: nowrap; + > div.room-name-and-topic { flex: 1; + display: flex; + flex-direction: column; + overflow: hidden; + + > div.room-name, > div.room-topic { + overflow: hidden; + text-overflow: ellipsis; + text-wrap: nowrap; + } + + > div.room-name { + font-weight: bold; + } + + > div.room-topic { + font-size: 0.85rem; + color: var(--secondary-text-color); + } } > button.back { diff --git a/web/src/ui/roomview/RoomViewHeader.tsx b/web/src/ui/roomview/RoomViewHeader.tsx index c591bae4..8dd9ea29 100644 --- a/web/src/ui/roomview/RoomViewHeader.tsx +++ b/web/src/ui/roomview/RoomViewHeader.tsx @@ -52,8 +52,13 @@ const RoomViewHeader = ({ room }: RoomViewHeaderProps) => { onClick={use(LightboxContext)} alt="" /> -
- {roomMeta.name ?? roomMeta.room_id} +
+
+ {roomMeta.name ?? roomMeta.room_id} +
+ {roomMeta.topic &&
+ {roomMeta.topic} +
}