Page MenuHomePhabricator

[native] factor out shared code between Emoji[User/Thread]AvatarCreation into EmojiAvatarCreation
ClosedPublic

Authored by ginsu on Apr 18 2023, 1:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 10, 4:57 PM
Unknown Object (File)
Apr 14 2024, 6:28 PM
Unknown Object (File)
Apr 14 2024, 6:28 PM
Unknown Object (File)
Apr 14 2024, 6:28 PM
Unknown Object (File)
Apr 14 2024, 6:28 PM
Unknown Object (File)
Apr 14 2024, 6:28 PM
Unknown Object (File)
Apr 14 2024, 6:28 PM
Unknown Object (File)
Apr 14 2024, 6:23 PM
Subscribers

Details

Summary

The overall approach I took with refactoring this is very similar to how we built the Avatar component. We use EmojiAvatarCreation as the base component that handles all the UI/UX and shared logic, and EmojiUserAvatarCreation handles all the user avatar specific logic and EmojiThreadAvatarCreation handles all the thread avatar specific logic

Depends on D7503

Test Plan

Saving emoji avatars still work as expected, no flow errors

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/profile/emoji-user-avatar-creation.react.js
17 ↗(On Diff #25310)

We need this to make flow/eslint happy, saw a similar pattern here

https://github.com/CommE2E/comm/blob/master/native/profile/privacy-preferences.react.js

ginsu requested review of this revision.Apr 18 2023, 1:56 PM
ashoat requested changes to this revision.Apr 19 2023, 5:50 AM

This looks good, but I want to make sure the types are okay before you land, so requesting changes so I can have a final pass-through before you land

native/avatars/emoji-avatar-creation.react.js
24–27 ↗(On Diff #25312)

Is this still used anywhere?

32 ↗(On Diff #25312)
  1. I think you're missing a + here
  2. * is basically any, so we should use a more appropriate type parameter here. I actually don't think we should be using BaseAppState in native at all... can we use the AppState from native/redux/state-types.js?
native/profile/profile-screen.react.js
202–204 ↗(On Diff #25312)

This can be simplified now

This revision now requires changes to proceed.Apr 19 2023, 5:50 AM
This revision is now accepted and ready to land.Apr 19 2023, 11:05 AM
This revision was landed with ongoing or failed builds.Apr 19 2023, 12:46 PM
This revision was automatically updated to reflect the committed changes.