Page MenuHomePhabricator

[web] Introduce `EditUserAvatarMenu`
ClosedPublic

Authored by atul on Jun 16 2023, 12:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jan 6, 2:55 PM
Unknown Object (File)
Mon, Jan 6, 2:55 PM
Unknown Object (File)
Mon, Jan 6, 2:55 PM
Unknown Object (File)
Mon, Jan 6, 2:55 PM
Unknown Object (File)
Mon, Jan 6, 2:54 PM
Unknown Object (File)
Mon, Jan 6, 2:50 PM
Unknown Object (File)
Sun, Jan 5, 8:03 PM
Unknown Object (File)
Nov 9 2024, 10:20 PM
Subscribers

Details

Summary

Dropdown menu with edit user avatar options (eg emoji, image, etc).


Depends on D8242

Test Plan

Looks as expected:

db5e3a.png (2×2 px, 639 KB)

(Used icons + copy from native, the Figma designs are pretty old)

(Right now the menu items appear to the left of the button, will need to modify Menu to be able to display items to the right of the button... will defer this)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.Jun 16 2023, 12:37 PM
atul edited the test plan for this revision. (Show Details)
atul edited the test plan for this revision. (Show Details)
web/avatars/edit-user-avatar-menu.react.js
20 ↗(On Diff #27853)

Right now MenuItem takes an icon: string prop which is restricted to SWMansion icons. However, we'll need to modify MenuItem to take React.Node so we can pass in CommIcon for the ENS option.

Deferring that for later.

ashoat added inline comments.
web/avatars/edit-user-avatar-menu.react.js
11–32 ↗(On Diff #27853)

Any time you're using React.useMemo with an empty dep list, that's usually a sign you can factor that to the top-level scope. I'm guessing the MenuItems will have to be defined in the component once you add handlers, but editIcon at least seems like it can be defined at the top-level scope

This revision is now accepted and ready to land.Jun 17 2023, 2:18 PM
web/avatars/edit-user-avatar-menu.react.js
11–32 ↗(On Diff #27853)

Ah yeah, the MenuItems will have handlers, but editIcon could totally be defined outside. Will update this diff.

rebase before addressing feedback

This revision was landed with ongoing or failed builds.Jun 19 2023, 9:58 AM
This revision was automatically updated to reflect the committed changes.