Skip to content

Fix external URL navigation and remove stale commented-out code in Hero.js#224

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-button-component-link
Draft

Fix external URL navigation and remove stale commented-out code in Hero.js#224
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-button-component-link

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

The Gateway Clients Guide button was using React Router's Link component with an external URL — Link is internal-navigation only and misusing it causes incorrect routing behavior. A commented-out fontSize style was also left behind in a Typography sx prop.

Changes

  • src/Components/Hero.js — Replace component={Link} + to= with a native anchor via component="a" + href=, adding target="_blank" and rel="noopener noreferrer" for safe external linking:
- component={Link}
- to="https://docs.smswithoutborders.com/docs/Gateway%20Clients%20Guide/GatewayClientsGuide"
+ component="a"
+ href="https://docs.smswithoutborders.com/docs/Gateway%20Clients%20Guide/GatewayClientsGuide"
+ target="_blank"
+ rel="noopener noreferrer"
  • src/Components/Hero.js — Remove dead commented-out fontSize line from Typography sx prop.
Original prompt
Please apply the following diffs and create a pull request.
Once the PR is ready, give it a title based on the messages of the fixes being applied.

[{"message":"The Button component uses `component={Link}` from react-router-dom but the `to` prop points to an external URL. React Router's Link component is for internal navigation only. Use a regular anchor tag or change the component to 'a' and use 'href' instead of 'to'.","fixFiles":[{"filePath":"src/Components/Hero.js","diff":"diff --git a/src/Components/Hero.js b/src/Components/Hero.js\n--- a/src/Components/Hero.js\n+++ b/src/Components/Hero.js\n@@ -143,8 +143,10 @@\n \t\t\t\t\t\t</Button>\n \n \t\t\t\t\t\t<Button\n-\t\t\t\t\t\tcomponent={Link}\n-\t\t\t\t\t\tto=\"https://docs.smswithoutborders.com/docs/Gateway%20Clients%20Guide/GatewayClientsGuide\"\n+\t\t\t\t\t\tcomponent=\"a\"\n+\t\t\t\t\t\thref=\"https://docs.smswithoutborders.com/docs/Gateway%20Clients%20Guide/GatewayClientsGuide\"\n+\t\t\t\t\t\ttarget=\"_blank\"\n+\t\t\t\t\t\trel=\"noopener noreferrer\"\n \t\t\t\t\t\tvariant=\"outlined\"\n \t\t\t\t\t\tsize=\"large\"\n \t\t\t\t\t\tsx={{\n"}]},{"message":"Commented-out code should be removed rather than left in the codebase. If this styling might be needed later, consider using version control to track it.","fixFiles":[{"filePath":"src/Components/Hero.js","diff":"diff --git a/src/Components/Hero.js b/src/Components/Hero.js\n--- a/src/Components/Hero.js\n+++ b/src/Components/Hero.js\n@@ -178,7 +178,6 @@\n \t\t\t\t\t\t\t<Typography\n \t\t\t\t\t\t\t\tvariant=\"body1\"\n \t\t\t\t\t\t\t\tsx={{\n-\t\t\t\t\t\t\t\t\t// fontSize: { xs: \"15px\", md: \"20px\" },\n \t\t\t\t\t\t\t\t\tfontFamily: \"Ubuntu\",\n \t\t\t\t\t\t\t\t\tlineHeight: 1.6,\n \t\t\t\t\t\t\t\t\ttextAlign: { xs: \"center\", md: \"left\" }\n"}]}]

Copilot AI changed the title [WIP] Fix Button component to use anchor tag for external URL Fix external URL navigation and remove stale commented-out code in Hero.js Apr 30, 2026
Copilot AI requested a review from PromiseFru April 30, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants