From 79a13ba43a3d17c1ca2b77dc22008ed2bf8cd1b7 Mon Sep 17 00:00:00 2001 From: josefaidt Date: Thu, 6 Feb 2025 09:55:20 -0800 Subject: [PATCH] normalize discord invite links, remove noreferrer from discord invite links --- src/components/ExternalLink/index.tsx | 9 +++++++-- src/components/Footer/Footer.tsx | 1 + src/components/LinkCard/LinkCard.tsx | 8 +++++++- src/components/LinkCards/LinkCards.tsx | 1 + src/components/contribute/HowItWorks.tsx | 2 +- src/fragments/lib-v1/flutter.mdx | 2 +- src/fragments/lib/flutter.mdx | 2 +- src/pages/contribute/getting-started.tsx | 4 ++-- .../tools/cli/project/troubleshooting/index.mdx | 2 +- 9 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/components/ExternalLink/index.tsx b/src/components/ExternalLink/index.tsx index 87be1475abf..8f83fe577fc 100644 --- a/src/components/ExternalLink/index.tsx +++ b/src/components/ExternalLink/index.tsx @@ -8,12 +8,17 @@ type ExternalLinkProps = { anchorTitle?: string; icon?: boolean; className?: string; + /** + * @default 'noopener noreferrer' + */ + rel?: string; }; const ExternalLink: React.FC = ({ children, href, - className + className, + rel }) => { const [label, setLabel] = React.useState(''); const linkRef = useRef(null); @@ -30,7 +35,7 @@ const ExternalLink: React.FC = ({ href={href} className={className} aria-label={label + ' (opens in new tab)'} - rel="noopener noreferrer" + rel={rel || 'noopener noreferrer'} target="_blank" onClick={() => { trackLink(href); diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx index e40f15f2a6e..c5fc7f4dff7 100644 --- a/src/components/Footer/Footer.tsx +++ b/src/components/Footer/Footer.tsx @@ -64,6 +64,7 @@ export const Footer = ({ hasTOC = false }: FooterProps) => { Discord diff --git a/src/components/LinkCard/LinkCard.tsx b/src/components/LinkCard/LinkCard.tsx index b4e4c91d7f0..5660502fb04 100644 --- a/src/components/LinkCard/LinkCard.tsx +++ b/src/components/LinkCard/LinkCard.tsx @@ -6,19 +6,25 @@ interface LinkCardProps { href?: string; children: React.ReactNode; icon: () => React.ReactNode; + /** + * @default "noopener noreferrer" + */ + rel?: string; } const LinkCard: React.FC = ({ isExternal, href, children, - icon + icon, + rel }) => { return ( href && ( diff --git a/src/components/LinkCards/LinkCards.tsx b/src/components/LinkCards/LinkCards.tsx index ae062e76645..d4d8329acf8 100644 --- a/src/components/LinkCards/LinkCards.tsx +++ b/src/components/LinkCards/LinkCards.tsx @@ -28,6 +28,7 @@ const LinkCards: React.FC = ({ platform }) => { } > Amplify Discord diff --git a/src/components/contribute/HowItWorks.tsx b/src/components/contribute/HowItWorks.tsx index ee62fa113f9..79a907a415b 100644 --- a/src/components/contribute/HowItWorks.tsx +++ b/src/components/contribute/HowItWorks.tsx @@ -117,7 +117,7 @@ export default function HowItWorks() { If this is your first approved pull request, the Amplify team designates you as a Contributor in the{' '} - + Amplify Community Discord server . diff --git a/src/fragments/lib-v1/flutter.mdx b/src/fragments/lib-v1/flutter.mdx index f56cc2b68be..d6f5e4c8e71 100644 --- a/src/fragments/lib-v1/flutter.mdx +++ b/src/fragments/lib-v1/flutter.mdx @@ -1,6 +1,6 @@ ## Amplify Flutter -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). +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). Amplify Flutter v0 supports iOS/Android as target platforms. diff --git a/src/fragments/lib/flutter.mdx b/src/fragments/lib/flutter.mdx index 0564e19914e..fd77e81f8d4 100644 --- a/src/fragments/lib/flutter.mdx +++ b/src/fragments/lib/flutter.mdx @@ -1,6 +1,6 @@ ## Amplify Flutter -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). +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). 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. diff --git a/src/pages/contribute/getting-started.tsx b/src/pages/contribute/getting-started.tsx index 615f9f00a89..b02087e25d0 100644 --- a/src/pages/contribute/getting-started.tsx +++ b/src/pages/contribute/getting-started.tsx @@ -251,7 +251,7 @@ export default function GettingStarted() { Learn more about the AWS Amplify JS library. - + Amplify Community Discord server @@ -270,7 +270,7 @@ export default function GettingStarted() { Amplify JS. - + Amplify Discord Office Hours diff --git a/src/pages/gen1/[platform]/tools/cli/project/troubleshooting/index.mdx b/src/pages/gen1/[platform]/tools/cli/project/troubleshooting/index.mdx index 70405821378..cc14df9b33a 100644 --- a/src/pages/gen1/[platform]/tools/cli/project/troubleshooting/index.mdx +++ b/src/pages/gen1/[platform]/tools/cli/project/troubleshooting/index.mdx @@ -325,4 +325,4 @@ Search for similar issues or open new issues on Github Connect with [AWS Enterprise support](https://aws.amazon.com/premiumsupport/) -Join our [community Discord Channel](https://discord.com/invite/amplify) +Join our [community Discord Channel](https://discord.gg/amplify)