Page MenuHomePhabricator

[web] Push `onChange[Name/Description/Color]` callbacks down to `ThreadSettingsGeneralTab` component
ClosedPublic

Authored by atul on Apr 24 2022, 1:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 1:39 PM
Unknown Object (File)
Thu, Dec 19, 1:39 PM
Unknown Object (File)
Thu, Dec 19, 1:39 PM
Unknown Object (File)
Thu, Dec 19, 1:39 PM
Unknown Object (File)
Thu, Dec 19, 1:39 PM
Unknown Object (File)
Thu, Dec 19, 1:39 PM
Unknown Object (File)
Thu, Dec 19, 1:36 PM
Unknown Object (File)
Sat, Nov 30, 4:44 AM

Details

Summary

Push onChange[Name/Description/Color] callbacks down to the ThreadSettingsGeneralTab component to clean up parent ThreadSettingsModal component and move them closer to where they're used.

  • Added threadInfo, queuedChanges, and setQueuedChanges props to ThreadSettingsGeneralTab component so callbacks could be "constructed" from the "child" component
  • Adding those props also lets us determine threadDescriptionValue, etc within child component instead of having to pass in from parent

Depends on D3826

Test Plan
  1. Open ThreadSettingsModal
  2. Make sure that the "General" tab continues to look/work as expected

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

web/modals/threads/thread-settings-modal.react.js
135 ↗(On Diff #11832)

No longer need optional chaining because threadInfo is guaranteed to exist within ThreadSettingsGeneralTab

atul requested review of this revision.Apr 24 2022, 1:54 PM

access properties with obj.blah instead of obj['blah']

tomek added inline comments.
web/modals/threads/thread-settings-general-tab.react.js
31–44 ↗(On Diff #11833)

It's safer to use a callback version of set state. That would also allow us reducing deps list.

This revision is now accepted and ready to land.Apr 26 2022, 8:20 AM
web/modals/threads/thread-settings-general-tab.react.js
31–44 ↗(On Diff #11833)

actually rebase before landing