Move General user settings styles to more specific places

This was w grab bag of styles for the email/phone components and
one for something now in preferences. Move them elsewhere so I can
rename the tab sensibly.
This commit is contained in:
David Baker 2024-08-01 16:45:56 +01:00
parent 9cd0c247a2
commit 77062ac721
7 changed files with 56 additions and 38 deletions

View file

@ -37,6 +37,7 @@
@import "./components/views/messages/shared/_MediaProcessingError.pcss"; @import "./components/views/messages/shared/_MediaProcessingError.pcss";
@import "./components/views/pips/_WidgetPip.pcss"; @import "./components/views/pips/_WidgetPip.pcss";
@import "./components/views/polls/_PollOption.pcss"; @import "./components/views/polls/_PollOption.pcss";
@import "./components/views/settings/_EmailAddressesPhoneNumbers.pcss";
@import "./components/views/settings/devices/_CurrentDeviceSection.pcss"; @import "./components/views/settings/devices/_CurrentDeviceSection.pcss";
@import "./components/views/settings/devices/_DeviceDetailHeading.pcss"; @import "./components/views/settings/devices/_DeviceDetailHeading.pcss";
@import "./components/views/settings/devices/_DeviceDetails.pcss"; @import "./components/views/settings/devices/_DeviceDetails.pcss";
@ -356,10 +357,10 @@
@import "./views/settings/tabs/room/_RolesRoomSettingsTab.pcss"; @import "./views/settings/tabs/room/_RolesRoomSettingsTab.pcss";
@import "./views/settings/tabs/room/_SecurityRoomSettingsTab.pcss"; @import "./views/settings/tabs/room/_SecurityRoomSettingsTab.pcss";
@import "./views/settings/tabs/user/_AppearanceUserSettingsTab.pcss"; @import "./views/settings/tabs/user/_AppearanceUserSettingsTab.pcss";
@import "./views/settings/tabs/user/_GeneralUserSettingsTab.pcss";
@import "./views/settings/tabs/user/_HelpUserSettingsTab.pcss"; @import "./views/settings/tabs/user/_HelpUserSettingsTab.pcss";
@import "./views/settings/tabs/user/_KeyboardUserSettingsTab.pcss"; @import "./views/settings/tabs/user/_KeyboardUserSettingsTab.pcss";
@import "./views/settings/tabs/user/_MjolnirUserSettingsTab.pcss"; @import "./views/settings/tabs/user/_MjolnirUserSettingsTab.pcss";
@import "./views/settings/tabs/user/_PreferencesUserSettingsTab.pcss";
@import "./views/settings/tabs/user/_SecurityUserSettingsTab.pcss"; @import "./views/settings/tabs/user/_SecurityUserSettingsTab.pcss";
@import "./views/settings/tabs/user/_SidebarUserSettingsTab.pcss"; @import "./views/settings/tabs/user/_SidebarUserSettingsTab.pcss";
@import "./views/spaces/_SpaceBasicSettings.pcss"; @import "./views/spaces/_SpaceBasicSettings.pcss";

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2019 New Vector Ltd Copyright 2019 New Vector Ltd
Copyright 2024 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -14,28 +15,23 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
.mx_GeneralUserSettingsTab_section--discovery_existing { /*
* These used to live in Generl User Settings. These components are horrily duplicative
* but share the same styles. For now I'm putting them here so I can renamed the general
* tab sensibly and before I can refactor these components.
*/
.mx_EmailAddressesPhoneNumbers_discovery_existing {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.mx_GeneralUserSettingsTab_section--discovery_existing_address, .mx_EmailAddressesPhoneNumbers_discovery_existing_address,
.mx_GeneralUserSettingsTab_section--discovery_existing_promptText { .mx_EmailAddressesPhoneNumbers_discovery_existing_promptText {
flex: 1; flex: 1;
margin-right: 10px; margin-right: 10px;
} }
.mx_GeneralUserSettingsTab_section--discovery_existing_button { .mx_EmailAddressesPhoneNumbers_discovery_existing_button {
margin-left: 5px; margin-left: 5px;
} }
.mx_GeneralUserSettingsTab_warningIcon {
vertical-align: middle;
margin-right: $spacing-8;
margin-bottom: 2px;
}
.mx_GeneralUserSettingsTab_section_hint {
font: var(--cpd-font-body-sm-regular);
color: var(--cpd-color-text-secondary);
}

View file

@ -0,0 +1,21 @@
/*
Copyright 2019 New Vector Ltd
Copyright 2024 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
.mx_EmailAddressesPhoneNumbers_section_hint {
font: var(--cpd-font-body-sm-regular);
color: var(--cpd-color-text-secondary);
}

View file

@ -97,21 +97,21 @@ export class ExistingEmailAddress extends React.Component<IExistingEmailAddressP
public render(): React.ReactNode { public render(): React.ReactNode {
if (this.state.verifyRemove) { if (this.state.verifyRemove) {
return ( return (
<div className="mx_GeneralUserSettingsTab_section--discovery_existing"> <div className="mx_EmailAddressesPhoneNumbers_discovery_existing">
<span className="mx_GeneralUserSettingsTab_section--discovery_existing_promptText"> <span className="mx_EmailAddressesPhoneNumbers_discovery_existing_promptText">
{_t("settings|general|remove_email_prompt", { email: this.props.email.address })} {_t("settings|general|remove_email_prompt", { email: this.props.email.address })}
</span> </span>
<AccessibleButton <AccessibleButton
onClick={this.onActuallyRemove} onClick={this.onActuallyRemove}
kind="danger_sm" kind="danger_sm"
className="mx_GeneralUserSettingsTab_section--discovery_existing_button" className="mx_EmailAddressesPhoneNumbers_discovery_existing_button"
> >
{_t("action|remove")} {_t("action|remove")}
</AccessibleButton> </AccessibleButton>
<AccessibleButton <AccessibleButton
onClick={this.onDontRemove} onClick={this.onDontRemove}
kind="link_sm" kind="link_sm"
className="mx_GeneralUserSettingsTab_section--discovery_existing_button" className="mx_EmailAddressesPhoneNumbers_discovery_existing_button"
> >
{_t("action|cancel")} {_t("action|cancel")}
</AccessibleButton> </AccessibleButton>
@ -120,8 +120,8 @@ export class ExistingEmailAddress extends React.Component<IExistingEmailAddressP
} }
return ( return (
<div className="mx_GeneralUserSettingsTab_section--discovery_existing"> <div className="mx_EmailAddressesPhoneNumbers_discovery_existing">
<span className="mx_GeneralUserSettingsTab_section--discovery_existing_address"> <span className="mx_EmailAddressesPhoneNumbers_discovery_existing_address">
{this.props.email.address} {this.props.email.address}
</span> </span>
<AccessibleButton onClick={this.onRemove} kind="danger_sm" disabled={this.props.disabled}> <AccessibleButton onClick={this.onRemove} kind="danger_sm" disabled={this.props.disabled}>

View file

@ -93,21 +93,21 @@ export class ExistingPhoneNumber extends React.Component<IExistingPhoneNumberPro
public render(): React.ReactNode { public render(): React.ReactNode {
if (this.state.verifyRemove) { if (this.state.verifyRemove) {
return ( return (
<div className="mx_GeneralUserSettingsTab_section--discovery_existing"> <div className="mx_EmailAddressesPhoneNumbers_discovery_existing">
<span className="mx_GeneralUserSettingsTab_section--discovery_existing_promptText"> <span className="mx_EmailAddressesPhoneNumbers_discovery_existing_promptText">
{_t("settings|general|remove_msisdn_prompt", { phone: this.props.msisdn.address })} {_t("settings|general|remove_msisdn_prompt", { phone: this.props.msisdn.address })}
</span> </span>
<AccessibleButton <AccessibleButton
onClick={this.onActuallyRemove} onClick={this.onActuallyRemove}
kind="danger_sm" kind="danger_sm"
className="mx_GeneralUserSettingsTab_section--discovery_existing_button" className="mx_EmailAddressesPhoneNumbers_discovery_existing_button"
> >
{_t("action|remove")} {_t("action|remove")}
</AccessibleButton> </AccessibleButton>
<AccessibleButton <AccessibleButton
onClick={this.onDontRemove} onClick={this.onDontRemove}
kind="link_sm" kind="link_sm"
className="mx_GeneralUserSettingsTab_section--discovery_existing_button" className="mx_EmailAddressesPhoneNumbers_discovery_existing_button"
> >
{_t("action|cancel")} {_t("action|cancel")}
</AccessibleButton> </AccessibleButton>
@ -116,8 +116,8 @@ export class ExistingPhoneNumber extends React.Component<IExistingPhoneNumberPro
} }
return ( return (
<div className="mx_GeneralUserSettingsTab_section--discovery_existing"> <div className="mx_EmailAddressesPhoneNumbers_discovery_existing">
<span className="mx_GeneralUserSettingsTab_section--discovery_existing_address"> <span className="mx_EmailAddressesPhoneNumbers_discovery_existing_address">
+{this.props.msisdn.address} +{this.props.msisdn.address}
</span> </span>
<AccessibleButton onClick={this.onRemove} kind="danger_sm" disabled={this.props.disabled}> <AccessibleButton onClick={this.onRemove} kind="danger_sm" disabled={this.props.disabled}>

View file

@ -178,7 +178,7 @@ export class EmailAddress extends React.Component<IEmailAddressProps, IEmailAddr
<span> <span>
{_t("settings|general|discovery_email_verification_instructions")} {_t("settings|general|discovery_email_verification_instructions")}
<AccessibleButton <AccessibleButton
className="mx_GeneralUserSettingsTab_section--discovery_existing_button" className="mx_EmailAddressesPhoneNumbers_discovery_existing_button"
kind="primary_sm" kind="primary_sm"
onClick={this.onContinueClick} onClick={this.onContinueClick}
disabled={this.state.continueDisabled} disabled={this.state.continueDisabled}
@ -190,7 +190,7 @@ export class EmailAddress extends React.Component<IEmailAddressProps, IEmailAddr
} else if (bound) { } else if (bound) {
status = ( status = (
<AccessibleButton <AccessibleButton
className="mx_GeneralUserSettingsTab_section--discovery_existing_button" className="mx_EmailAddressesPhoneNumbers_discovery_existing_button"
kind="danger_sm" kind="danger_sm"
onClick={this.onRevokeClick} onClick={this.onRevokeClick}
disabled={this.props.disabled} disabled={this.props.disabled}
@ -201,7 +201,7 @@ export class EmailAddress extends React.Component<IEmailAddressProps, IEmailAddr
} else { } else {
status = ( status = (
<AccessibleButton <AccessibleButton
className="mx_GeneralUserSettingsTab_section--discovery_existing_button" className="mx_EmailAddressesPhoneNumbers_discovery_existing_button"
kind="primary_sm" kind="primary_sm"
onClick={this.onShareClick} onClick={this.onShareClick}
disabled={this.props.disabled} disabled={this.props.disabled}
@ -212,8 +212,8 @@ export class EmailAddress extends React.Component<IEmailAddressProps, IEmailAddr
} }
return ( return (
<div className="mx_GeneralUserSettingsTab_section--discovery_existing"> <div className="mx_EmailAddressesPhoneNumbers_discovery_existing">
<span className="mx_GeneralUserSettingsTab_section--discovery_existing_address">{address}</span> <span className="mx_EmailAddressesPhoneNumbers_discovery_existing_address">{address}</span>
{status} {status}
</div> </div>
); );

View file

@ -179,7 +179,7 @@ export class PhoneNumber extends React.Component<IPhoneNumberProps, IPhoneNumber
let status; let status;
if (verifying) { if (verifying) {
status = ( status = (
<span className="mx_GeneralUserSettingsTab_section--discovery_existing_verification"> <span className="mx_EmailAddressesPhoneNumbers_discovery_existing_verification">
<span> <span>
{_t("settings|general|msisdn_verification_instructions")} {_t("settings|general|msisdn_verification_instructions")}
<br /> <br />
@ -200,7 +200,7 @@ export class PhoneNumber extends React.Component<IPhoneNumberProps, IPhoneNumber
} else if (bound) { } else if (bound) {
status = ( status = (
<AccessibleButton <AccessibleButton
className="mx_GeneralUserSettingsTab_section--discovery_existing_button" className="mx_EmailAddressesPhoneNumbers_discovery_existing_button"
kind="danger_sm" kind="danger_sm"
onClick={this.onRevokeClick} onClick={this.onRevokeClick}
disabled={this.props.disabled} disabled={this.props.disabled}
@ -211,7 +211,7 @@ export class PhoneNumber extends React.Component<IPhoneNumberProps, IPhoneNumber
} else { } else {
status = ( status = (
<AccessibleButton <AccessibleButton
className="mx_GeneralUserSettingsTab_section--discovery_existing_button" className="mx_EmailAddressesPhoneNumbers_discovery_existing_button"
kind="primary_sm" kind="primary_sm"
onClick={this.onShareClick} onClick={this.onShareClick}
disabled={this.props.disabled} disabled={this.props.disabled}
@ -222,8 +222,8 @@ export class PhoneNumber extends React.Component<IPhoneNumberProps, IPhoneNumber
} }
return ( return (
<div className="mx_GeneralUserSettingsTab_section--discovery_existing"> <div className="mx_EmailAddressesPhoneNumbers_discovery_existing">
<span className="mx_GeneralUserSettingsTab_section--discovery_existing_address">+{address}</span> <span className="mx_EmailAddressesPhoneNumbers_discovery_existing_address">+{address}</span>
{status} {status}
</div> </div>
); );