@@ -65,7 +65,6 @@ import RoomPreviewBar from "../views/rooms/RoomPreviewBar";
6565import RoomPreviewCard from "../views/rooms/RoomPreviewCard" ;
6666import RoomUpgradeWarningBar from "../views/rooms/RoomUpgradeWarningBar" ;
6767import AuxPanel from "../views/rooms/AuxPanel" ;
68- import LegacyRoomHeader from "../views/rooms/LegacyRoomHeader" ;
6968import RoomHeader from "../views/rooms/RoomHeader" ;
7069import { IOOBData , IThreepidInvite } from "../../stores/ThreepidInviteStore" ;
7170import EffectsOverlay from "../views/elements/EffectsOverlay" ;
@@ -313,26 +312,7 @@ function LocalRoomView(props: LocalRoomViewProps): ReactElement {
313312 return (
314313 < div className = "mx_RoomView mx_RoomView--local" >
315314 < ErrorBoundary >
316- { SettingsStore . getValue ( "feature_new_room_decoration_ui" ) ? (
317- < RoomHeader room = { room } />
318- ) : (
319- < LegacyRoomHeader
320- room = { context . room }
321- searchInfo = { undefined }
322- inRoom = { true }
323- onSearchClick = { null }
324- onInviteClick = { null }
325- onForgetClick = { null }
326- e2eStatus = { room . encrypted ? E2EStatus . Normal : undefined }
327- onAppsClick = { null }
328- appsShown = { false }
329- excludedRightPanelPhaseButtons = { [ ] }
330- showButtons = { false }
331- enableRoomOptionsMenu = { false }
332- viewingCall = { false }
333- activeCall = { null }
334- />
335- ) }
315+ < RoomHeader room = { room } />
336316 < main className = "mx_RoomView_body" ref = { props . roomView } >
337317 < FileDropTarget parent = { props . roomView . current } onFileDrop = { props . onFileDrop } />
338318 < div className = "mx_RoomView_timeline" >
@@ -366,26 +346,7 @@ function LocalRoomCreateLoader(props: ILocalRoomCreateLoaderProps): ReactElement
366346 return (
367347 < div className = "mx_RoomView mx_RoomView--local" >
368348 < ErrorBoundary >
369- { SettingsStore . getValue ( "feature_new_room_decoration_ui" ) ? (
370- < RoomHeader room = { props . localRoom } />
371- ) : (
372- < LegacyRoomHeader
373- room = { props . localRoom }
374- searchInfo = { undefined }
375- inRoom = { true }
376- onSearchClick = { null }
377- onInviteClick = { null }
378- onForgetClick = { null }
379- e2eStatus = { props . localRoom . encrypted ? E2EStatus . Normal : undefined }
380- onAppsClick = { null }
381- appsShown = { false }
382- excludedRightPanelPhaseButtons = { [ ] }
383- showButtons = { false }
384- enableRoomOptionsMenu = { false }
385- viewingCall = { false }
386- activeCall = { null }
387- />
388- ) }
349+ < RoomHeader room = { props . localRoom } />
389350 < div className = "mx_RoomView_body" >
390351 < LargeLoader text = { text } />
391352 </ div >
@@ -1753,13 +1714,6 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
17531714 } ) ;
17541715 } ;
17551716
1756- private onAppsClick = ( ) : void => {
1757- dis . dispatch ( {
1758- action : "appsDrawer" ,
1759- show : ! this . state . showApps ,
1760- } ) ;
1761- } ;
1762-
17631717 private onForgetClick = ( ) : void => {
17641718 dis . dispatch ( {
17651719 action : "forget_room" ,
@@ -1836,10 +1790,6 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
18361790 dis . fire ( Action . ViewRoomDirectory ) ;
18371791 } ;
18381792
1839- private onSearchClick = ( ) : void => {
1840- dis . fire ( Action . FocusMessageSearch ) ;
1841- } ;
1842-
18431793 private onSearchChange = debounce ( ( e : ChangeEvent ) : void => {
18441794 const term = ( e . target as HTMLInputElement ) . value ;
18451795 this . onSearch ( term ) ;
@@ -2121,15 +2071,13 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
21212071 }
21222072 }
21232073
2124- const roomHeaderType = SettingsStore . getValue ( "feature_new_room_decoration_ui" ) ? "new" : "legacy" ;
2125-
21262074 if ( ! this . state . room ) {
21272075 const loading = ! this . state . matrixClientIsReady || this . state . roomLoading || this . state . peekLoading ;
21282076 if ( loading ) {
21292077 // Assume preview loading if we don't have a ready client or a room ID (still resolving the alias)
21302078 const previewLoading = ! this . state . matrixClientIsReady || ! this . state . roomId || this . state . peekLoading ;
21312079 return (
2132- < div className = "mx_RoomView" data-room-header = { roomHeaderType } >
2080+ < div className = "mx_RoomView" >
21332081 < ErrorBoundary >
21342082 < RoomPreviewBar
21352083 canPreview = { false }
@@ -2154,7 +2102,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
21542102 // We've got to this room by following a link, possibly a third party invite.
21552103 const roomAlias = this . state . roomAlias ;
21562104 return (
2157- < div className = "mx_RoomView" data-room-header = { roomHeaderType } >
2105+ < div className = "mx_RoomView" >
21582106 < ErrorBoundary >
21592107 < RoomPreviewBar
21602108 onJoinClick = { this . onJoinButtonClicked }
@@ -2224,7 +2172,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
22242172
22252173 // We have a regular invite for this room.
22262174 return (
2227- < div className = "mx_RoomView" data-room-header = { roomHeaderType } >
2175+ < div className = "mx_RoomView" >
22282176 < ErrorBoundary >
22292177 < RoomPreviewBar
22302178 onJoinClick = { this . onJoinButtonClicked }
@@ -2248,7 +2196,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
22482196 ( [ KnownMembership . Knock , KnownMembership . Leave ] as Array < string > ) . includes ( myMembership )
22492197 ) {
22502198 return (
2251- < div className = "mx_RoomView" data-room-header = { roomHeaderType } >
2199+ < div className = "mx_RoomView" >
22522200 < ErrorBoundary >
22532201 < RoomPreviewBar
22542202 onJoinClick = { this . onJoinButtonClicked }
@@ -2354,11 +2302,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
23542302 />
23552303 ) ;
23562304 if ( ! this . state . canPeek && ! this . state . room ?. isSpaceRoom ( ) ) {
2357- return (
2358- < div className = "mx_RoomView" data-room-header = { roomHeaderType } >
2359- { previewBar }
2360- </ div >
2361- ) ;
2305+ return < div className = "mx_RoomView" > { previewBar } </ div > ;
23622306 }
23632307 } else if ( hiddenHighlightCount > 0 ) {
23642308 aux = (
@@ -2587,46 +2531,9 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
25872531 }
25882532 const mainSplitContentClasses = classNames ( "mx_RoomView_body" , mainSplitContentClassName ) ;
25892533
2590- let excludedRightPanelPhaseButtons = [ RightPanelPhases . Timeline ] ;
2591- let onAppsClick : ( ( ) => void ) | null = this . onAppsClick ;
2592- let onForgetClick : ( ( ) => void ) | null = this . onForgetClick ;
2593- let onSearchClick : ( ( ) => void ) | null = this . onSearchClick ;
2594- let onInviteClick : ( ( ) => void ) | null = null ;
2595- let viewingCall = false ;
2596-
2597- // Simplify the header for other main split types
2598- switch ( mainSplitContentType ) {
2599- case MainSplitContentType . MaximisedWidget :
2600- excludedRightPanelPhaseButtons = [ ] ;
2601- onAppsClick = null ;
2602- onForgetClick = null ;
2603- onSearchClick = null ;
2604- break ;
2605- case MainSplitContentType . Call :
2606- excludedRightPanelPhaseButtons = [ ] ;
2607- onAppsClick = null ;
2608- onForgetClick = null ;
2609- onSearchClick = null ;
2610- if ( this . state . room . canInvite ( this . context . client . getSafeUserId ( ) ) ) {
2611- onInviteClick = this . onInviteClick ;
2612- }
2613- viewingCall = true ;
2614- }
2615-
2616- const myMember = this . state . room ! . getMember ( this . context . client ! . getSafeUserId ( ) ) ;
2617- const showForgetButton =
2618- ! this . context . client . isGuest ( ) &&
2619- ( ( [ KnownMembership . Leave , KnownMembership . Ban ] as Array < string > ) . includes ( myMembership ) ||
2620- myMember ?. isKicked ( ) ) ;
2621-
26222534 return (
26232535 < RoomContext . Provider value = { this . state } >
2624- < div
2625- className = { mainClasses }
2626- ref = { this . roomView }
2627- onKeyDown = { this . onReactKeyDown }
2628- data-room-header = { roomHeaderType }
2629- >
2536+ < div className = { mainClasses } ref = { this . roomView } onKeyDown = { this . onReactKeyDown } >
26302537 { showChatEffects && this . roomView . current && (
26312538 < EffectsOverlay roomWidth = { this . roomView . current . offsetWidth } />
26322539 ) }
@@ -2644,31 +2551,10 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
26442551 ref = { this . roomViewBody }
26452552 data-layout = { this . state . layout }
26462553 >
2647- { SettingsStore . getValue ( "feature_new_room_decoration_ui" ) ? (
2648- < RoomHeader
2649- room = { this . state . room }
2650- additionalButtons = { this . state . viewRoomOpts . buttons }
2651- />
2652- ) : (
2653- < LegacyRoomHeader
2654- room = { this . state . room }
2655- searchInfo = { this . state . search }
2656- oobData = { this . props . oobData }
2657- inRoom = { myMembership === KnownMembership . Join }
2658- onSearchClick = { onSearchClick }
2659- onInviteClick = { onInviteClick }
2660- onForgetClick = { showForgetButton ? onForgetClick : null }
2661- e2eStatus = { this . state . e2eStatus }
2662- onAppsClick = { this . state . hasPinnedWidgets ? onAppsClick : null }
2663- appsShown = { this . state . showApps }
2664- excludedRightPanelPhaseButtons = { excludedRightPanelPhaseButtons }
2665- showButtons = { ! this . viewsLocalRoom }
2666- enableRoomOptionsMenu = { ! this . viewsLocalRoom }
2667- viewingCall = { viewingCall }
2668- activeCall = { this . state . activeCall }
2669- additionalButtons = { this . state . viewRoomOpts . buttons }
2670- />
2671- ) }
2554+ < RoomHeader
2555+ room = { this . state . room }
2556+ additionalButtons = { this . state . viewRoomOpts . buttons }
2557+ />
26722558 { mainSplitBody }
26732559 </ div >
26742560 </ MainSplit >
0 commit comments