use ExternalLink components for external links (#10758)
* use ExternalLink components for external links * test * strict
This commit is contained in:
parent
42e6c9839c
commit
37b7dfe943
13 changed files with 281 additions and 47 deletions
|
@ -22,6 +22,7 @@ import DialogButtons from "../elements/DialogButtons";
|
|||
import Modal, { ComponentProps } from "../../../Modal";
|
||||
import SdkConfig from "../../../SdkConfig";
|
||||
import { getPolicyUrl } from "../../../toasts/AnalyticsToast";
|
||||
import ExternalLink from "../elements/ExternalLink";
|
||||
|
||||
export enum ButtonClicked {
|
||||
Primary,
|
||||
|
@ -55,10 +56,10 @@ export const AnalyticsLearnMoreDialog: React.FC<IProps> = ({
|
|||
{
|
||||
PrivacyPolicyUrl: (sub) => {
|
||||
return (
|
||||
<a href={privacyPolicyUrl} rel="norefferer noopener" target="_blank">
|
||||
<ExternalLink href={privacyPolicyUrl} rel="norefferer noopener" target="_blank">
|
||||
{sub}
|
||||
<span className="mx_AnalyticsPolicyLink" />
|
||||
</a>
|
||||
</ExternalLink>
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -27,6 +27,7 @@ import InfoDialog from "./InfoDialog";
|
|||
import { submitFeedback } from "../../../rageshake/submit-rageshake";
|
||||
import { useStateToggle } from "../../../hooks/useStateToggle";
|
||||
import StyledCheckbox from "../elements/StyledCheckbox";
|
||||
import ExternalLink from "../elements/ExternalLink";
|
||||
|
||||
interface IProps {
|
||||
feature?: string;
|
||||
|
@ -130,16 +131,20 @@ const FeedbackDialog: React.FC<IProps> = (props: IProps) => {
|
|||
{
|
||||
existingIssuesLink: (sub) => {
|
||||
return (
|
||||
<a target="_blank" rel="noreferrer noopener" href={existingIssuesUrl}>
|
||||
<ExternalLink
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
href={existingIssuesUrl}
|
||||
>
|
||||
{sub}
|
||||
</a>
|
||||
</ExternalLink>
|
||||
);
|
||||
},
|
||||
newIssueLink: (sub) => {
|
||||
return (
|
||||
<a target="_blank" rel="noreferrer noopener" href={newIssueUrl}>
|
||||
<ExternalLink target="_blank" rel="noreferrer noopener" href={newIssueUrl}>
|
||||
{sub}
|
||||
</a>
|
||||
</ExternalLink>
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -28,6 +28,7 @@ import StyledRadioButton from "../elements/StyledRadioButton";
|
|||
import TextWithTooltip from "../elements/TextWithTooltip";
|
||||
import withValidation, { IFieldState, IValidationResult } from "../elements/Validation";
|
||||
import { ValidatedServerConfig } from "../../../utils/ValidatedServerConfig";
|
||||
import ExternalLink from "../elements/ExternalLink";
|
||||
|
||||
interface IProps {
|
||||
title?: string;
|
||||
|
@ -236,9 +237,13 @@ export default class ServerPickerDialog extends React.PureComponent<IProps, ISta
|
|||
</AccessibleButton>
|
||||
|
||||
<h2>{_t("Learn more")}</h2>
|
||||
<a href="https://matrix.org/faq/#what-is-a-homeserver%3F" target="_blank" rel="noreferrer noopener">
|
||||
<ExternalLink
|
||||
href="https://matrix.org/faq/#what-is-a-homeserver%3F"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
{_t("About homeservers")}
|
||||
</a>
|
||||
</ExternalLink>
|
||||
</form>
|
||||
</BaseDialog>
|
||||
);
|
||||
|
|
|
@ -22,6 +22,7 @@ import { _t, pickBestLanguage } from "../../../languageHandler";
|
|||
import DialogButtons from "../elements/DialogButtons";
|
||||
import BaseDialog from "./BaseDialog";
|
||||
import { ServicePolicyPair } from "../../../Terms";
|
||||
import ExternalLink from "../elements/ExternalLink";
|
||||
|
||||
interface ITermsCheckboxProps {
|
||||
onChange: (url: string, checked: boolean) => void;
|
||||
|
@ -148,9 +149,9 @@ export default class TermsDialog extends React.PureComponent<ITermsDialogProps,
|
|||
<td className="mx_TermsDialog_summary">{summary}</td>
|
||||
<td>
|
||||
{termDoc[termsLang].name}
|
||||
<a rel="noreferrer noopener" target="_blank" href={termDoc[termsLang].url}>
|
||||
<ExternalLink rel="noreferrer noopener" target="_blank" href={termDoc[termsLang].url}>
|
||||
<span className="mx_TermsDialog_link" />
|
||||
</a>
|
||||
</ExternalLink>
|
||||
</td>
|
||||
<td>
|
||||
<TermsCheckbox
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue