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

Make dialog's header compatible with RTL layout #8231

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions res/css/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,25 @@ legend {
position: relative;
padding: 3px 0;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
align-items: first baseline;

.mx_Dialog_cancelButton {
mask: url('$(res)/img/feather-customised/cancel.svg');
mask-repeat: no-repeat;
mask-position: center;
mask-size: cover;
width: 14px;
height: 14px;
background-color: $dialog-close-fg-color;
cursor: pointer;
margin-inline-start: 20px; // Add 20px space between the button and mx_Dialog_title

// Move the cancel button to align with mx_Dialog_title
position: relative;
top: -3px;
}
}

.mx_Dialog_titleImage {
Expand All @@ -378,28 +397,11 @@ legend {
.mx_Dialog_header.mx_Dialog_headerWithButton > .mx_Dialog_title {
text-align: center;
}
.mx_Dialog_header.mx_Dialog_headerWithCancel {
padding-right: 20px; // leave space for the 'X' cancel button
}

.mx_Dialog_title.danger {
color: $alert;
}

.mx_Dialog_cancelButton {
mask: url('$(res)/img/feather-customised/cancel.svg');
mask-repeat: no-repeat;
mask-position: center;
mask-size: cover;
width: 14px;
height: 14px;
background-color: $dialog-close-fg-color;
cursor: pointer;
position: absolute;
top: 10px;
right: 0;
}

.mx_Dialog_content {
margin: 24px 0 68px;
font-size: $font-14px;
Expand Down
1 change: 0 additions & 1 deletion src/components/views/dialogs/BaseDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ export default class BaseDialog extends React.Component<IProps> {
>
<div className={classNames('mx_Dialog_header', {
'mx_Dialog_headerWithButton': !!this.props.headerButton,
'mx_Dialog_headerWithCancel': !!cancelButton,
})}>
<Heading size='h2' className={classNames('mx_Dialog_title', this.props.titleClass)} id='mx_BaseDialog_title'>
{ headerImage }
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/HostSignupDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export default class HostSignupDialog extends React.PureComponent<IProps, IState
</div>
}
{ !this.state.minimized &&
<div className="mx_Dialog_header mx_Dialog_headerWithCancel">
<div className="mx_Dialog_header">
<AccessibleButton
onClick={this.minimizeDialog}
className="mx_HostSignup_minimize_button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Array [
role="dialog"
>
<div
class="mx_Dialog_header mx_Dialog_headerWithCancel"
class="mx_Dialog_header"
>
<h2
class="mx_Heading_h2 mx_Dialog_title"
Expand Down Expand Up @@ -293,7 +293,7 @@ Array [
role="dialog"
>
<div
class="mx_Dialog_header mx_Dialog_headerWithCancel"
class="mx_Dialog_header"
>
<h2
class="mx_Heading_h2 mx_Dialog_title"
Expand Down Expand Up @@ -512,7 +512,7 @@ Array [
role="dialog"
>
<div
className="mx_Dialog_header mx_Dialog_headerWithCancel"
className="mx_Dialog_header"
>
<Heading
className="mx_Dialog_title"
Expand Down Expand Up @@ -913,7 +913,7 @@ Array [
role="dialog"
>
<div
class="mx_Dialog_header mx_Dialog_headerWithCancel"
class="mx_Dialog_header"
>
<h2
class="mx_Heading_h2 mx_Dialog_title"
Expand Down Expand Up @@ -1134,7 +1134,7 @@ Array [
role="dialog"
>
<div
class="mx_Dialog_header mx_Dialog_headerWithCancel"
class="mx_Dialog_header"
>
<h2
class="mx_Heading_h2 mx_Dialog_title"
Expand Down Expand Up @@ -1353,7 +1353,7 @@ Array [
role="dialog"
>
<div
className="mx_Dialog_header mx_Dialog_headerWithCancel"
className="mx_Dialog_header"
>
<Heading
className="mx_Dialog_title"
Expand Down Expand Up @@ -1741,7 +1741,7 @@ Array [
role="dialog"
>
<div
class="mx_Dialog_header mx_Dialog_headerWithCancel"
class="mx_Dialog_header"
>
<h2
class="mx_Heading_h2 mx_Dialog_title"
Expand Down Expand Up @@ -1962,7 +1962,7 @@ Array [
role="dialog"
>
<div
class="mx_Dialog_header mx_Dialog_headerWithCancel"
class="mx_Dialog_header"
>
<h2
class="mx_Heading_h2 mx_Dialog_title"
Expand Down Expand Up @@ -2181,7 +2181,7 @@ Array [
role="dialog"
>
<div
className="mx_Dialog_header mx_Dialog_headerWithCancel"
className="mx_Dialog_header"
>
<Heading
className="mx_Dialog_title"
Expand Down Expand Up @@ -2530,7 +2530,7 @@ Array [
role="dialog"
>
<div
className="mx_Dialog_header mx_Dialog_headerWithCancel"
className="mx_Dialog_header"
>
<Heading
className="mx_Dialog_title"
Expand Down