Skip to content
Snippets Groups Projects

Split UserCard into FollowCard/FollowRequestCard and Rewrite FollowList using HOCs

Merged Tae Hoon requested to merge tae/pleroma-fe:398-rewrite-follow-list into develop

Closes #398 (closed)

I've split the current UserCard component into two based on its purpose (following/unfollowing user or accepting/rejecting follow request). Based on that, I've redefined the FollowList component using component composition technique with HOCs and the FollowCard component.

To make FollowCard and BlockCard consistent visually, I've added minor css changes.

Screenshots:

  • FollowList

FollowList

  • FollowRequestList

FollowRequestList

  • BlockList

BlockList

Edited by Tae Hoon

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Maintainer

    I really want to look into it a bit more in-depth to see what exactly is going on and if it's even worth it using HOCs here, because it could be a bit over-engineering at work.

    I'll look into it later today or this week.

    • Resolved by Tae Hoon

      I see the button is now next to names instead of below. How is it on mobile now? especially with longer names and usernames. There's a reason why I made it the other way previously.

  • Shpuld Shpludson
  • @hj I don't think the higher-order components are over-engineering in cases like this, it removes a lot of copy-paste tier code while also being able to split components into smaller ones, instead of monolith components that look and work different in different contexts.

  • Maintainer

    I mean there still should be balance between code readability and architecture.

  • Tae Hoon added 1 commit

    added 1 commit

    Compare with previous version

  • Tae Hoon added 1 commit

    added 1 commit

    • c3a0d307 - Improve mobile layout of user card

    Compare with previous version

  • Tae Hoon changed the description

    changed the description

  • Tae Hoon resolved all discussions

    resolved all discussions

  • HJ
  • HJ
  • HJ
  • HJ
  • HJ
    • Maintainer
      Resolved by Tae Hoon

      I really think FollowCard and BlockCard should be merged into one. Somebody might want to go over their followers and block out nazis bots or haters.

  • Tae Hoon added 2 commits

    added 2 commits

    Compare with previous version

    • Maintainer
      Resolved by Shpuld Shpludson

      I think Primary/Secondary/Tertiary are very bad naming for slots, it's nearly same as naming them foo, bar, baz.

      Looking into what is actually going on there i see 2 problems:

      1. We need to hide "follows you" for followers list (questionable tbh) and probably on Follow request (not that it will ever be visible there)
      2. We need to show either block/unblock+follow/unfollow or accept/reject buttons.

      If we follow my suggestion to merge followcard with block card into one UserCard then we can just toggle "follows you" via prop if we need or don't need them. Also hide "Follow" button if user is blocked.

      Buttons should have their own slot "buttons" that is shown on the rightmost side of card and wraps below screen name if width gets too small, but still should be right-aligned.

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading