Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the application's hooks structure by reorganizing them into more specific subdirectories based on feature domains (such as
community,posts,comments, andadmin). The changes update all relevant imports and usages throughout the codebase to use the new hook locations and, where appropriate, split monolithic hooks into more focused, single-responsibility hooks for improved maintainability and clarity.Hooks organization and import updates:
hooks/community,hooks/posts,hooks/comments,hooks/admin), and all import statements across the codebase have been updated accordingly. [1] app/community/[communityId]/comments/[pid]/PostClientPage.tsxL12-R16, [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]Hooks splitting and single-responsibility refactor:
usePosts,useComments,useCommunityData, anduseAdmins) have been split into more focused hooks (e.g.,usePostState,usePostVote,usePostDeletion,useCommentList,useCreateComment,useDeleteComment,useCommunityState,useCommunityMembershipActions,useAdminList,useAddAdmin, etc.), improving separation of concerns and code clarity. (app/community/[communityId]/comments/[pid]/PostClientPage.tsxL35-R42, [1] [2] [3] [4] [5] [6] [7] [8] [9]Type and usage updates:
Commentfromhooks/comments/typesinstead of from the old comments hook, and updating props and destructuring to use the new hooks' APIs. [1] [2] [3]Feature-specific improvements:
General codebase maintainability: