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

The super awesome copy link button #23

Merged
merged 3 commits into from Oct 5, 2021
Merged

The super awesome copy link button #23

merged 3 commits into from Oct 5, 2021

Conversation

PhattOZ
Copy link
Contributor

@PhattOZ PhattOZ commented Oct 5, 2021

Pheww It's truly a huge feature. Took way longer than I expected 💥

Here're what I implemented

  • I noticed from the PR discussion. If we wrote a button which is a stateful component within the page component, when its state changes, it will cause the entire page to rerender (The quote change after clicking the copy button). Therefore, I extracted the button component and put it in the component folder separately
  • Use flex box on the button and footer. Should be more responsive and easier to add spacing
  • The button's style will change when clicked
  • I've added the counter for the button to revert back to the same blue one. If the you keep clicking it, the timer will reset.
  • If you come from URL other than home page (/), the copy button will not be shown.

I've got to learn a lot from this small button and I hope you like its smoothness as much as I am.
Thank you so much for the opportunity!

I removed the duplicate background-color in .button class and using flex box on footer instead of raw margin
The button will now revert back to the blue copy link after some time.
When coming from the external link. The copy link will not be visible
@vercel
Copy link

vercel bot commented Oct 5, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/gouravkhunger/nextjs-birthday-wish/Hj4DSyedtYgdR47nDMYcFCYJ3mnf
✅ Preview: https://nextjs-birthday-wish-git-fork-phattoz-main-gouravkhunger.vercel.app

@gouravkhunger
Copy link
Owner

gouravkhunger commented Oct 5, 2021

This is something truly amazing!!!!

Thanks a lot @PhattOZ I will include your name along with a few others as a super contributor to the README file. You all have made the project look super interesting and better!

Thanks again for taking a lot of time for this :)
Really appreciated!!!

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.

None yet

2 participants