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)
Thu, Dec 12, 10:24 PM
Unknown Object (File)
Nov 27 2024, 12:51 AM
Unknown Object (File)
Nov 27 2024, 12:27 AM
Unknown Object (File)
Nov 17 2024, 9:53 PM
Unknown Object (File)
Nov 16 2024, 1:10 PM
Unknown Object (File)
Nov 15 2024, 6:09 AM
Unknown Object (File)
Nov 15 2024, 6:09 AM
Unknown Object (File)
Nov 15 2024, 6:09 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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

Should this be memoized? (Open to arguments against)

tomek added inline comments.
web/modals/threads/thread-settings-modal.react.js
110 ↗(On Diff #11829)

Do we need to use optional?

416–459 ↗(On Diff #11829)

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 ↗(On Diff #11829)
416–459 ↗(On Diff #11829)

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.