From b174cc8963d1544d64b64c3244db579d46fd2dcd Mon Sep 17 00:00:00 2001 From: Kerry Date: Wed, 15 Dec 2021 17:05:58 +0100 Subject: [PATCH] Use semantic heading on dialog component (#7383) * use semantic heading on dialog Signed-off-by: Kerry Archibald * tidy styles Signed-off-by: Kerry Archibald * un-flex text centering Signed-off-by: Kerry Archibald --- res/css/_common.scss | 12 +++++++----- res/css/views/dialogs/_SettingsDialog.scss | 4 ---- src/components/views/dialogs/BaseDialog.tsx | 5 +++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/res/css/_common.scss b/res/css/_common.scss index e4a5f8ddd0..b153d2c3cb 100644 --- a/res/css/_common.scss +++ b/res/css/_common.scss @@ -355,6 +355,7 @@ legend { .mx_Dialog_header { position: relative; + padding: 3px 0; margin-bottom: 10px; } @@ -364,20 +365,21 @@ legend { height: 25px; margin-left: -2px; margin-right: 4px; + margin-bottom: 2px; } .mx_Dialog_title { - font-size: $font-22px; - font-weight: $font-semi-bold; - line-height: $font-36px; color: $dialog-title-fg-color; + display: inline-block; + width: 100%; + box-sizing: border-box; } .mx_Dialog_header.mx_Dialog_headerWithButton > .mx_Dialog_title { text-align: center; } -.mx_Dialog_header.mx_Dialog_headerWithCancel > .mx_Dialog_title { - margin-right: 20px; // leave space for the 'X' cancel button +.mx_Dialog_header.mx_Dialog_headerWithCancel { + padding-right: 20px; // leave space for the 'X' cancel button } .mx_Dialog_title.danger { diff --git a/res/css/views/dialogs/_SettingsDialog.scss b/res/css/views/dialogs/_SettingsDialog.scss index f9b373c30a..59aed520fd 100644 --- a/res/css/views/dialogs/_SettingsDialog.scss +++ b/res/css/views/dialogs/_SettingsDialog.scss @@ -36,8 +36,4 @@ limitations under the License. // colliding harshly with the dialog when scrolled down. padding-bottom: 100px; } - - .mx_Dialog_title { - margin-bottom: 24px; - } } diff --git a/src/components/views/dialogs/BaseDialog.tsx b/src/components/views/dialogs/BaseDialog.tsx index 15c9114ca2..52773c13b9 100644 --- a/src/components/views/dialogs/BaseDialog.tsx +++ b/src/components/views/dialogs/BaseDialog.tsx @@ -27,6 +27,7 @@ import { MatrixClientPeg } from '../../../MatrixClientPeg'; import { _t } from "../../../languageHandler"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { replaceableComponent } from "../../../utils/replaceableComponent"; +import Heading from '../typography/Heading'; import { IDialogProps } from "./IDialogProps"; interface IProps extends IDialogProps { @@ -141,10 +142,10 @@ export default class BaseDialog extends React.Component { 'mx_Dialog_headerWithButton': !!this.props.headerButton, 'mx_Dialog_headerWithCancel': !!cancelButton, })}> -
+ { headerImage } { this.props.title } -
+ { this.props.headerButton } { cancelButton }