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

Add useUpdateEffect hook to update following state #4107

Merged
merged 1 commit into from Dec 5, 2023
Merged

Conversation

bigint
Copy link
Member

@bigint bigint commented Dec 5, 2023

What does this PR do?

🤖[deprecated] Generated by Copilot at 22f1d49

This pull request refactors the follow button and modal functionality in the profile page. It extracts the follow logic and state from the ViewProfile and FollowDialog components and moves it to a custom hook and a FollowButton component inside the Details component. This simplifies the code, improves performance, and removes the unused file FollowDialog.tsx.

Related issues

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Enhancement (non-breaking small changes to existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Explanation of the changes

🤖[deprecated] Generated by Copilot at 22f1d49

  • Remove follow modal logic and UI from ViewProfile component (link, link, link, link, link, link)
  • Delete unused FollowDialog component and file (link)
  • Manage following state internally by Details component and update it based on isFollowedByMe prop (link, link)
  • Import and use useUpdateEffect hook from usehooks-ts library to run an effect only when isFollowedByMe prop changes (link)

Emoji

🪄🗑️🎛️

Copy link

vercel bot commented Dec 5, 2023

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

Name Status Preview Updated (UTC)
web ✅ Ready (Inspect) Visit Preview Dec 5, 2023 7:18am

Copy link

height bot commented Dec 5, 2023

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@bigint bigint merged commit 7ae3dd1 into main Dec 5, 2023
5 of 7 checks passed
@bigint bigint deleted the rm-follow-modal branch December 5, 2023 07:15
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

1 participant