@@ -65,7 +65,6 @@ import RoomPreviewBar from "../views/rooms/RoomPreviewBar";
65
65
import RoomPreviewCard from "../views/rooms/RoomPreviewCard" ;
66
66
import RoomUpgradeWarningBar from "../views/rooms/RoomUpgradeWarningBar" ;
67
67
import AuxPanel from "../views/rooms/AuxPanel" ;
68
- import LegacyRoomHeader from "../views/rooms/LegacyRoomHeader" ;
69
68
import RoomHeader from "../views/rooms/RoomHeader" ;
70
69
import { IOOBData , IThreepidInvite } from "../../stores/ThreepidInviteStore" ;
71
70
import EffectsOverlay from "../views/elements/EffectsOverlay" ;
@@ -313,26 +312,7 @@ function LocalRoomView(props: LocalRoomViewProps): ReactElement {
313
312
return (
314
313
< div className = "mx_RoomView mx_RoomView--local" >
315
314
< 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 } />
336
316
< main className = "mx_RoomView_body" ref = { props . roomView } >
337
317
< FileDropTarget parent = { props . roomView . current } onFileDrop = { props . onFileDrop } />
338
318
< div className = "mx_RoomView_timeline" >
@@ -366,26 +346,7 @@ function LocalRoomCreateLoader(props: ILocalRoomCreateLoaderProps): ReactElement
366
346
return (
367
347
< div className = "mx_RoomView mx_RoomView--local" >
368
348
< 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 } />
389
350
< div className = "mx_RoomView_body" >
390
351
< LargeLoader text = { text } />
391
352
</ div >
@@ -1753,13 +1714,6 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
1753
1714
} ) ;
1754
1715
} ;
1755
1716
1756
- private onAppsClick = ( ) : void => {
1757
- dis . dispatch ( {
1758
- action : "appsDrawer" ,
1759
- show : ! this . state . showApps ,
1760
- } ) ;
1761
- } ;
1762
-
1763
1717
private onForgetClick = ( ) : void => {
1764
1718
dis . dispatch ( {
1765
1719
action : "forget_room" ,
@@ -1836,10 +1790,6 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
1836
1790
dis . fire ( Action . ViewRoomDirectory ) ;
1837
1791
} ;
1838
1792
1839
- private onSearchClick = ( ) : void => {
1840
- dis . fire ( Action . FocusMessageSearch ) ;
1841
- } ;
1842
-
1843
1793
private onSearchChange = debounce ( ( e : ChangeEvent ) : void => {
1844
1794
const term = ( e . target as HTMLInputElement ) . value ;
1845
1795
this . onSearch ( term ) ;
@@ -2121,15 +2071,13 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
2121
2071
}
2122
2072
}
2123
2073
2124
- const roomHeaderType = SettingsStore . getValue ( "feature_new_room_decoration_ui" ) ? "new" : "legacy" ;
2125
-
2126
2074
if ( ! this . state . room ) {
2127
2075
const loading = ! this . state . matrixClientIsReady || this . state . roomLoading || this . state . peekLoading ;
2128
2076
if ( loading ) {
2129
2077
// Assume preview loading if we don't have a ready client or a room ID (still resolving the alias)
2130
2078
const previewLoading = ! this . state . matrixClientIsReady || ! this . state . roomId || this . state . peekLoading ;
2131
2079
return (
2132
- < div className = "mx_RoomView" data-room-header = { roomHeaderType } >
2080
+ < div className = "mx_RoomView" >
2133
2081
< ErrorBoundary >
2134
2082
< RoomPreviewBar
2135
2083
canPreview = { false }
@@ -2154,7 +2102,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
2154
2102
// We've got to this room by following a link, possibly a third party invite.
2155
2103
const roomAlias = this . state . roomAlias ;
2156
2104
return (
2157
- < div className = "mx_RoomView" data-room-header = { roomHeaderType } >
2105
+ < div className = "mx_RoomView" >
2158
2106
< ErrorBoundary >
2159
2107
< RoomPreviewBar
2160
2108
onJoinClick = { this . onJoinButtonClicked }
@@ -2224,7 +2172,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
2224
2172
2225
2173
// We have a regular invite for this room.
2226
2174
return (
2227
- < div className = "mx_RoomView" data-room-header = { roomHeaderType } >
2175
+ < div className = "mx_RoomView" >
2228
2176
< ErrorBoundary >
2229
2177
< RoomPreviewBar
2230
2178
onJoinClick = { this . onJoinButtonClicked }
@@ -2248,7 +2196,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
2248
2196
( [ KnownMembership . Knock , KnownMembership . Leave ] as Array < string > ) . includes ( myMembership )
2249
2197
) {
2250
2198
return (
2251
- < div className = "mx_RoomView" data-room-header = { roomHeaderType } >
2199
+ < div className = "mx_RoomView" >
2252
2200
< ErrorBoundary >
2253
2201
< RoomPreviewBar
2254
2202
onJoinClick = { this . onJoinButtonClicked }
@@ -2354,11 +2302,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
2354
2302
/>
2355
2303
) ;
2356
2304
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 > ;
2362
2306
}
2363
2307
} else if ( hiddenHighlightCount > 0 ) {
2364
2308
aux = (
@@ -2587,46 +2531,9 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
2587
2531
}
2588
2532
const mainSplitContentClasses = classNames ( "mx_RoomView_body" , mainSplitContentClassName ) ;
2589
2533
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
-
2622
2534
return (
2623
2535
< 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 } >
2630
2537
{ showChatEffects && this . roomView . current && (
2631
2538
< EffectsOverlay roomWidth = { this . roomView . current . offsetWidth } />
2632
2539
) }
@@ -2644,31 +2551,10 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
2644
2551
ref = { this . roomViewBody }
2645
2552
data-layout = { this . state . layout }
2646
2553
>
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
+ />
2672
2558
{ mainSplitBody }
2673
2559
</ div >
2674
2560
</ MainSplit >
0 commit comments