Page MenuHomePhabricator

[native] introduce community list component
ClosedPublic

Authored by varun on Nov 21 2024, 1:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 27, 5:02 PM
Unknown Object (File)
Thu, Mar 27, 11:58 AM
Unknown Object (File)
Thu, Mar 27, 9:17 AM
Unknown Object (File)
Wed, Mar 26, 10:49 PM
Unknown Object (File)
Wed, Mar 26, 3:07 PM
Unknown Object (File)
Feb 25 2025, 7:30 AM
Unknown Object (File)
Feb 23 2025, 11:00 PM
Unknown Object (File)
Feb 22 2025, 8:28 PM
Subscribers

Details

Summary

this component is basically a fork of the native ThreadList component

the differences are, the new component:

  • renders CommunityListItems
  • does not have an onSelect (we may consider adding this in the future to display community info)
  • does not have a searchRef (we don't want to call focus() on the textInput, keyboard should not display unless user presses search bar)

Depends on D13994

Test Plan

see video

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun requested review of this revision.Nov 21 2024, 2:00 PM
ashoat requested changes to this revision.Nov 21 2024, 6:28 PM

React class components should not be used for new components in 95% of cases... can you try to make this a function component?

native/components/community-list.react.js
44 ↗(On Diff #45932)

We should not be introducing any new class components

50–65 ↗(On Diff #45932)

This messy pattern is approximating React.useMemo

84 ↗(On Diff #45932)

There's a shorthand for this now

95 ↗(On Diff #45932)
This revision now requires changes to proceed.Nov 21 2024, 6:28 PM

rewrite as a functional component

ashoat added inline comments.
native/components/community-list.react.js
24–26 ↗(On Diff #46370)

Do we actually have multiple use cases for this component?

If not, I think:

  1. We should avoid having optional properties, and make them all requires
  2. We should remove any properties that are not used in our upcoming first (and only?) use case
48–50 ↗(On Diff #46370)

Nit: shorthand

This revision is now accepted and ready to land.Dec 12 2024, 10:49 AM
native/components/community-list.react.js
24–26 ↗(On Diff #46370)

made similar changes downstream

This revision was automatically updated to reflect the committed changes.