Skip to content

Commit

Permalink
web/roomview: render room topic in header
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <[email protected]>
  • Loading branch information
sumnerevans committed Dec 6, 2024
1 parent 838a9ce commit c7b607d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion web/src/ui/roomview/RoomView.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ div.room-view {
display: grid;
outline: none;
grid-template:
"header" 3rem
"header" 3.5rem
"messageview" 1fr
"autocomplete" 0
"input" auto
Expand Down
24 changes: 19 additions & 5 deletions web/src/ui/roomview/RoomViewHeader.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
text-wrap: nowrap;
}

> div.room-topic {
font-size: 0.85rem;
color: var(--secondary-text-color);
overflow: hidden;
text-overflow: ellipsis;
text-wrap: nowrap;
}
}

> button.back {
Expand Down
9 changes: 7 additions & 2 deletions web/src/ui/roomview/RoomViewHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@ const RoomViewHeader = ({ room }: RoomViewHeaderProps) => {
onClick={use(LightboxContext)}
alt=""
/>
<div className="room-name">
{roomMeta.name ?? roomMeta.room_id}
<div className="room-name-and-topic">
<div className="room-name">
{roomMeta.name ?? roomMeta.room_id}
</div>
{roomMeta.topic && <div className="room-topic">
{roomMeta.topic}
</div>}
</div>
<div className="right-buttons">
<button
Expand Down

0 comments on commit c7b607d

Please sign in to comment.