From 33d680b134251e1c19eff4aee368bb7a335a83b1 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 25 Jun 2022 17:23:33 +0000 Subject: [PATCH] Clarify style rule structure of ProfileSettings to avoid unexpected regressions (#8884) --- res/css/views/settings/_ProfileSettings.scss | 80 +++++++++---------- .../room_settings/RoomProfileSettings.tsx | 12 ++- .../views/settings/ProfileSettings.tsx | 6 +- 3 files changed, 51 insertions(+), 47 deletions(-) diff --git a/res/css/views/settings/_ProfileSettings.scss b/res/css/views/settings/_ProfileSettings.scss index 3a7f66f127..c3849d16d3 100644 --- a/res/css/views/settings/_ProfileSettings.scss +++ b/res/css/views/settings/_ProfileSettings.scss @@ -14,49 +14,49 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_ProfileSettings_controls_topic { - & > textarea { - font-family: inherit; - resize: vertical; - } -} - -.mx_ProfileSettings_profile { - display: flex; -} - -.mx_ProfileSettings_controls { - flex-grow: 1; - margin-right: 54px; -} - -.mx_ProfileSettings_controls .mx_Field #profileTopic { - height: 4em; -} - -.mx_ProfileSettings_controls .mx_Field:first-child { - margin-top: 0; -} - -.mx_ProfileSettings_userId { - margin-right: $spacing-20; -} - -.mx_ProfileSettings_avatarUpload { - display: none; -} - -.mx_ProfileSettings_profileForm { +.mx_ProfileSettings { @mixin mx_Settings_fullWidthField; border-bottom: 1px solid $quinary-content; -} -.mx_ProfileSettings_buttons { - margin-top: 10px; // 18px is already accounted for by the

above the buttons - margin-bottom: 28px; + .mx_ProfileSettings_avatarUpload { + display: none; + } - > .mx_AccessibleButton_kind_link { - font-size: $font-14px; - margin-right: 10px; + .mx_ProfileSettings_profile { + display: flex; + + .mx_ProfileSettings_profile_controls { + flex-grow: 1; + margin-inline-end: 54px; + + .mx_Field:first-child { + margin-top: 0; + } + + .mx_ProfileSettings_profile_controls_topic { + & > textarea { + font-family: inherit; + resize: vertical; + } + + &.mx_ProfileSettings_profile_controls_topic--room { + height: 4em; + } + } + + .mx_ProfileSettings_profile_controls_userId { + margin-inline-end: $spacing-20; + } + } + } + + .mx_ProfileSettings_buttons { + margin-top: 10px; // 18px is already accounted for by the

above the buttons + margin-bottom: $spacing-28; + + > .mx_AccessibleButton_kind_link { + font-size: $font-14px; + margin-inline-end: 10px; // TODO: Use a spacing variable + } } } diff --git a/src/components/views/room_settings/RoomProfileSettings.tsx b/src/components/views/room_settings/RoomProfileSettings.tsx index 6e4900478a..86e266bc35 100644 --- a/src/components/views/room_settings/RoomProfileSettings.tsx +++ b/src/components/views/room_settings/RoomProfileSettings.tsx @@ -15,6 +15,7 @@ limitations under the License. */ import React, { createRef } from 'react'; +import classNames from "classnames"; import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; @@ -249,7 +250,7 @@ export default class RoomProfileSettings extends React.Component onSubmit={this.saveProfile} autoComplete="off" noValidate={true} - className="mx_ProfileSettings_profileForm" + className="mx_ProfileSettings" > accept="image/*" />

-
+
disabled={!this.state.canSetName} /> { onSubmit={this.saveProfile} autoComplete="off" noValidate={true} - className="mx_ProfileSettings_profileForm" + className="mx_ProfileSettings" > { accept="image/*" />
-
+
{ _t("Profile") } { onChange={this.onDisplayNameChanged} />

- { userIdentifier && + { userIdentifier && { userIdentifier } } { hostingSignup }