From cd985d6d6a7edd357527b1b2747a3ef2654aabbd Mon Sep 17 00:00:00 2001 From: Kerry Date: Wed, 29 Nov 2023 10:15:21 +1300 Subject: [PATCH] make room info button to open room details (#11951) --- res/css/views/rooms/_RoomHeader.pcss | 16 ++- src/components/views/rooms/RoomHeader.tsx | 119 +++++++++--------- .../__snapshots__/RoomHeader-test.tsx.snap | 52 ++++---- 3 files changed, 105 insertions(+), 82 deletions(-) diff --git a/res/css/views/rooms/_RoomHeader.pcss b/res/css/views/rooms/_RoomHeader.pcss index f094be8b86..a93366f520 100644 --- a/res/css/views/rooms/_RoomHeader.pcss +++ b/res/css/views/rooms/_RoomHeader.pcss @@ -21,15 +21,27 @@ limitations under the License. border-bottom: 1px solid $separator; background-color: $background; transition: all 0.3s ease; - cursor: pointer; } .mx_RoomHeader:hover { background-color: $header-panel-bg-hover; } -.mx_RoomHeader_info { +.mx_RoomHeader_infoWrapper { + // unset button styles + background: unset; + border: unset; flex: 1; + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; + cursor: pointer; + gap: var(--cpd-space-3x); + text-align: left; +} + +.mx_RoomHeader_info { /* We want the spacing to be 64px, 13x = 52px but we have a flex gap of 12px set on the flex container, which sums up to 64 */ padding-right: var(--cpd-space-13x); diff --git a/src/components/views/rooms/RoomHeader.tsx b/src/components/views/rooms/RoomHeader.tsx index c19a649e48..92d7c78ac9 100644 --- a/src/components/views/rooms/RoomHeader.tsx +++ b/src/components/views/rooms/RoomHeader.tsx @@ -116,67 +116,72 @@ export default function RoomHeader({ ); return ( - { - RightPanelStore.instance.showOrHidePanel(RightPanelPhases.RoomSummary); - }} - > - - - - {roomName} + + {additionalButtons?.map((props) => { const label = props.label(); diff --git a/test/components/views/rooms/__snapshots__/RoomHeader-test.tsx.snap b/test/components/views/rooms/__snapshots__/RoomHeader-test.tsx.snap index 2a06a7d6ae..dc2f916bc0 100644 --- a/test/components/views/rooms/__snapshots__/RoomHeader-test.tsx.snap +++ b/test/components/views/rooms/__snapshots__/RoomHeader-test.tsx.snap @@ -6,33 +6,39 @@ exports[`RoomHeader does not show the face pile for DMs 1`] = ` class="mx_Flex mx_RoomHeader light-panel" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x);" > - - ! - -
-
- +
+
- !1:example.org - + + !1:example.org + +
-
+