From eacb22eac7b6416fc914135fe530497c7a1d027d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 12 Aug 2024 14:44:15 +0100 Subject: [PATCH] Add chat button on new room header for maximised widgets (#12882) * Add chat button to new room header for video room & maximised widgets Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Delint Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update snapshot Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update screenshot Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../room-header-video-room-linux.png | Bin 4962 -> 4957 bytes src/components/structures/RoomView.tsx | 2 +- src/components/views/rooms/RoomHeader.tsx | 21 +++++++++++++----- .../views/rooms/RoomHeader-test.tsx | 1 + 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/playwright/snapshots/room/room-header.spec.ts/room-header-video-room-linux.png b/playwright/snapshots/room/room-header.spec.ts/room-header-video-room-linux.png index 7271a50cf9d7caff444986091d1a353cb257a526..bb10e28aba66d72be058c5ed73326a49deca9ee2 100644 GIT binary patch literal 4957 zcmbU_^+S|T^QXv%R8dJO5d^72DUXH&B_#C7BSntxI6C}DNp~D69d~p|cgKlzD{yp( zw7~H`yzlof_&z^8JF`1Gvoo{1GqWM@RORoIJ|+c$Kz9`tBLX85d9V+ASNJx@mW7ejQq)yp4Sw2no@0e z7fAE>22NgXm-C7lGIgtaC{{Jc)r!?rn^@|4bX4}5aE9i7BKR_p?9?^~c|z0vi|fm6 z{?0Th!x2aX!Qn{L{->VP!=v%D7VDBF*ze8W1}9HXPhu8^d%?hJKy4H~dH5Vy(LaqG zH|UGxZ(C{#cW(h;5I;DA|EBME?`dNbg>29bESq@Z&H|GKpifyLVR95VeV)B!H85F3 z=nX7Oagu)1f;JB?q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md$EC987=9eje0*H8lYn%`#!L(}t(f30?G;4YS7*UvZvd%v zv;z{EBuY`s5RG?r1EaI%*CK(AYkb;S@k4`&0S->b!8d+i$G(^1JAuD|e6od$y~T~S z)c;qRnCNn!i$%}&>@1RVt_Vmu7Fz>ZUfNc!H}nOj^1nLF2LUfQSY%cA=U$)N*e&Wv zwWbZBHfkU?Onzpb6Zi$F9dvUQiD31BQw|0x42g3eqPDLhz4{X(U1loAYBc@-J*y71 zOZP3URpsW&P>$P@BVu7dbaawvPj+l$r1;pcFu|7teTqE5?5eV`=4V4OPJ8cZHO zsnYSzNt*gX3r-8>RIz4|R2zi!%Q`;&5YoiQXU}l @@ -325,14 +334,13 @@ export default function RoomHeader({ })} {isViewingCall && } - {((isConnectedToCall && isViewingCall) || isVideoRoom(room)) && } {hasActiveCallSession && !isConnectedToCall && !isViewingCall ? ( joinCallButton ) : ( <> - {!isVideoRoom(room) && videoCallButton} - {!useElementCallExclusively && !isVideoRoom(room) && voiceCallButton} + {!isVideoRoom && videoCallButton} + {!useElementCallExclusively && !isVideoRoom && voiceCallButton} )} @@ -347,6 +355,9 @@ export default function RoomHeader({ + + {showChatButton && } + { }, ]); jest.spyOn(client, "isCryptoEnabled").mockReturnValue(true); + jest.spyOn(ShieldUtils, "shieldStatusForRoom").mockResolvedValue(ShieldUtils.E2EStatus.Normal); }); it.each([