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)
Tue, Nov 12, 7:07 PM
Unknown Object (File)
Sun, Nov 10, 5:11 PM
Unknown Object (File)
Fri, Nov 8, 9:56 AM
Unknown Object (File)
Thu, Nov 7, 8:18 PM
Unknown Object (File)
Thu, Nov 7, 7:52 PM
Unknown Object (File)
Thu, Nov 7, 7:33 PM
Unknown Object (File)
Thu, Nov 7, 7:07 PM
Unknown Object (File)
Thu, Nov 7, 6:55 PM

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
Branch
arcpatch-D3827 (branched from master)
Lint
No Lint Coverage
Unit
No Test Coverage

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