Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use href instead of deprecated to prop in InlineLink usage #12278

Merged
merged 5 commits into from
Mar 7, 2024

Conversation

enjoyooor
Copy link
Contributor

@enjoyooor enjoyooor commented Feb 23, 2024

Dupe of #12218 (accidentally closed), prefer to contribute using my personal account

Noticed that the to prop in InlineLink component is deprecated, so updating all usages to reflect this.

Summary by CodeRabbit

  • New Features

    • Enhanced navigation experience by updating internal link handling to standard web link behavior across various components and pages.
  • Bug Fixes

    • Corrected link destinations by switching from custom to props to standard href attributes, ensuring proper redirection and improving user navigation on the site.
  • Refactor

    • Streamlined linking mechanism throughout the application for consistency and improved maintainability.
  • Chores

    • Removed unnecessary imports and updated the codebase to align with best practices for link handling.

Copy link

netlify bot commented Feb 23, 2024

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit f5382c8
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/65e9d80d0c177d000832ffd1
😎 Deploy Preview https://deploy-preview-12278--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@enjoyooor
Copy link
Contributor Author

cc @nhsz would love your 👀

Copy link
Contributor

@minimalsm minimalsm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @enjoyooor!

Just waiting on second review as it touches a lot.

@minimalsm
Copy link
Contributor

@all-contributors please add @enjoyooor for code

Copy link
Contributor

@minimalsm

I've put up a pull request to add @enjoyooor! 🎉

Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the refactor @enjoyooor. Everything looks good but there is one import condition that I don't think is necessary and shouldn't be included in the scope of this PR. LMK what do you think.

Comment on lines +110 to +113
import {
default as uniswap,
default as uniswapec,
} from "@/public/dapps/uni.png"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we doing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is auto formatting according to eslint/prettier

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pettinarip that is indeed an auto-fix from eslint, as it is the same image file imported twice. I guess eslint is unaware that it's an image file, so it consolidated the alias naming.

I'll look at throwing up a quick PR to address this duplication.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! didn't notice that, good call, thanks. Ok, so I guess we are ok then here 👍🏼

Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @enjoyooor! 💯

Copy link
Contributor

coderabbitai bot commented Mar 7, 2024

Walkthrough

The overall change across various components and pages involves updating the to prop to href in InlineLink components. This modification ensures correct link behavior, aligning with standard HTML practices for navigation. Additionally, there are minor updates like removing unnecessary imports and utilizing ES6 destructuring for image imports. These changes collectively enhance link accessibility, navigation, and code cleanliness across the application.

Changes

File Path Change Summary
src/components/.../index.tsx, .../FileContributors.tsx, .../History/..., .../Layer2/..., .../Layer2ProductCard.tsx, .../MeetupList.tsx, .../RandomAppList.tsx, .../RollupProductDevDoc.tsx, .../StablecoinAccordion/index.tsx, .../Staking/..., .../StatsBoxGrid/..., .../TutorialMetadata.tsx, .../UpcomingEventsList.tsx, .../UpgradeBannerNotification.tsx Updated to prop to href in InlineLink components, improving link behavior. Removed unnecessary ReactNode import.
src/pages/... Changed to attributes to href in InlineLink components across various pages, enhancing navigation and link accessibility. Utilized ES6 destructuring for image imports in dapps.tsx.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between cff7a87 and f5382c8.
Files selected for processing (28)
  • src/components/CommunityEvents/index.tsx (1 hunks)
  • src/components/FileContributors.tsx (2 hunks)
  • src/components/History/NetworkUpgradeSummary.tsx (2 hunks)
  • src/components/Layer2/Layer2Onboard.tsx (2 hunks)
  • src/components/Layer2ProductCard.tsx (1 hunks)
  • src/components/MeetupList.tsx (1 hunks)
  • src/components/RandomAppList.tsx (2 hunks)
  • src/components/RollupProductDevDoc.tsx (2 hunks)
  • src/components/StablecoinAccordion/index.tsx (4 hunks)
  • src/components/Staking/StakingStatsBox.tsx (3 hunks)
  • src/components/StatsBoxGrid/GridItem.tsx (1 hunks)
  • src/components/TutorialMetadata.tsx (1 hunks)
  • src/components/UpcomingEventsList.tsx (1 hunks)
  • src/components/UpgradeBannerNotification.tsx (2 hunks)
  • src/pages/assets.tsx (1 hunks)
  • src/pages/contributing/translation-program/acknowledgements.tsx (2 hunks)
  • src/pages/contributing/translation-program/contributors.tsx (2 hunks)
  • src/pages/dapps.tsx (2 hunks)
  • src/pages/developers/index.tsx (5 hunks)
  • src/pages/developers/tutorials.tsx (1 hunks)
  • src/pages/eth.tsx (3 hunks)
  • src/pages/gas.tsx (1 hunks)
  • src/pages/languages.tsx (3 hunks)
  • src/pages/layer-2.tsx (7 hunks)
  • src/pages/run-a-node.tsx (6 hunks)
  • src/pages/stablecoins.tsx (5 hunks)
  • src/pages/staking/deposit-contract.tsx (2 hunks)
  • src/pages/what-is-ethereum.tsx (3 hunks)
