Page MenuHomePhabricator

[web] Lift `tabs: React.Node` from `ThreadSettingsModal` to `ConnectedThreadSettingsModal`
ClosedPublic

Authored by atul on Apr 24 2022, 12:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 8, 12:33 AM
Unknown Object (File)
Tue, Nov 5, 1:47 AM
Unknown Object (File)
Sun, Nov 3, 1:27 PM
Unknown Object (File)
Sun, Nov 3, 1:27 PM
Unknown Object (File)
Oct 10 2024, 2:51 AM
Unknown Object (File)
Oct 10 2024, 2:51 AM
Unknown Object (File)
Oct 10 2024, 2:51 AM
Unknown Object (File)
Oct 10 2024, 2:51 AM

Details

Summary

Lift tabs from the ThreadSettingsModal class component to the ConnectedThreadSettingsModal functional component.

Doing this to "stage" the lifting of JSX markup into separate steps to hopefully make it easier to review.

As part of the work to refactor ThreadSettingsModal... specifically to turn it into a functional component.


Depends on D3823

Test Plan
  1. Open ThreadSettingsModal
  2. Make sure the "tabs" of the ThreadSettingsModal component continue to look and behave as expected (since that was what was moved)
  3. Change some settings around, hit save, and make sure things are saved as expected

Diff Detail

Repository
rCOMM Comm
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul requested review of this revision.Apr 24 2022, 12:50 PM
web/modals/threads/thread-settings-modal.react.js
416–459

Should this be memoized? (Open to arguments against)

tomek added inline comments.
web/modals/threads/thread-settings-modal.react.js
110

Do we need to use optional?

416–459

I had a similar question in the previous diff. I think that memoizing here makes sense - it's more predictable when props change if and only if the content is different.

This revision is now accepted and ready to land.Apr 26 2022, 8:06 AM
web/modals/threads/thread-settings-modal.react.js
110
416–459

The goal of this diff was to just move the tabs out from the class component to the outer functional component.

We stop using this approach to Tabs entirely and move to the Tabs.Container/Tabs.Item components introduced by @def-au1t in D3845, so this gets ripped out entirely. However, the tabs are memoized with that new approach.