Page MenuHomePhabricator

[native] Introduce RegistrationTile and fill in KeyserverSelection
ClosedPublic

Authored by ashoat on Apr 22 2023, 12:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 3 2024, 4:46 PM
Unknown Object (File)
Oct 3 2024, 5:41 AM
Unknown Object (File)
Sep 26 2024, 12:29 PM
Unknown Object (File)
Sep 18 2024, 4:26 PM
Unknown Object (File)
Sep 18 2024, 4:22 PM
Unknown Object (File)
Sep 18 2024, 4:18 PM
Unknown Object (File)
Sep 18 2024, 4:16 PM
Unknown Object (File)
Sep 18 2024, 4:04 PM
Subscribers

Details

Summary

This diff styles KeyserverSelection to match what's in Figma, but without any selection state or "Next" button.

I also introduce two new components: KeyserverTile and KeyserverTileHeader. They serve to factor out the tile JSX, and in later diffs will also hold the selection state.

Depends on D7575

Test Plan
beforeafter
Screenshot 2023-04-22 at 3.28.38 PM.png (1×1 px, 704 KB)
Screenshot 2023-04-22 at 3.28.44 PM.png (1×1 px, 785 KB)

Diff Detail

Repository
rCOMM Comm
Branch
ashoat/registration
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/account/registration/registration-tile.react.js
16–25

This looks kinda hacky, but I personally think it's a good pattern for making a React component that needs two React.Node props (as opposed to the usual single children prop) look "semantic".

<RegistrationTile>
  <RegistrationTileHeader>
    {headerGoesHere}
  </RegistrationTileHeader>
  {bodyGoesHere}
</RegistrationTile>

Open to making this less "magical" if people want. One alternative would be for RegistrationTile to take a "render prop" that renders the header.

Harbormaster returned this revision to the author for changes because remote builds failed.Apr 22 2023, 1:00 PM
Harbormaster failed remote builds in B18666: Diff 25566!
  1. Make it work with Fast Refresh by comparing child.type.name instead of child.type
  2. Memoize the header and body

Move radio rendering from RegistrationTile to RegistrationTileHeader

Harbormaster returned this revision to the author for changes because remote builds failed.Apr 22 2023, 1:46 PM
Harbormaster failed remote builds in B18668: Diff 25568!
native/account/registration/registration-tile.react.js
14–28 ↗(On Diff #25573)

This looks kinda hacky, but I personally think it's a good pattern for making a React component that needs two React.Node props (as opposed to the usual single children prop) look "semantic".

<RegistrationTile>
  <RegistrationTileHeader>
    {headerGoesHere}
  </RegistrationTileHeader>
  {bodyGoesHere}
</RegistrationTile>

Open to making this less "magical" if people want. One alternative would be for RegistrationTile to take a "render prop" that renders the header.

This revision is now accepted and ready to land.Apr 23 2023, 11:49 AM