Files not reviewed due to errors (1)
  • (no review received)
Additional comments: 80
src/components/UpgradeBannerNotification.tsx (1)
  • 15-15: The update from to to href in the InlineLink component aligns with the PR's objectives and modern HTML semantics. Good job on keeping the code clean and up-to-date.
src/components/RandomAppList.tsx (1)
  • 65-65: The update from to to href in the InlineLink component is correctly implemented. This change ensures the component's usage aligns with modern web standards.
src/components/RollupProductDevDoc.tsx (3)
  • 40-40: The prop update from to to href for the website link in the InlineLink component is correctly implemented, aligning with the PR's objectives.
  • 45-45: The prop update from to to href for the developerDocs link in the InlineLink component is correctly implemented, ensuring the component's usage aligns with modern web standards.
  • 50-50: The prop update from to to href for the l2beat link in the InlineLink component is correctly implemented. This change enhances the component's compatibility with current web practices.
src/components/Layer2ProductCard.tsx (3)
  • 86-86: The prop update from to to href for the bridge link in the InlineLink component is correctly implemented, aligning with the PR's objectives.
  • 91-91: The prop update from to to href for the ecosystemPortal link in the InlineLink component is correctly implemented, ensuring the component's usage aligns with modern web standards.
  • 96-96: The prop update from to to href for the tokenLists link in the InlineLink component is correctly implemented. This change enhances the component's compatibility with current web practices.
src/components/History/NetworkUpgradeSummary.tsx (2)
  • 54-54: The prop update from to to href for various links in the InlineLink component is correctly implemented, aligning with the PR's objectives and enhancing the component's compatibility with current web practices.
  • 100-100: The prop update from to to href for the waybackLink in the InlineLink component is correctly implemented. This change ensures the component's usage aligns with modern web standards.
src/components/Staking/StakingStatsBox.tsx (3)
  • 99-99: The prop update from to to href for the Beaconcha.in link in the InlineLink component is correctly implemented, aligning with the PR's objectives and enhancing the component's compatibility with current web practices.
  • 110-110: The prop update from to to href for another Beaconcha.in link in the InlineLink component is correctly implemented. This change ensures the component's usage aligns with modern web standards.
  • 121-121: The prop update from to to href for the Beaconcha.in/ethstore link in the InlineLink component is correctly implemented. This change enhances the component's compatibility with current web practices.
src/components/TutorialMetadata.tsx (1)
  • 84-84: The prop update from to to href for the source link in the InlineLink component is correctly implemented, aligning with the PR's objectives and enhancing the component's compatibility with current web practices.
src/components/UpcomingEventsList.tsx (1)
  • 89-89: The prop update from to to href for the link to the community events JSON file in the InlineLink component is correctly implemented, aligning with the PR's objectives and enhancing the component's compatibility with current web practices.
src/components/StatsBoxGrid/GridItem.tsx (1)
  • 19-19: The prop update from to to href for the link to the metric's API provider in the InlineLink component is correctly implemented, aligning with the PR's objectives and enhancing the component's compatibility with current web practices.
src/components/FileContributors.tsx (2)
  • 63-63: The update from to to href for the InlineLink component aligns with the PR's objective to adhere to the updated component API. This change ensures that the link will function correctly with the new prop.
  • 150-150: The change from to to href for the InlineLink component usage here is consistent with the PR's goal and correctly updates the component to use the new prop. This ensures proper navigation functionality.
src/pages/contributing/translation-program/contributors.tsx (2)
  • 153-153: The update from to to href for the InlineLink component within the Contributors component is correctly implemented, aligning with the PR's objective to use the updated prop. This ensures the link will function as expected.
  • 181-181: This change from to to href for the InlineLink component is consistent with the PR's goal and correctly updates the component to use the new prop. It ensures the link will navigate correctly.
src/components/CommunityEvents/index.tsx (1)
  • 70-70: The change from to to href in the InlineLink component within the Event subcomponent of CommunityEvents is correctly implemented. This update aligns with the PR's objective and ensures the link will function as intended.
src/pages/languages.tsx (3)
  • 104-104: The update from to to href for the InlineLink component here correctly aligns with the PR's objective. This ensures that the link will function correctly with the new prop.
  • 111-111: This change from to to href for the InlineLink component is consistent with the PR's goal and correctly updates the component to use the new prop. It ensures the link will navigate correctly.
  • 206-206: The update from to to href for the InlineLink component in this context is correctly implemented, aligning with the PR's objective to use the updated prop. This ensures proper navigation functionality.
