Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 7d98740

Browse files
committed
Show room preview bar with maximised widgets
This gives non-members a clear way to join a public room when maximised widgets are active.
1 parent 2520d81 commit 7d98740

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

res/css/views/right_panel/_TimelineCard.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,5 @@ limitations under the License.
123123
.mx_TimelineCard_timeline {
124124
overflow: hidden;
125125
position: relative; // offset parent for jump to bottom button
126+
flex: 1;
126127
}

src/components/structures/RoomView.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,12 +2126,15 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
21262126
</>;
21272127
break;
21282128
case MainSplitContentType.MaximisedWidget:
2129-
mainSplitBody = <AppsDrawer
2130-
room={this.state.room}
2131-
userId={this.context.credentials.userId}
2132-
resizeNotifier={this.props.resizeNotifier}
2133-
showApps={true}
2134-
/>;
2129+
mainSplitBody = <>
2130+
<AppsDrawer
2131+
room={this.state.room}
2132+
userId={this.context.credentials.userId}
2133+
resizeNotifier={this.props.resizeNotifier}
2134+
showApps={true}
2135+
/>
2136+
{ previewBar }
2137+
</>;
21352138
break;
21362139
case MainSplitContentType.Video: {
21372140
const app = getVoiceChannel(this.state.room.roomId);

src/components/views/right_panel/TimelineCard.tsx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ export default class TimelineCard extends React.Component<IProps, IState> {
221221

222222
const isUploading = ContentMessages.sharedInstance().getCurrentUploads(this.props.composerRelation).length > 0;
223223

224+
const myMembership = this.props.room.getMyMembership();
225+
const canSpeak = myMembership === "join";
226+
224227
return (
225228
<RoomContext.Provider value={{
226229
...this.context,
@@ -270,15 +273,17 @@ export default class TimelineCard extends React.Component<IProps, IState> {
270273
<UploadBar room={this.props.room} relation={this.props.composerRelation} />
271274
) }
272275

273-
<MessageComposer
274-
room={this.props.room}
275-
relation={this.props.composerRelation}
276-
resizeNotifier={this.props.resizeNotifier}
277-
replyToEvent={this.state.replyToEvent}
278-
permalinkCreator={this.props.permalinkCreator}
279-
e2eStatus={this.props.e2eStatus}
280-
compact={true}
281-
/>
276+
{ canSpeak && (
277+
<MessageComposer
278+
room={this.props.room}
279+
relation={this.props.composerRelation}
280+
resizeNotifier={this.props.resizeNotifier}
281+
replyToEvent={this.state.replyToEvent}
282+
permalinkCreator={this.props.permalinkCreator}
283+
e2eStatus={this.props.e2eStatus}
284+
compact={true}
285+
/>
286+
) }
282287
</BaseCard>
283288
</RoomContext.Provider>
284289
);

0 commit comments

Comments
 (0)