Skip to content

Commit 009e01c

Browse files
committed
Fix LeftPanel size being incorrect when TagPanel disabled
A previous PR (element-hq#6134) assumed that the TagPanel feature would always be enabled, leading to strangeness when it wasn't: element-hq#6136. (FTR the original layout bug was element-hq#6133)
1 parent 7aea7f9 commit 009e01c

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

src/components/structures/LeftPanel.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,21 @@ var LeftPanel = React.createClass({
238238
}
239239
);
240240

241+
const tagPanelEnabled = SettingsStore.isFeatureEnabled("feature_tag_panel");
242+
const tagPanel = tagPanelEnabled ? <TagPanel /> : <div />;
243+
241244
const containerClasses = classNames(
242245
"mx_LeftPanel_container",
243-
{ "mx_LeftPanel_container_collapsed": this.props.collapsed },
246+
{
247+
"mx_LeftPanel_container_collapsed": this.props.collapsed,
248+
"mx_LeftPanel_container_hasTagPanel": tagPanelEnabled,
249+
},
244250
);
245251

246252
return (
247253
<DragDropContext onDragEnd={this.onDragEnd}>
248254
<div className={containerClasses}>
249-
{ SettingsStore.isFeatureEnabled("feature_tag_panel") ? <TagPanel /> : <div /> }
255+
{ tagPanel }
250256
<aside className={classes} onKeyDown={ this._onKeyDown } onFocus={ this._onFocus } onBlur={ this._onBlur }>
251257
{ topBox }
252258
<CallPreview ConferenceHandler={VectorConferenceHandler} />

src/skins/vector/css/vector-web/structures/_LeftPanel.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,21 @@ limitations under the License.
2323

2424
.mx_LeftPanel_container {
2525
display: flex;
26+
/* LeftPanel 235px */
27+
flex: 0 0 235px;
28+
}
29+
30+
.mx_LeftPanel_container.mx_LeftPanel_container_hasTagPanel {
31+
/* TagPanel 60px + LeftPanel 235px */
2632
flex: 0 0 295px;
2733
}
2834

2935
.mx_LeftPanel_container_collapsed {
36+
/* Collapsed LeftPanel 60px */
37+
flex: 0 0 60px;
38+
}
39+
40+
.mx_LeftPanel_container_collapsed.mx_LeftPanel_container_hasTagPanel {
3041
/* TagPanel 60px + Collapsed LeftPanel 60px */
3142
flex: 0 0 120px;
3243
}

0 commit comments

Comments
 (0)