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

Commit e3155fe

Browse files
authored
Merge pull request #5313 from matrix-org/t3chguy/other/1
Improve LHS resize performance and tidy stale props&classes
2 parents f3958e4 + bb52bad commit e3155fe

File tree

5 files changed

+5
-92
lines changed

5 files changed

+5
-92
lines changed

res/css/views/rooms/_AppsDrawer.scss

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ $MiniAppTileHeight: 200px;
5050
}
5151
}
5252

53-
.mx_AppsDrawer_hidden {
54-
display: none;
55-
}
56-
5753
.mx_AppsContainer {
5854
display: flex;
5955
flex-direction: row;
@@ -78,15 +74,6 @@ $MiniAppTileHeight: 200px;
7874
font-size: $font-12px;
7975
}
8076

81-
.mx_SetAppURLDialog_input {
82-
border-radius: 3px;
83-
border: 1px solid $input-border-color;
84-
padding: 9px;
85-
color: $primary-hairline-color;
86-
background-color: $primary-bg-color;
87-
font-size: $font-15px;
88-
}
89-
9077
.mx_AppTile {
9178
width: 50%;
9279
border: 5px solid $widget-menu-bar-bg-color;
@@ -242,72 +229,6 @@ $MiniAppTileHeight: 200px;
242229
display: block;
243230
}
244231

245-
.mx_AppTileMenuBarWidgetPadding {
246-
margin-right: 5px;
247-
}
248-
249-
.mx_AppIconTile {
250-
background-color: $lightbox-bg-color;
251-
border: 1px solid rgba(0, 0, 0, 0);
252-
width: 200px;
253-
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
254-
transition: 0.3s;
255-
border-radius: 3px;
256-
margin: 5px;
257-
display: inline-block;
258-
}
259-
260-
.mx_AppIconTile.mx_AppIconTile_active {
261-
color: $accent-color;
262-
border-color: $accent-color;
263-
}
264-
265-
.mx_AppIconTile:hover {
266-
border: 1px solid $accent-color;
267-
box-shadow: 0 0 10px 5px rgba(200, 200, 200, 0.5);
268-
}
269-
270-
.mx_AppIconTile_content {
271-
padding: 2px 16px;
272-
height: 60px;
273-
overflow: hidden;
274-
}
275-
276-
.mx_AppIconTile_content h4 {
277-
margin-top: 5px;
278-
margin-bottom: 2px;
279-
}
280-
281-
.mx_AppIconTile_content p {
282-
margin-top: 0;
283-
margin-bottom: 5px;
284-
font-size: smaller;
285-
}
286-
287-
.mx_AppIconTile_image {
288-
padding: 10px;
289-
max-width: 100px;
290-
max-height: 100px;
291-
width: auto;
292-
height: auto;
293-
}
294-
295-
.mx_AppIconTile_imageContainer {
296-
text-align: center;
297-
width: 100%;
298-
background-color: white;
299-
border-radius: 3px 3px 0 0;
300-
height: 155px;
301-
display: flex;
302-
justify-content: center;
303-
align-items: center;
304-
}
305-
306-
form.mx_Custom_Widget_Form div {
307-
margin-top: 10px;
308-
margin-bottom: 10px;
309-
}
310-
311232
.mx_AppPermissionWarning {
312233
text-align: center;
313234
background-color: $widget-menu-bar-bg-color;

src/components/structures/LoggedInView.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ class LoggedInView extends React.Component<IProps, IState> {
218218
vertical: "mx_ResizeHandle_vertical",
219219
reverse: "mx_ResizeHandle_reverse",
220220
};
221+
let size;
221222
const collapseConfig = {
222223
toggleSize: 260 - 50,
223224
onCollapsed: (collapsed) => {
@@ -228,21 +229,19 @@ class LoggedInView extends React.Component<IProps, IState> {
228229
dis.dispatch({action: "show_left_panel"}, true);
229230
}
230231
},
231-
onResized: (size) => {
232-
window.localStorage.setItem("mx_lhs_size", '' + size);
232+
onResized: (_size) => {
233+
size = _size;
233234
this.props.resizeNotifier.notifyLeftHandleResized();
234235
},
235236
onResizeStart: () => {
236237
this.props.resizeNotifier.startResizing();
237238
},
238239
onResizeStop: () => {
240+
window.localStorage.setItem("mx_lhs_size", '' + size);
239241
this.props.resizeNotifier.stopResizing();
240242
},
241243
};
242-
const resizer = new Resizer(
243-
this._resizeContainer.current,
244-
CollapseDistributor,
245-
collapseConfig);
244+
const resizer = new Resizer(this._resizeContainer.current, CollapseDistributor, collapseConfig);
246245
resizer.setClassNames(classNames);
247246
return resizer;
248247
}

src/components/structures/RoomView.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1853,7 +1853,6 @@ export default class RoomView extends React.Component<IProps, IState> {
18531853
draggingFile={this.state.draggingFile}
18541854
maxHeight={this.state.auxPanelMaxHeight}
18551855
showApps={this.state.showApps}
1856-
hideAppsDrawer={false}
18571856
onResize={this.onResize}
18581857
resizeNotifier={this.props.resizeNotifier}
18591858
>

src/components/views/rooms/AppsDrawer.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,10 @@ export default class AppsDrawer extends React.Component {
4040
room: PropTypes.object.isRequired,
4141
resizeNotifier: PropTypes.instanceOf(ResizeNotifier).isRequired,
4242
showApps: PropTypes.bool, // Should apps be rendered
43-
hide: PropTypes.bool, // If rendered, should apps drawer be visible
4443
};
4544

4645
static defaultProps = {
4746
showApps: true,
48-
hide: false,
4947
};
5048

5149
constructor(props) {
@@ -173,7 +171,6 @@ export default class AppsDrawer extends React.Component {
173171

174172
const classes = classNames({
175173
"mx_AppsDrawer": true,
176-
"mx_AppsDrawer_hidden": this.props.hide,
177174
"mx_AppsDrawer_fullWidth": apps.length < 2,
178175
"mx_AppsDrawer_minimised": !this.props.showApps,
179176
});

src/components/views/rooms/AuxPanel.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export default class AuxPanel extends React.Component {
3737
room: PropTypes.object.isRequired,
3838
userId: PropTypes.string.isRequired,
3939
showApps: PropTypes.bool, // Render apps
40-
hideAppsDrawer: PropTypes.bool, // Do not display apps drawer and content (may still be rendered)
4140

4241
// set to true to show the file drop target
4342
draggingFile: PropTypes.bool,
@@ -54,7 +53,6 @@ export default class AuxPanel extends React.Component {
5453

5554
static defaultProps = {
5655
showApps: true,
57-
hideAppsDrawer: false,
5856
};
5957

6058
constructor(props) {
@@ -170,7 +168,6 @@ export default class AuxPanel extends React.Component {
170168
userId={this.props.userId}
171169
maxHeight={this.props.maxHeight}
172170
showApps={this.props.showApps}
173-
hide={this.props.hideAppsDrawer}
174171
resizeNotifier={this.props.resizeNotifier}
175172
/>;
176173
}

0 commit comments

Comments
 (0)