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

Commit ed6a371

Browse files
authored
Fix buttons alignment of Space list header (#8047)
1 parent 14807de commit ed6a371

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

res/css/structures/_SpaceHierarchy.scss

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,36 +35,40 @@ limitations under the License.
3535
}
3636

3737
.mx_SpaceHierarchy_listHeader {
38-
display: flex;
39-
min-height: 32px;
38+
display: grid;
39+
justify-content: space-between;
4040
align-items: center;
41+
column-gap: 10px;
42+
min-height: 32px;
4143
font-size: $font-15px;
4244
line-height: $font-24px;
4345
color: $primary-content;
4446
margin-bottom: 12px;
4547

46-
> h4 {
48+
.mx_SpaceHierarchy_listHeader_header {
49+
grid-column-start: 1;
4750
font-weight: $font-semi-bold;
4851
margin: 0;
4952
}
5053

51-
.mx_AccessibleButton {
52-
padding: 4px 12px;
53-
font-weight: normal;
54+
.mx_SpaceHierarchy_listHeader_buttons {
55+
grid-column-start: 2;
56+
display: flex;
57+
flex-flow: wrap;
58+
justify-content: flex-end;
59+
row-gap: 12px;
60+
column-gap: 12px;
5461

55-
& + .mx_AccessibleButton {
56-
margin-left: 16px;
62+
.mx_AccessibleButton {
63+
padding: 4px 12px;
64+
font-weight: normal;
5765
}
5866
}
5967

6068
.mx_AccessibleButton_kind_danger_outline,
6169
.mx_AccessibleButton_kind_primary_outline {
6270
padding: 3px 12px; // to account for the 1px border
6371
}
64-
65-
> span {
66-
margin-left: auto;
67-
}
6872
}
6973

7074
.mx_SpaceHierarchy_error {

src/components/structures/SpaceHierarchy.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -770,8 +770,10 @@ const SpaceHierarchy = ({
770770

771771
content = <>
772772
<div className="mx_SpaceHierarchy_listHeader">
773-
<h4>{ query.trim() ? _t("Results") : _t("Rooms and spaces") }</h4>
774-
<span>
773+
<h4 className="mx_SpaceHierarchy_listHeader_header">
774+
{ query.trim() ? _t("Results") : _t("Rooms and spaces") }
775+
</h4>
776+
<div className="mx_SpaceHierarchy_listHeader_buttons">
775777
{ additionalButtons }
776778
{ hasPermissions && (
777779
<ManageButtons
@@ -781,7 +783,7 @@ const SpaceHierarchy = ({
781783
setError={setError}
782784
/>
783785
) }
784-
</span>
786+
</div>
785787
</div>
786788
{ errorText && <div className="mx_SpaceHierarchy_error">
787789
{ errorText }

0 commit comments

Comments
 (0)