Page MenuHomePhabricator

[native] make UserRelationshipTooltipButton a functional component
ClosedPublic

Authored by ginsu on Oct 5 2023, 2:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 11, 2:11 AM
Unknown Object (File)
Sat, Nov 30, 12:50 AM
Unknown Object (File)
Tue, Nov 26, 3:01 AM
Unknown Object (File)
Nov 22 2024, 1:07 PM
Unknown Object (File)
Nov 22 2024, 9:15 AM
Unknown Object (File)
Nov 20 2024, 7:22 PM
Unknown Object (File)
Nov 14 2024, 11:13 PM
Unknown Object (File)
Nov 12 2024, 12:10 PM
Subscribers

Details

Summary

In a subsequent diff I am going to need to use the useColors hook. I figured the easiest/best way to call that hook is going to be by first converting UserRelationshipTooltipButton into a functional component

This is step 3 in the list below
Outlined below are the steps I will take to update RelationshipListItemTooltipModal:

  1. Add the block action to relationship list item tooltip menu (RelationshipListItem won't need this option, but User profiles will. This is shown in the figma screenshot above)
  2. Rename RelationshipListItemTooltipModal to something more generic like UserRelationshipTooltipModal
  3. Make UserRelationshipTooltipButton into a functional component (We need to use the useColors hook in a subsequent diff)
  4. Introduce the tooltipButtonIcon as a param to RelationshipListItemTooltipModal (RelationshipListItem will use a pencil icon and user profiles will use a kebab menu icon)
  5. Introduce UserProfileMenuButton (This component will handle navigating to RelationshipListItemTooltipModal

Depends on D9379

Test Plan

flow and confirmed that there were no regressions with UserRelationshipTooltipModal when pressing the edit button in RelationshipListItem

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ginsu requested review of this revision.Oct 5 2023, 2:45 PM
atul added inline comments.
native/profile/user-relationship-tooltip-modal.react.js
136–138 ↗(On Diff #31701)

Rendering SVGs can be kind of expensive. Haven't actually profiled in this case, but would be good to wrap this in useMemo

This revision is now accepted and ready to land.Oct 5 2023, 4:31 PM
native/profile/user-relationship-tooltip-modal.react.js
136–138 ↗(On Diff #31701)

In D9381 (the very next diff) I pull out <PencilIcon /> and wrap it in a useMemo

This revision was landed with ongoing or failed builds.Oct 5 2023, 6:38 PM
This revision was automatically updated to reflect the committed changes.