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

j) Repeated Code in Feature Cards #21

Closed
aliveevie opened this issue Feb 14, 2025 · 8 comments
Closed

j) Repeated Code in Feature Cards #21

aliveevie opened this issue Feb 14, 2025 · 8 comments

Comments

@aliveevie
Copy link
Contributor

Description

In the page.tsx under /packages/nextjs/app/page.tsx file, the two feature cards (Debug Contracts and Block Explorer) share nearly identical structures but are hardcoded separately. This results in code duplication, making it harder to maintain and update the UI consistently.

Each card consists of:

  • An icon (BugAntIcon or MagnifyingGlassIcon).
  • A short description of the feature.
  • A Link component directing the user to a relevant page.

This approach violates the DRY (Don't Repeat Yourself) principle. If we need to update the design, style, or structure of the cards in the future, we would have to modify multiple places in the code instead of a single, centralized component.


Goal

The goal of this refactor is to:

  • Reduce Code Duplication – Remove repeated code and consolidate logic into a reusable component.
  • Improve Maintainability – Make it easier to update styles, structure, or functionality for feature cards in one place.
  • Enhance Readability – Create a cleaner and more modular codebase that is easier to understand and extend.
  • Promote Reusability – Allow the same component to be used for additional features in the future without writing redundant code.
@aliveevie aliveevie changed the title Repeated Code in Feature Cards j) Repeated Code in Feature Cards Feb 14, 2025
@aliveevie
Copy link
Contributor Author

@phipsae I'm proposing this issue!

@phipsae
Copy link
Collaborator

phipsae commented Feb 14, 2025

Since the whole page will be changed in #2 it doesn't make so much sense in my perspective (sorry).
Why don't you think of a new feature?

@melanke
Copy link
Collaborator

melanke commented Feb 14, 2025

@aliveevie Thanks for the suggestion! I agree with Philip, we usually remove this part of the homepage.
How about something web3-related? Maybe pulling data from our contract, interacting with another contract, or even creating a simple new contract? Is up to you.

@aliveevie
Copy link
Contributor Author

@aliveevie Thanks for the suggestion! I agree with Philip, we usually remove this part of the homepage. How about something web3-related? Maybe pulling data from our contract, interacting with another contract, or even creating a simple new contract? Is up to you.

Okay Noted sir

Since the whole page will be changed in #2 it doesn't make so much sense in my perspective (sorry). Why don't you think of a new feature?

Noted, I'm thinking again

@phipsae
Copy link
Collaborator

phipsae commented Feb 15, 2025

@aliveevie the issue should be more about implementing new features, so why not contributing to #2?

@phipsae phipsae closed this as completed Feb 15, 2025
@aliveevie
Copy link
Contributor Author

@aliveevie the issue should be more about implementing new features, so why not contributing to #2?

Assigned it to me, issue

@phipsae
Copy link
Collaborator

phipsae commented Feb 15, 2025

Pls talk in the chat because someone is already working on that. And align, ask where you can support.

@aliveevie
Copy link
Contributor Author

Pls talk in the chat because someone is already working on that. And align, ask where you can support.

Okay!

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

No branches or pull requests

3 participants