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

Feature/refactor copy to clipboard button component #44

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jojomensah89
Copy link

@jojomensah89 jojomensah89 commented Dec 8, 2024

Description

Refactored the copy-to-clipboard functionality into a reusable CopyButton component to encapsulate state management and prevent unnecessary re-renders of other components. Updated the usage in the index page to utilize the new component, improving code maintainability and readability.

Video Proof

You can view the issue here:
Scaffold-ETH2-OpensourcetoolkittobuilddAppsonEthereum-GoogleChrome2024-12-0819-12-26-ezgif com-video-to-gif-converter

Additional Information

[x] I have read the contributing docs (if this is your first contribution)
[x] This is not a duplicate of any existing pull request

Key Changes:

Created a new CopyToClipBoardButton component that encapsulates the copy functionality and manages its own state.
Removed shared state management from the parent component, ensuring that each copy button operates independently.

Reason for Changes:

The refactor was necessary to improve performance by preventing unnecessary re-renders of other components when the copy button is clicked. By isolating the state management within the CopyToClipBoardButton, we enhance the overall efficiency of the component tree, leading to a smoother user experience.

Video Proof

You can view the functionality in action here:
Scaffold-ETH2-OpensourcetoolkittobuilddAppsonEthereum-GoogleChrome2024-12-0819-13-33-ezgif com-video-to-gif-converter

Your ENS/address: 0x6E8cE016Eb0B892669611CE87C755c1789C759ee

Copy link

vercel bot commented Dec 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
scaffoldeth-io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 8, 2024 7:09pm

Copy link

vercel bot commented Dec 8, 2024

@jojomensah89 is attempting to deploy a commit to the BuidlGuidl Team on Vercel.

A member of the Team first needs to authorize it.

@jojomensah89
Copy link
Author

jojomensah89 commented Dec 8, 2024

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.

1 participant