{ this.renderSettingValue(SettingsStore.getValue(i)) }
diff --git a/src/components/views/dialogs/InviteDialog.tsx b/src/components/views/dialogs/InviteDialog.tsx
index 13e48db702..f352393c5b 100644
--- a/src/components/views/dialogs/InviteDialog.tsx
+++ b/src/components/views/dialogs/InviteDialog.tsx
@@ -1255,8 +1255,14 @@ export default class InviteDialog extends React.PureComponent{ sub },
- settings: sub => { sub },
+ default: sub =>
+
+ { sub }
+ ,
+ settings: sub =>
+
+ { sub }
+ ,
},
) }
);
@@ -1266,7 +1272,10 @@ export default class InviteDialog extends React.PureComponentSettings.",
{}, {
- settings: sub => { sub },
+ settings: sub =>
+
+ { sub }
+ ,
},
) }
);
diff --git a/src/components/views/dialogs/RoomUpgradeWarningDialog.tsx b/src/components/views/dialogs/RoomUpgradeWarningDialog.tsx
index 35d27afe25..0da8fb97d3 100644
--- a/src/components/views/dialogs/RoomUpgradeWarningDialog.tsx
+++ b/src/components/views/dialogs/RoomUpgradeWarningDialog.tsx
@@ -29,6 +29,7 @@ import BugReportDialog from './BugReportDialog';
import BaseDialog from "./BaseDialog";
import DialogButtons from "../elements/DialogButtons";
import ProgressBar from "../elements/ProgressBar";
+import AccessibleButton from '../elements/AccessibleButton';
export interface IFinishedOpts {
continue: boolean;
@@ -135,7 +136,9 @@ export default class RoomUpgradeWarningDialog extends React.Component {
- return { sub };
+ return
+ { sub }
+ ;
},
},
) }
diff --git a/src/components/views/dialogs/StorageEvictedDialog.tsx b/src/components/views/dialogs/StorageEvictedDialog.tsx
index 8a41224d57..acbb62b43d 100644
--- a/src/components/views/dialogs/StorageEvictedDialog.tsx
+++ b/src/components/views/dialogs/StorageEvictedDialog.tsx
@@ -24,6 +24,7 @@ import BaseDialog from "./BaseDialog";
import DialogButtons from "../elements/DialogButtons";
import BugReportDialog from "./BugReportDialog";
import { IDialogProps } from "./IDialogProps";
+import AccessibleButton from '../elements/AccessibleButton';
interface IProps extends IDialogProps { }
@@ -45,7 +46,9 @@ export default class StorageEvictedDialog extends React.Component {
"To help us prevent this in future, please send us logs.",
{},
{
- a: text => { text },
+ a: text =>
+ { text }
+ ,
},
);
}
diff --git a/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx b/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx
index a9fea93fd0..cecd53ac0c 100644
--- a/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx
+++ b/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx
@@ -287,10 +287,10 @@ export default class AccessSecretStorageDialog extends React.PureComponent
{ _t("Forgotten or lost all recovery methods? Reset all", null, {
- a: (sub) => { sub },
+ className="mx_AccessSecretStorageDialog_reset_link">{ sub },
}) }
);
diff --git a/src/components/views/elements/AccessibleButton.tsx b/src/components/views/elements/AccessibleButton.tsx
index ae11098e73..a93bb5ab83 100644
--- a/src/components/views/elements/AccessibleButton.tsx
+++ b/src/components/views/elements/AccessibleButton.tsx
@@ -21,6 +21,19 @@ import { Key } from '../../../Keyboard';
export type ButtonEvent = React.MouseEvent | React.KeyboardEvent | React.FormEvent;
+type AccessibleButtonKind = | 'primary'
+ | 'primary_outline'
+ | 'primary_sm'
+ | 'secondary'
+ | 'danger'
+ | 'danger_outline'
+ | 'danger_sm'
+ | 'link'
+ | 'link_inline'
+ | 'link_sm'
+ | 'confirm_sm'
+ | 'cancel_sm';
+
/**
* children: React's magic prop. Represents all children given to the element.
* element: (optional) The base element type. "div" by default.
@@ -32,7 +45,7 @@ interface IProps extends React.InputHTMLAttributes {
element?: keyof ReactHTML;
// The kind of button, similar to how Bootstrap works.
// See available classes for AccessibleButton for options.
- kind?: string;
+ kind?: AccessibleButtonKind | string;
// The ARIA role
role?: string;
// The tabIndex
diff --git a/src/components/views/elements/DesktopBuildsNotice.tsx b/src/components/views/elements/DesktopBuildsNotice.tsx
index e06db603ec..8c600a152f 100644
--- a/src/components/views/elements/DesktopBuildsNotice.tsx
+++ b/src/components/views/elements/DesktopBuildsNotice.tsx
@@ -23,6 +23,7 @@ import SdkConfig from "../../../SdkConfig";
import dis from "../../../dispatcher/dispatcher";
import { Action } from "../../../dispatcher/actions";
import { UserTab } from "../dialogs/UserSettingsDialog";
+import AccessibleButton from "./AccessibleButton";
export enum WarningKind {
Files,
@@ -41,15 +42,19 @@ export default function DesktopBuildsNotice({ isRoomEncrypted, kind }: IProps) {
if (EventIndexPeg.error) {
return <>
{ _t("Message search initialisation failed, check your settings for more information", {}, {
- a: sub => ( {
- evt.preventDefault();
- dis.dispatch({
- action: Action.ViewUserSettings,
- initialTabId: UserTab.Security,
- });
- }}>
- { sub }
- ),
+ a: sub => (
+ {
+ evt.preventDefault();
+ dis.dispatch({
+ action: Action.ViewUserSettings,
+ initialTabId: UserTab.Security,
+ });
+ }}
+ >
+ { sub }
+ ),
}) }
>;
}
diff --git a/src/components/views/elements/MemberEventListSummary.tsx b/src/components/views/elements/MemberEventListSummary.tsx
index 53a604fe9d..9b364856c1 100644
--- a/src/components/views/elements/MemberEventListSummary.tsx
+++ b/src/components/views/elements/MemberEventListSummary.tsx
@@ -30,6 +30,7 @@ import { RightPanelPhases } from '../../../stores/right-panel/RightPanelStorePha
import { jsxJoin } from '../../../utils/ReactUtils';
import { Layout } from '../../../settings/enums/Layout';
import RightPanelStore from '../../../stores/right-panel/RightPanelStore';
+import AccessibleButton from './AccessibleButton';
const onPinnedMessagesClick = (): void => {
RightPanelStore.instance.setCard({ phase: RightPanelPhases.PinnedMessages }, false);
@@ -322,10 +323,18 @@ export default class MemberEventListSummary extends React.Component {
res = (userCount > 1)
? _t("%(severalUsers)schanged the pinned messages for the room %(count)s times.",
{ severalUsers: "", count: repeats },
- { "a": (sub) => { sub } })
+ {
+ "a": (sub) =>
+ { sub }
+ ,
+ })
: _t("%(oneUser)schanged the pinned messages for the room %(count)s times.",
{ oneUser: "", count: repeats },
- { "a": (sub) => { sub } });
+ {
+ "a": (sub) =>
+ { sub }
+ ,
+ });
break;
}
diff --git a/src/components/views/elements/ReplyChain.tsx b/src/components/views/elements/ReplyChain.tsx
index 657fc189c1..00221f4585 100644
--- a/src/components/views/elements/ReplyChain.tsx
+++ b/src/components/views/elements/ReplyChain.tsx
@@ -37,6 +37,7 @@ import { replaceableComponent } from "../../../utils/replaceableComponent";
import Spinner from './Spinner';
import ReplyTile from "../rooms/ReplyTile";
import Pill from './Pill';
+import { ButtonEvent } from './AccessibleButton';
/**
* This number is based on the previous behavior - if we have message of height
@@ -344,7 +345,7 @@ export default class ReplyChain extends React.Component {
this.initialize();
};
- private onQuoteClick = async (event: React.MouseEvent): Promise => {
+ private onQuoteClick = async (event: ButtonEvent): Promise => {
const events = [this.state.loadedEv, ...this.state.events];
let loadedEv = null;
@@ -380,7 +381,11 @@ export default class ReplyChain extends React.Component {
header =
{
_t('In reply to', {}, {
- 'a': (sub) => { sub },
+ 'a': (sub) => (
+
+ ),
'pill': (
{
* We'll use it to learn how the download link
* would have been styled if it was rendered inline.
*/ }
- { /* eslint-disable-next-line jsx-a11y/anchor-has-content */ }
+ { /* this violates multiple eslint rules
+ so ignore it completely */ }
+ { /* eslint-disable-next-line */ }
{ /*
diff --git a/src/components/views/messages/MjolnirBody.tsx b/src/components/views/messages/MjolnirBody.tsx
index 00cbcf461f..14956554f1 100644
--- a/src/components/views/messages/MjolnirBody.tsx
+++ b/src/components/views/messages/MjolnirBody.tsx
@@ -19,6 +19,7 @@ import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { _t } from '../../../languageHandler';
import { replaceableComponent } from "../../../utils/replaceableComponent";
+import AccessibleButton from '../elements/AccessibleButton';
interface IProps {
mxEvent: MatrixEvent;
@@ -40,7 +41,11 @@ export default class MjolnirBody extends React.Component {
return (
{ _t(
"You have ignored this user, so their message is hidden. Show anyways.",
- {}, { a: (sub) => { sub } },
+ {}, {
+ a: (sub) =>
+ { sub }
+ ,
+ },
) }
);
}
diff --git a/src/components/views/messages/ReactionsRow.tsx b/src/components/views/messages/ReactionsRow.tsx
index d2718c20b1..3058770c47 100644
--- a/src/components/views/messages/ReactionsRow.tsx
+++ b/src/components/views/messages/ReactionsRow.tsx
@@ -27,6 +27,7 @@ import ContextMenu, { aboveLeftOf, useContextMenu } from "../../structures/Conte
import ReactionPicker from "../emojipicker/ReactionPicker";
import ReactionsRowButton from "./ReactionsRowButton";
import RoomContext from "../../../contexts/RoomContext";
+import AccessibleButton from "../elements/AccessibleButton";
// The maximum number of reactions to initially show on a message.
const MAX_ITEMS_WHEN_LIMITED = 8;
@@ -201,13 +202,13 @@ export default class ReactionsRow extends React.PureComponent {
let showAllButton;
if ((items.length > MAX_ITEMS_WHEN_LIMITED + 1) && !showAll) {
items = items.slice(0, MAX_ITEMS_WHEN_LIMITED);
- showAllButton =
{ _t("Show all") }
- ;
+ ;
}
let addReactionButton;
diff --git a/src/components/views/messages/TextualBody.tsx b/src/components/views/messages/TextualBody.tsx
index 66a5cc8b54..30b7edf7cf 100644
--- a/src/components/views/messages/TextualBody.tsx
+++ b/src/components/views/messages/TextualBody.tsx
@@ -45,6 +45,7 @@ import EditMessageComposer from '../rooms/EditMessageComposer';
import LinkPreviewGroup from '../rooms/LinkPreviewGroup';
import { IBodyProps } from "./IBodyProps";
import RoomContext from "../../../contexts/RoomContext";
+import AccessibleButton from '../elements/AccessibleButton';
const MAX_HIGHLIGHT_LENGTH = 4096;
@@ -529,9 +530,9 @@ export default class TextualBody extends React.Component {
if (this.props.highlightLink) {
body = { body };
} else if (content.data && typeof content.data["org.matrix.neb.starter_link"] === "string") {
- body = { body };
+ >{ body };
}
let widgets;
diff --git a/src/components/views/messages/TileErrorBoundary.tsx b/src/components/views/messages/TileErrorBoundary.tsx
index a15806ae0c..ac84562cf9 100644
--- a/src/components/views/messages/TileErrorBoundary.tsx
+++ b/src/components/views/messages/TileErrorBoundary.tsx
@@ -23,6 +23,7 @@ import Modal from '../../../Modal';
import SdkConfig from "../../../SdkConfig";
import { replaceableComponent } from "../../../utils/replaceableComponent";
import BugReportDialog from '../dialogs/BugReportDialog';
+import AccessibleButton from '../elements/AccessibleButton';
interface IProps {
mxEvent: MatrixEvent;
@@ -67,9 +68,9 @@ export default class TileErrorBoundary extends React.Component {
let submitLogsButton;
if (SdkConfig.get().bug_report_endpoint_url) {
- submitLogsButton =
+ submitLogsButton =
{ _t("Submit logs") }
- ;
+ ;
}
return (
diff --git a/src/components/views/messages/ViewSourceEvent.tsx b/src/components/views/messages/ViewSourceEvent.tsx
index 3e6d47dc13..6385f05e51 100644
--- a/src/components/views/messages/ViewSourceEvent.tsx
+++ b/src/components/views/messages/ViewSourceEvent.tsx
@@ -21,6 +21,7 @@ import classNames from 'classnames';
import { replaceableComponent } from "../../../utils/replaceableComponent";
import { MatrixClientPeg } from "../../../MatrixClientPeg";
import { _t } from '../../../languageHandler';
+import AccessibleButton from '../elements/AccessibleButton';
interface IProps {
mxEvent: MatrixEvent;
@@ -76,7 +77,8 @@ export default class ViewSourceEvent extends React.PureComponent
return
{ content }
-
,
@@ -163,11 +165,9 @@ export default class SecurityRoomSettingsTab extends React.ComponentLearn more about encryption.",
{},
{
- a: sub => { sub },
+ >{ sub },
},
),
onFinished: (confirm) => {
@@ -306,12 +306,12 @@ export default class SecurityRoomSettingsTab extends React.Component {
dialog.close();
this.createNewRoom(true, false);
- }}> { sub } ,
+ }}> { sub } ,
},
) }
,
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 69051ff7c7..cb63540a4b 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -2476,6 +2476,7 @@
"Setting ID": "Setting ID",
"Value": "Value",
"Value in this room": "Value in this room",
+ "Edit setting": "Edit setting",
"Setting:": "Setting:",
"Caution:": "Caution:",
"This UI does NOT check the types of the values. Use at your own risk.": "This UI does NOT check the types of the values. Use at your own risk.",
diff --git a/test/components/views/settings/SettingsFieldset-test.tsx b/test/components/views/settings/SettingsFieldset-test.tsx
index f056c02681..28a784f25b 100644
--- a/test/components/views/settings/SettingsFieldset-test.tsx
+++ b/test/components/views/settings/SettingsFieldset-test.tsx
@@ -40,7 +40,7 @@ describe('', () => {
});
it('renders fieldset with react description', () => {
- const description = <>