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

Commit a3f0633

Browse files
author
Kerry
authored
Fix: align base card close button to the right always (#11861)
1 parent cda17d5 commit a3f0633

File tree

5 files changed

+29
-21
lines changed

5 files changed

+29
-21
lines changed

res/css/views/right_panel/_BaseCard.pcss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ limitations under the License.
5151
display: flex;
5252
align-items: center;
5353
justify-content: space-between;
54-
width: calc(100% - 38px);
5554
height: 24px;
5655
flex: 1;
5756

@@ -157,6 +156,7 @@ limitations under the License.
157156

158157
.mx_BaseCard_back,
159158
.mx_BaseCard_close {
159+
flex-shrink: 0;
160160
position: relative;
161161
background-color: var(--cpd-color-bg-subtle-secondary);
162162
width: var(--BaseCard_header-button-size);
@@ -226,3 +226,7 @@ limitations under the License.
226226
}
227227
}
228228
}
229+
230+
.mx_BaseCard_headerProp {
231+
flex: 1 1 100%;
232+
}

res/css/views/right_panel/_RoomSummaryCard.pcss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,6 @@ limitations under the License.
194194

195195
.mx_RoomSummaryCard_header {
196196
padding: 15px 12px;
197-
198-
.mx_BaseCard_close {
199-
flex-shrink: 0;
200-
}
201197
}
202198

203199
.mx_RoomSummaryCard_search input {

src/components/views/right_panel/BaseCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const BaseCard: React.FC<IProps> = forwardRef<HTMLDivElement, IProps>(
9090
<div className="mx_BaseCard_header">
9191
{backButton}
9292
{closeButton}
93-
{header}
93+
<div className="mx_BaseCard_headerProp">{header}</div>
9494
</div>
9595
)}
9696
{children}

test/components/views/elements/__snapshots__/AppTile-test.tsx.snap

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,26 @@ exports[`AppTile destroys non-persisted right panel widget on room change 1`] =
2020
title="Close"
2121
/>
2222
<div
23-
class="mx_BaseCard_header_title"
23+
class="mx_BaseCard_headerProp"
2424
>
25-
<h4
26-
class="mx_Heading_h4 mx_BaseCard_header_title_heading"
27-
>
28-
Example 1
29-
</h4>
3025
<div
31-
aria-expanded="false"
32-
aria-haspopup="true"
33-
aria-label="Options"
34-
class="mx_AccessibleButton mx_BaseCard_header_title_button--option"
35-
role="button"
36-
tabindex="0"
37-
title="Options"
38-
/>
26+
class="mx_BaseCard_header_title"
27+
>
28+
<h4
29+
class="mx_Heading_h4 mx_BaseCard_header_title_heading"
30+
>
31+
Example 1
32+
</h4>
33+
<div
34+
aria-expanded="false"
35+
aria-haspopup="true"
36+
aria-label="Options"
37+
class="mx_AccessibleButton mx_BaseCard_header_title_button--option"
38+
role="button"
39+
tabindex="0"
40+
title="Options"
41+
/>
42+
</div>
3943
</div>
4044
</div>
4145
<div

test/components/views/right_panel/__snapshots__/UserInfo-test.tsx.snap

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ exports[`<UserInfo /> with crypto enabled renders <BasicUserInfo /> 1`] = `
8484
tabindex="0"
8585
title="Close"
8686
/>
87-
<span />
87+
<div
88+
class="mx_BaseCard_headerProp"
89+
>
90+
<span />
91+
</div>
8892
</div>
8993
<div
9094
class="mx_AutoHideScrollbar"

0 commit comments

Comments
 (0)