Skip to content

Commit 79a13ba

Browse files
committed
normalize discord invite links, remove noreferrer from discord invite links
1 parent dd83f6a commit 79a13ba

File tree

9 files changed

+22
-9
lines changed

9 files changed

+22
-9
lines changed

src/components/ExternalLink/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@ type ExternalLinkProps = {
88
anchorTitle?: string;
99
icon?: boolean;
1010
className?: string;
11+
/**
12+
* @default 'noopener noreferrer'
13+
*/
14+
rel?: string;
1115
};
1216

1317
const ExternalLink: React.FC<ExternalLinkProps> = ({
1418
children,
1519
href,
16-
className
20+
className,
21+
rel
1722
}) => {
1823
const [label, setLabel] = React.useState('');
1924
const linkRef = useRef<HTMLAnchorElement>(null);
@@ -30,7 +35,7 @@ const ExternalLink: React.FC<ExternalLinkProps> = ({
3035
href={href}
3136
className={className}
3237
aria-label={label + ' (opens in new tab)'}
33-
rel="noopener noreferrer"
38+
rel={rel || 'noopener noreferrer'}
3439
target="_blank"
3540
onClick={() => {
3641
trackLink(href);

src/components/Footer/Footer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export const Footer = ({ hasTOC = false }: FooterProps) => {
6464
<ExternalLink
6565
href={links.DISCORD}
6666
className="footer-link footer-link--social"
67+
rel={'noopener'}
6768
>
6869
<IconDiscord />
6970
<VisuallyHidden>Discord</VisuallyHidden>

src/components/LinkCard/LinkCard.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,25 @@ interface LinkCardProps {
66
href?: string;
77
children: React.ReactNode;
88
icon: () => React.ReactNode;
9+
/**
10+
* @default "noopener noreferrer"
11+
*/
12+
rel?: string;
913
}
1014

1115
const LinkCard: React.FC<LinkCardProps> = ({
1216
isExternal,
1317
href,
1418
children,
15-
icon
19+
icon,
20+
rel
1621
}) => {
1722
return (
1823
href && (
1924
<Link
2025
href={href}
2126
isExternal={isExternal}
27+
rel={rel || 'noopener noreferrer'}
2228
className="link-card"
2329
aria-label={children + ' (opens in new tab)'}
2430
>

src/components/LinkCards/LinkCards.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const LinkCards: React.FC<LinkCardsProps> = ({ platform }) => {
2828
<LinkCard
2929
isExternal={true}
3030
href={links.DISCORD}
31+
rel={'noopener'}
3132
icon={() => <IconDiscord fontSize="2rem" />}
3233
>
3334
Amplify Discord

src/components/contribute/HowItWorks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export default function HowItWorks() {
117117
<Text>
118118
If this is your first approved pull request, the Amplify team
119119
designates you as a Contributor in the{' '}
120-
<ExternalLink href="https://discord.com/invite/amplify">
120+
<ExternalLink href="https://discord.gg/amplify" rel="noopener">
121121
Amplify Community Discord server <IconExternalLink />
122122
</ExternalLink>
123123
.

src/fragments/lib-v1/flutter.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Amplify Flutter
22

3-
Welcome to the Amplify Flutter documentation. To stay up to date with the latest changes and provide feedback, please take a look at our [Github repo](https://github.com/aws-amplify/amplify-flutter) or join us on [Discord](https://discord.gg/jWVbPfC).
3+
Welcome to the Amplify Flutter documentation. To stay up to date with the latest changes and provide feedback, please take a look at our [Github repo](https://github.com/aws-amplify/amplify-flutter) or join us on [Discord](https://discord.gg/amplify).
44

55
Amplify Flutter v0 supports iOS/Android as target platforms.
66

src/fragments/lib/flutter.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Amplify Flutter
22

3-
Welcome to the Amplify Flutter documentation. To stay up to date with the latest changes and provide feedback, please take a look at our [GitHub repo](https://github.com/aws-amplify/amplify-flutter) or join us on [Discord](https://discord.gg/jWVbPfC).
3+
Welcome to the Amplify Flutter documentation. To stay up to date with the latest changes and provide feedback, please take a look at our [GitHub repo](https://github.com/aws-amplify/amplify-flutter) or join us on [Discord](https://discord.gg/amplify).
44

55
The stable release of Amplify Flutter currently supports iOS, Android, Web, Windows, macOS, and Linux as target platforms. Currently Push Notifications and DataStore are supported for only iOS and Android.
66

src/pages/contribute/getting-started.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export default function GettingStarted() {
251251
<Text>Learn more about the AWS Amplify JS library.</Text>
252252

253253
<Heading level={4}>
254-
<ExternalLink href="https://discord.com/invite/amplify">
254+
<ExternalLink href="https://discord.gg/amplify">
255255
Amplify Community Discord server <IconExternalLink />
256256
</ExternalLink>
257257
</Heading>
@@ -270,7 +270,7 @@ export default function GettingStarted() {
270270
Amplify JS.
271271
</Text>
272272
<Heading level={4}>
273-
<ExternalLink href="https://discord.com/invite/amplify">
273+
<ExternalLink href="https://discord.gg/amplify">
274274
Amplify Discord Office Hours <IconExternalLink />
275275
</ExternalLink>
276276
</Heading>

src/pages/gen1/[platform]/tools/cli/project/troubleshooting/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,4 +325,4 @@ Search for similar issues or open new issues on Github
325325

326326
Connect with [AWS Enterprise support](https://aws.amazon.com/premiumsupport/)
327327

328-
Join our [community Discord Channel](https://discord.com/invite/amplify)
328+
Join our [community Discord Channel](https://discord.gg/amplify)

0 commit comments

Comments
 (0)