use ExternalLink components for external links (#10758)

* use ExternalLink components for external links

* test

* strict
This commit is contained in:
Kerry 2023-05-04 09:26:26 +12:00 committed by GitHub
parent 42e6c9839c
commit 37b7dfe943
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 281 additions and 47 deletions

View file

@ -30,6 +30,7 @@ import AccessibleButton from "../views/elements/AccessibleButton";
import InlineSpinner from "../views/elements/InlineSpinner";
import MatrixClientContext from "../../contexts/MatrixClientContext";
import { RoomStatusBarUnsentMessages } from "./RoomStatusBarUnsentMessages";
import ExternalLink from "../views/elements/ExternalLink";
const STATUS_BAR_HIDDEN = 0;
const STATUS_BAR_EXPANDED = 1;
@ -213,9 +214,9 @@ export default class RoomStatusBar extends React.PureComponent<IProps, IState> {
{},
{
consentLink: (sub) => (
<a href={consentError!.data?.consent_uri} target="_blank" rel="noreferrer noopener">
<ExternalLink href={consentError!.data?.consent_uri} target="_blank" rel="noreferrer noopener">
{sub}
</a>
</ExternalLink>
),
},
);

View file

@ -77,6 +77,7 @@ import MainSplit from "./MainSplit";
import RightPanel from "./RightPanel";
import SpaceHierarchy, { showRoom } from "./SpaceHierarchy";
import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks";
import ExternalLink from "../views/elements/ExternalLink";
interface IProps {
space: Room;
@ -593,9 +594,9 @@ const SpaceSetupPrivateInvite: React.FC<{
{
b: (sub) => <b>{sub}</b>,
link: () => (
<a href="https://app.element.io/" rel="noreferrer noopener" target="_blank">
<ExternalLink href="https://app.element.io/" rel="noreferrer noopener" target="_blank">
app.element.io
</a>
</ExternalLink>
),
},
)}