Fix: align base card close button to the right always (#11861)

This commit is contained in:
Kerry 2023-11-14 10:57:20 +13:00 committed by GitHub
parent cda17d55b4
commit a3f0633037
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 21 deletions

View file

@ -51,7 +51,6 @@ limitations under the License.
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
width: calc(100% - 38px);
height: 24px; height: 24px;
flex: 1; flex: 1;
@ -157,6 +156,7 @@ limitations under the License.
.mx_BaseCard_back, .mx_BaseCard_back,
.mx_BaseCard_close { .mx_BaseCard_close {
flex-shrink: 0;
position: relative; position: relative;
background-color: var(--cpd-color-bg-subtle-secondary); background-color: var(--cpd-color-bg-subtle-secondary);
width: var(--BaseCard_header-button-size); width: var(--BaseCard_header-button-size);
@ -226,3 +226,7 @@ limitations under the License.
} }
} }
} }
.mx_BaseCard_headerProp {
flex: 1 1 100%;
}

View file

@ -194,10 +194,6 @@ limitations under the License.
.mx_RoomSummaryCard_header { .mx_RoomSummaryCard_header {
padding: 15px 12px; padding: 15px 12px;
.mx_BaseCard_close {
flex-shrink: 0;
}
} }
.mx_RoomSummaryCard_search input { .mx_RoomSummaryCard_search input {

View file

@ -90,7 +90,7 @@ const BaseCard: React.FC<IProps> = forwardRef<HTMLDivElement, IProps>(
<div className="mx_BaseCard_header"> <div className="mx_BaseCard_header">
{backButton} {backButton}
{closeButton} {closeButton}
{header} <div className="mx_BaseCard_headerProp">{header}</div>
</div> </div>
)} )}
{children} {children}

View file

@ -19,6 +19,9 @@ exports[`AppTile destroys non-persisted right panel widget on room change 1`] =
tabindex="0" tabindex="0"
title="Close" title="Close"
/> />
<div
class="mx_BaseCard_headerProp"
>
<div <div
class="mx_BaseCard_header_title" class="mx_BaseCard_header_title"
> >
@ -38,6 +41,7 @@ exports[`AppTile destroys non-persisted right panel widget on room change 1`] =
/> />
</div> </div>
</div> </div>
</div>
<div <div
class="mx_AppTileFullWidth" class="mx_AppTileFullWidth"
id="1" id="1"

View file

@ -84,8 +84,12 @@ exports[`<UserInfo /> with crypto enabled renders <BasicUserInfo /> 1`] = `
tabindex="0" tabindex="0"
title="Close" title="Close"
/> />
<div
class="mx_BaseCard_headerProp"
>
<span /> <span />
</div> </div>
</div>
<div <div
class="mx_AutoHideScrollbar" class="mx_AutoHideScrollbar"
tabindex="-1" tabindex="-1"