Page MenuHomePhabricator

[web] Introduce user list modal
ClosedPublic

Authored by tomek on Apr 8 2022, 7:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 4:36 PM
Unknown Object (File)
Thu, Nov 14, 4:36 PM
Unknown Object (File)
Thu, Nov 14, 4:36 PM
Unknown Object (File)
Thu, Nov 7, 4:45 PM
Unknown Object (File)
Tue, Nov 5, 4:10 AM
Unknown Object (File)
Tue, Nov 5, 4:10 AM
Unknown Object (File)
Tue, Nov 5, 4:10 AM
Unknown Object (File)
Tue, Nov 5, 4:10 AM

Details

Summary

This is a modal that can render both friend and block list.

Depends on D3674

Test Plan

Render the modal by providing functions and component and check if it looks ok.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested review of this revision.Apr 8 2022, 7:27 AM

Not super familiar with this sort of approach, so adding @ashoat as blocking reviewer to take another look

web/settings/relationship/user-list-modal.react.js
36–43 ↗(On Diff #11242)

Would it make sense to pull this out of the JSX and use a callback?

Something like:

const searchModalChildGenerator = React.useCallback(
  (searchText: string) => {
    return (
      <UserList
        userRowComponent={userRowComponent}
        filterUser={filterUser}
        usersCompareFunction={usersCompareFunction}
        searchText={searchText}
      />
    );
  },
  [filterUser, userRowComponent, usersCompareFunction],
);

return (
  <SearchModal
    name={name}
    size="large"
    searchPlaceholder="Search by name"
    onClose={onClose}
  >
    {searchModalChildGenerator}
  </SearchModal>
);
atul requested changes to this revision.Apr 10 2022, 4:15 PM
atul added a reviewer: ashoat.
This revision now requires changes to proceed.Apr 10 2022, 4:15 PM
This revision now requires review to proceed.Apr 10 2022, 6:05 PM
ashoat requested changes to this revision.Apr 10 2022, 7:26 PM

Overall looks good, but agree we should memoize the render prop

web/settings/relationship/user-list-modal.react.js
36–43 ↗(On Diff #11242)

Agree with this

This revision now requires changes to proceed.Apr 10 2022, 7:26 PM
This revision is now accepted and ready to land.Apr 14 2022, 2:26 PM
This revision was automatically updated to reflect the committed changes.