src/components/StablecoinAccordion/index.tsx (3)
  • 138-138: The change from to to href in the InlineLink component within the StablecoinAccordion component is correctly implemented. This update aligns with the PR's objective and ensures the link will function as intended.
  • 227-227: This update from to to href for the InlineLink component is consistent with the PR's goal and correctly updates the component to use the new prop. It ensures the link will navigate correctly.
  • 251-251: The change from to to href for the InlineLink component here correctly aligns with the PR's objective. This ensures that the link will function correctly with the new prop.
src/components/Layer2/Layer2Onboard.tsx (2)
  • 238-238: The change from to to href for the link to "/bridges/" is correctly implemented and aligns with the PR objectives.
  • 261-261: The update from to to href for the link to "/wallets/find-wallet/" is correctly done, ensuring the component's usage is up to date with the latest standards.
src/pages/contributing/translation-program/acknowledgements.tsx (1)
  • 125-125: The replacement of to with href for the link to "/contributing/translation-program/contributors/" is correctly implemented, aligning with the PR's objectives to update InlineLink usage.
src/pages/gas.tsx (1)
  • 263-263: The change from to to href in the InlineLink usage aligns with modern web standards and improves link handling. Ensure that the InlineLink component is updated to correctly handle the href prop for navigation.
src/pages/staking/deposit-contract.tsx (2)
  • 354-354: The change from to to href in the InlineLink usage aligns with modern web standards and improves link handling. Ensure that the InlineLink component is updated to correctly handle the href prop for navigation.
  • 481-481: The change from to to href in the InlineLink usage aligns with modern web standards and improves link handling. Ensure that the InlineLink component is updated to correctly handle the href prop for navigation.
src/pages/eth.tsx (6)
  • 429-429: The change from to to href in the InlineLink component is correctly implemented here, aligning with the PR's objective to update deprecated prop usage.
  • 452-452: This instance of updating the InlineLink component from to to href is correctly done, ensuring the component's usage is up to date with the latest prop expectations.
  • 482-482: The replacement of the to prop with href in this InlineLink component is correctly applied, contributing to the consistency and modernization of the component's usage across the project.
  • 488-488: Correctly updated the InlineLink component from to to href, which is in line with the PR's goal to replace deprecated prop usage.
  • 494-494: This change from to to href in the InlineLink component is properly implemented, ensuring the component adheres to the current prop usage standards.
  • 500-500: Successfully updated the InlineLink component from to to href, maintaining the project's adherence to the latest component prop expectations.
src/pages/developers/tutorials.tsx (1)
  • 250-250: The change from to to href in the InlineLink component aligns with the PR's objective to update deprecated prop usage. This ensures compatibility with the component's expected behavior and adheres to current best practices.
src/pages/developers/index.tsx (2)
  • 258-258: The update from to to href in the InlineLink component is correctly implemented, ensuring the component's usage aligns with the latest standards.
  • 339-401: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [289-490]

All instances of InlineLink components in this file have been correctly updated from to to href, following the PR's objective to replace the deprecated prop. This change is consistent across the file and improves the maintainability and future-proofing of the code.

src/pages/assets.tsx (3)
  • 163-163: The update from to to href in the InlineLink component usage aligns with the PR's objective to adhere to current best practices and the component's expected behavior. This change ensures proper navigation handling within the AssetsPage component.
  • 168-168: Similar to the previous comment, this change correctly updates the InlineLink component usage from to to href. It's consistent with the PR's goal and improves the link's accessibility and usability.
  • 173-173: This is another instance where the InlineLink component's prop is updated from to to href, further ensuring that the application's navigation is handled correctly. The consistency in applying this change across different links in the AssetsPage component is commendable.
