From 26176116bf955cd03ac90c77a1dd23c62141037d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 6 Mar 2024 23:34:14 +0000 Subject: [PATCH] Use `strong` element to semantically denote visually emphasised content (#12320) * Use `strong` element to semantically denote visually emphasised content Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update snapshots Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Add comment Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../dialogs/security/_AccessSecretStorageDialog.pcss | 2 ++ .../views/dialogs/security/NewRecoveryMethodDialog.tsx | 4 +++- .../dialogs/security/RecoveryMethodRemovedDialog.tsx | 2 +- src/components/structures/MatrixChat.tsx | 8 ++++---- .../dialogs/security/AccessSecretStorageDialog.tsx | 10 +++++----- src/components/views/settings/SetIdServer.tsx | 4 ++-- .../settings/tabs/user/MjolnirUserSettingsTab.tsx | 4 ++-- .../__snapshots__/MjolnirUserSettingsTab-test.tsx.snap | 8 ++++---- 8 files changed, 23 insertions(+), 19 deletions(-) diff --git a/res/css/views/dialogs/security/_AccessSecretStorageDialog.pcss b/res/css/views/dialogs/security/_AccessSecretStorageDialog.pcss index 85e5c08258..82e490c781 100644 --- a/res/css/views/dialogs/security/_AccessSecretStorageDialog.pcss +++ b/res/css/views/dialogs/security/_AccessSecretStorageDialog.pcss @@ -117,6 +117,8 @@ limitations under the License. .mx_AccessSecretStorageDialog_reset { position: relative; padding-inline-start: $spacingStart; + /* To avoid bold styling inherent with elements */ + font-weight: inherit; &::before { content: ""; diff --git a/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx b/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx index 95aab12e45..0778879976 100644 --- a/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx +++ b/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx @@ -63,7 +63,9 @@ export default class NewRecoveryMethodDialog extends React.PureComponent const newMethodDetected =

{_t("encryption|new_recovery_method_detected|description_1")}

; - const hackWarning =

{_t("encryption|new_recovery_method_detected|warning")}

; + const hackWarning = ( + {_t("encryption|new_recovery_method_detected|warning")} + ); let content: JSX.Element | undefined; if (MatrixClientPeg.safeGet().getKeyBackupEnabled()) { diff --git a/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.tsx b/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.tsx index 4dafcfa518..c864eb1abb 100644 --- a/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.tsx +++ b/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.tsx @@ -55,7 +55,7 @@ export default class RecoveryMethodRemovedDialog extends React.PureComponent

{_t("encryption|recovery_method_removed|description_1")}

{_t("encryption|recovery_method_removed|description_2")}

-

{_t("encryption|recovery_method_removed|warning")}

+ {_t("encryption|recovery_method_removed|warning")} { const memberCount = roomToLeave?.currentState.getJoinedMemberCount(); if (memberCount === 1) { warnings.push( - + {" " /* Whitespace, otherwise the sentences get smashed together */} {_t("leave_room_dialog|last_person_warning")} - , + , ); return warnings; @@ -1190,12 +1190,12 @@ export default class MatrixChat extends React.PureComponent { const rule = joinRules.getContent().join_rule; if (rule !== "public") { warnings.push( - + {" " /* Whitespace, otherwise the sentences get smashed together */} {isSpace ? _t("leave_room_dialog|space_rejoin_warning") : _t("leave_room_dialog|room_rejoin_warning")} - , + , ); } } diff --git a/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx b/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx index 3d114abc30..da41011607 100644 --- a/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx +++ b/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx @@ -278,8 +278,8 @@ export default class AccessSecretStorageDialog extends React.PureComponent + const resetLine = ( + {_t("encryption|reset_all_button", undefined, { a: (sub) => ( ), })} - + ); let content; @@ -366,7 +366,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent @@ -434,7 +434,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent diff --git a/src/components/views/settings/SetIdServer.tsx b/src/components/views/settings/SetIdServer.tsx index bdf4ee837e..bd75204e74 100644 --- a/src/components/views/settings/SetIdServer.tsx +++ b/src/components/views/settings/SetIdServer.tsx @@ -137,7 +137,7 @@ export default class SetIdServer extends React.Component { ); } else if (this.state.error) { - return {this.state.error}; + return {this.state.error}; } else { return null; } @@ -226,7 +226,7 @@ export default class SetIdServer extends React.Component { title: _t("terms|identity_server_no_terms_title"), description: (
- {_t("identity_server|no_terms")} + {_t("identity_server|no_terms")}  {_t("terms|identity_server_no_terms_description_2")}
), diff --git a/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx b/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx index 0b34532218..7ec29d4366 100644 --- a/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx @@ -256,7 +256,7 @@ export default class MjolnirUserSettingsTab extends React.Component<{}, IState> - {_t("labs_mjolnir|advanced_warning")} + {_t("labs_mjolnir|advanced_warning")}

{_t("labs_mjolnir|explainer_1", { brand }, { code: (s) => {s} })}

{_t("labs_mjolnir|explainer_2")}

@@ -289,7 +289,7 @@ export default class MjolnirUserSettingsTab extends React.Component<{}, IState> heading={_t("labs_mjolnir|lists_heading")} description={ <> - {_t("labs_mjolnir|lists_description_1")} + {_t("labs_mjolnir|lists_description_1")}   {_t("labs_mjolnir|lists_description_2")} diff --git a/test/components/views/settings/tabs/user/__snapshots__/MjolnirUserSettingsTab-test.tsx.snap b/test/components/views/settings/tabs/user/__snapshots__/MjolnirUserSettingsTab-test.tsx.snap index 25ed78b6e3..e6e2519ab0 100644 --- a/test/components/views/settings/tabs/user/__snapshots__/MjolnirUserSettingsTab-test.tsx.snap +++ b/test/components/views/settings/tabs/user/__snapshots__/MjolnirUserSettingsTab-test.tsx.snap @@ -22,11 +22,11 @@ exports[` renders correctly when user has no ignored u
- ⚠ These settings are meant for advanced users. - +

Add users and servers you want to ignore here. Use asterisks to have Element match any characters. For example, @@ -115,11 +115,11 @@ exports[` renders correctly when user has no ignored u

- Subscribing to a ban list will cause you to join it! - +   If this isn't what you want, please use a different tool to ignore users.