mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 01:23:52 +00:00
tree-wide: use noopener instead of noreferrer for target="_blank"
This will allow us to see when users click links to the pybricks.com website from the app.
This commit is contained in:
committed by
David Lechner
parent
7277ddb1bd
commit
dd322b5aac
@@ -27,6 +27,7 @@ module.exports = {
|
||||
'sort-imports': ['error', { ignoreDeclarationSort: true }],
|
||||
'import/order': ['error', { alphabetize: { order: 'asc' } }],
|
||||
'react-hooks/exhaustive-deps': 'error',
|
||||
'react/jsx-no-target-blank': ['error', { allowReferrer: true }],
|
||||
},
|
||||
settings: {
|
||||
react: { version: 'detect' },
|
||||
|
||||
@@ -67,6 +67,7 @@ const UnexpectedErrorAlert: React.VoidFunctionComponent<UnexpectedErrorAlertProp
|
||||
'is:issue',
|
||||
)}+${encodeURIComponent(error.message)}`}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
>
|
||||
{i18n.translate('reportBug')}
|
||||
</AnchorButton>
|
||||
|
||||
@@ -28,6 +28,7 @@ const NoHub: React.VoidFunctionComponent<NoHubProps> = ({ onFlashFirmware }) =>
|
||||
icon="help"
|
||||
href={pybricksBluetoothTroubleshootingUrl}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
>
|
||||
{i18n.translate('noHub.troubleshootButton')}
|
||||
<ExternalLinkIcon />
|
||||
|
||||
@@ -38,6 +38,7 @@ const NoDfuHub: React.VoidFunctionComponent<NoDfuHubProps> = ({
|
||||
icon="help"
|
||||
href={pybricksUsbLinuxUdevRulesUrl}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
>
|
||||
{i18n.translate('noDfuHub.configureUdevRulesButton')}
|
||||
<ExternalLinkIcon />
|
||||
@@ -47,6 +48,7 @@ const NoDfuHub: React.VoidFunctionComponent<NoDfuHubProps> = ({
|
||||
icon="help"
|
||||
href={pybricksUsbDfuTroubleshootingUrl}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
>
|
||||
{i18n.translate('noDfuHub.troubleshootButton')}
|
||||
<ExternalLinkIcon />
|
||||
|
||||
@@ -348,7 +348,7 @@ const BootloaderInstructions: React.VoidFunctionComponent<
|
||||
<a
|
||||
href={pybricksUsbLinuxUdevRulesUrl}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
rel="noopener"
|
||||
>
|
||||
{i18n.translate('warning.linux.learnMore')}
|
||||
</a>
|
||||
|
||||
@@ -75,11 +75,12 @@ function mapIcon(level: Level): IconName | undefined {
|
||||
* Converts a URL to an action that can be passed to `ToasterInstance.show()`.
|
||||
* @param helpUrl A URL.
|
||||
*/
|
||||
function helpAction(helpUrl: string): ActionProps & LinkProps {
|
||||
function helpAction(helpUrl: string): ActionProps & LinkProps & { rel: string } {
|
||||
return {
|
||||
icon: 'help',
|
||||
href: helpUrl,
|
||||
target: '_blank',
|
||||
rel: 'noopener',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ const SponsorDialog: React.VoidFunctionComponent = () => {
|
||||
<a
|
||||
href={pybricksTeamUrl}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
rel="noopener"
|
||||
>
|
||||
{i18n.translate('whoAreWe.team.team')}
|
||||
</a>
|
||||
@@ -74,7 +74,7 @@ const SponsorDialog: React.VoidFunctionComponent = () => {
|
||||
fill={true}
|
||||
href="https://github.com/sponsors/pybricks"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
rel="noopener"
|
||||
>
|
||||
GitHub Sponsors
|
||||
<ExternalLinkIcon />
|
||||
@@ -86,7 +86,7 @@ const SponsorDialog: React.VoidFunctionComponent = () => {
|
||||
fill={true}
|
||||
href="https://www.patreon.com/pybricks"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
rel="noopener"
|
||||
>
|
||||
Patreon
|
||||
<ExternalLinkIcon />
|
||||
@@ -98,7 +98,7 @@ const SponsorDialog: React.VoidFunctionComponent = () => {
|
||||
fill={true}
|
||||
href="https://paypal.me/pybricks"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
rel="noopener"
|
||||
>
|
||||
Paypal
|
||||
<ExternalLinkIcon />
|
||||
|
||||
Reference in New Issue
Block a user