src/pages/layer-2.tsx (14)
  • 325-325: The change from to to href in the InlineLink component is correctly implemented here. This aligns with the PR's objective to update the usage of InlineLink to reflect current best practices.
  • 361-361: The update from to to href in this InlineLink component is correctly applied. It's important to ensure that the target URL is correctly formatted and accessible.
  • 442-442: This change correctly updates the InlineLink component from using to to href. It's good practice to verify that the new href prop points to a valid and intended destination.
  • 580-580: The replacement of to with href in the InlineLink component here is in line with the PR's objectives. Ensure that the link leads to the correct section or page as intended.
  • 585-585: Correctly updated the InlineLink component from to to href. It's crucial to check that all links are functional and lead to the correct resources.
  • 635-635: The update from to to href in this InlineLink component is correctly implemented. Always verify that the link is directing users to the correct and relevant information.
  • 640-640: This change from to to href in the InlineLink component is correctly applied. It's essential to ensure that the link is accurate and leads to the intended destination.
  • 656-656: The replacement of to with href in the InlineLink component here is correctly done. Confirm that the link directs to the appropriate resource or page.
  • 664-664: Correctly updated the InlineLink component from to to href. It's important to ensure that the link is functional and leads to the intended content.
  • 678-678: The change from to to href in the InlineLink component is correctly implemented here. Verify that the link points to the correct external resource.
  • 684-684: This update from to to href in the InlineLink component is correctly applied. Ensure that the link is directing users to the intended external resource.
  • 690-690: The replacement of to with href in the InlineLink component here is in line with the PR's objectives. Confirm that the link leads to the correct YouTube video or resource.
  • 696-696: Correctly updated the InlineLink component from to to href. It's crucial to verify that the link is functional and directs to the intended YouTube video or resource.
  • 702-702: This change from to to href in the InlineLink component is correctly implemented. Always ensure that the link points to the correct external article or resource.
src/pages/stablecoins.tsx (5)
  • 241-241: The change from to to href prop in the InlineLink component is correctly implemented here, aligning with the PR's objective to update the component usage according to the latest best practices. This ensures proper link behavior and enhances accessibility.
  • 427-427: The update from to to href for internal navigation links within the InlineLink component is correctly applied. This change is consistent with the PR's goal and improves the semantic correctness of the links.
  • 484-484: This modification from to to href in the InlineLink component is appropriate and follows the PR's intention to standardize link handling across the application. It's important to ensure that all internal links are correctly updated to maintain consistent navigation behavior.
  • 489-489: The change from to to href in the InlineLink component for internal navigation is correctly implemented. This adjustment is in line with the PR's objectives and contributes to the overall improvement of link accessibility and usability within the application.
  • 696-696: The conversion from to to href for the InlineLink component is correctly done here, aligning with the PR's goal to update deprecated prop usage. This change ensures that external links are handled correctly, enhancing the user experience.
src/pages/what-is-ethereum.tsx (6)
  • 298-298: The change from to to href prop in the InlineLink component is correctly implemented here. This aligns with the PR's objective to update the component usage according to the latest best practices.
  • 695-695: The change from to to href prop in the InlineLink component is correctly implemented here. This aligns with the PR's objective to update the component usage according to the latest best practices.
  • 702-702: The change from to to href prop in the InlineLink component is correctly implemented here. This aligns with the PR's objective to update the component usage according to the latest best practices.
  • 733-733: The change from to to href prop in the InlineLink component is correctly implemented here. This aligns with the PR's objective to update the component usage according to the latest best practices.
  • 739-739: The change from to to href prop in the InlineLink component is correctly implemented here. This aligns with the PR's objective to update the component usage according to the latest best practices.
  • 746-746: The change from to to href prop in the InlineLink component is correctly implemented here. This aligns with the PR's objective to update the component usage according to the latest best practices.
src/pages/run-a-node.tsx (8)
  • 547-547: The change from to to href in the InlineLink component is correctly implemented here, aligning with the PR's objective to update deprecated prop usage.
  • 826-826: The change from to to href in the InlineLink component is correctly implemented here, aligning with the PR's objective to update deprecated prop usage.
  • 833-833: The change from to to href in the InlineLink component is correctly implemented here, aligning with the PR's objective to update deprecated prop usage.
  • 838-838: The change from to to href in the InlineLink component is correctly implemented here, aligning with the PR's objective to update deprecated prop usage.
  • 882-882: The change from to to href in the InlineLink component is correctly implemented here, aligning with the PR's objective to update deprecated prop usage.
  • 893-893: The change from to to href in the InlineLink component is correctly implemented here, aligning with the PR's objective to update deprecated prop usage.
  • 902-902: The change from to to href in the InlineLink component is correctly implemented here, aligning with the PR's objective to update deprecated prop usage.
  • 911-911: The change from to to href in the InlineLink component is correctly implemented here, aligning with the PR's objective to update deprecated prop usage.
src/pages/dapps.tsx (2)
  • 117-120: The change to import uni.png using ES6 destructuring syntax and assigning it to uniswap and uniswapec is syntactically correct. This was confirmed to be an auto-fix by eslint due to the same image file being imported twice. The discussion in the PR comments provides additional context.
  • 1862-1862: Changing the InlineLink component's attribute from to to href aligns with the PR's objective to update the usage of InlineLink according to current best practices. This change is consistent with standard HTML semantics for links.

@pettinarip pettinarip merged commit cdf6b1b into ethereum:dev Mar 7, 2024
10 checks passed
This was referenced Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content 🖋️ This involves copy additions or edits
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants