From 9ea04a539b5a795dd7d89f3703e216a681bc857a Mon Sep 17 00:00:00 2001 From: Germain Date: Thu, 12 Oct 2023 14:17:51 +0100 Subject: [PATCH] Add data attribute to know what header is used (#11735) * Add data attribute to know what header is used * Simplify room header type * update snapshot --- src/components/structures/RoomView.tsx | 23 ++++++++++++++----- .../__snapshots__/RoomView-test.tsx.snap | 1 + 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/components/structures/RoomView.tsx b/src/components/structures/RoomView.tsx index e6eca5023f..645ceee56d 100644 --- a/src/components/structures/RoomView.tsx +++ b/src/components/structures/RoomView.tsx @@ -2097,13 +2097,15 @@ export class RoomView extends React.Component { } } + const roomHeaderType = SettingsStore.getValue("feature_new_room_decoration_ui") ? "new" : "legacy"; + if (!this.state.room) { const loading = !this.state.matrixClientIsReady || this.state.roomLoading || this.state.peekLoading; if (loading) { // Assume preview loading if we don't have a ready client or a room ID (still resolving the alias) const previewLoading = !this.state.matrixClientIsReady || !this.state.roomId || this.state.peekLoading; return ( -
+
{ // We've got to this room by following a link, possibly a third party invite. const roomAlias = this.state.roomAlias; return ( -
+
{ // We have a regular invite for this room. return ( -
+
{ if (this.state.canAskToJoin && ["knock", "leave"].includes(myMembership)) { return ( -
+
{ /> ); if (!this.state.canPeek && !this.state.room?.isSpaceRoom()) { - return
{previewBar}
; + return ( +
+ {previewBar} +
+ ); } } else if (hiddenHighlightCount > 0) { aux = ( @@ -2571,7 +2577,12 @@ export class RoomView extends React.Component { return ( -
+
{showChatEffects && this.roomView.current && ( )} diff --git a/test/components/structures/__snapshots__/RoomView-test.tsx.snap b/test/components/structures/__snapshots__/RoomView-test.tsx.snap index 9fe61c5e6c..a3a2eaea61 100644 --- a/test/components/structures/__snapshots__/RoomView-test.tsx.snap +++ b/test/components/structures/__snapshots__/RoomView-test.tsx.snap @@ -736,6 +736,7 @@ exports[`RoomView should show error view if failed to look up room alias 1`] = `