Skip to content

Conversation

@jicruz96
Copy link
Collaborator

@jicruz96 jicruz96 commented Aug 31, 2025

Summary

  1. refactors follow/follower views with shared building blocks:
    • PaginatedItemsCard for generic paginated lists with loading/error states
    • FollowUserCard for rendering user profiles with follow buttons
    • FollowUserButton and FollowBillButton for consistent follow/unfollow button behavior with optional confirmation modals
  2. consolidates follow/unfollow helpers to a single source and standardizes their names.
  3. rewires/cleans up any code dependent on 1 and 2.

Walkthrough

  1. Shared PaginatedItemsCard component (components/shared/PaginatedItemsCard.tsx)
    • adds genericPaginatedItemsCard responsible for pagination state, loading/error messaging, and rendering arbitrary item cards.
  2. SharedFollowUserCard components (components/EditProfilePage/FollowUserCard.tsx)
    • Centralizes layout logic for displaying a user with a follow/unfollow button, used by both FollowingTab and FollowersTab.
  3. refactored Following tab (components/EditProfilePage/FollowingTab.tsx)
    • refactored to use PaginatedItemsCard to render bill and profiles.
    • removes the bespoke unfollow modal/pagination state that lived in FollowingTabComponents/UnfollowModal (both deleted).
  4. Followers tab (components/EditProfilePage/FollowersTab.tsx)
    • refactored to use PaginatedItemsCard.
  5. Follow button plumbing (components/shared/FollowButton.tsx)
    • centralises follow button logic onto BaseFollowButton.
    • adds optional confirmation modal directly to BaseFollowButton so screens can opt-in to confirmation easily.
    • defines FollowUserButton / FollowBillButton.
  6. Follow Firestore helpers (components/shared/FollowingQueries.tsx)
    • standardized function names for clarity.
  7. Downstream call sites
    • PolicyActions + TestimonyDetailPage switch to the new helpers.

@vercel
Copy link

vercel bot commented Aug 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
maple-dev Ready Ready Preview Comment Oct 4, 2025 8:13pm

Copy link
Collaborator

@Mephistic Mephistic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 Love this, thanks for jumping on this cleanup! Only blocker I see on merging this is fixing the broken translation keys.

<OutlineButton
className="col-3 ms-auto"
onClick={onCancel}
label={t("confirmation.no")}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The translation keys for confirmation are in the editProfile json file, not the common file - so these lookups won't work. We either need to move these keys to common or include editProfile as a translation root. Given that we use the Follow buttons outside of the edit profile page (even if we don't have confirmation modals enabled in those places at the moment), my vote would be for moving the keys to common.

Screenshot 2025-10-14 at 5 14 22 PM

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.

2 participants