Page MenuHomePhabricator

[web] Push `onChangeThreadType` callback down to `ThreadSettingsPrivacyTab` component
ClosedPublic

Authored by atul on Apr 24 2022, 2:16 PM.
Tags
None
Referenced Files
F3353188: D3828.id12077.diff
Sat, Nov 23, 8:49 AM
F3352530: D3828.diff
Sat, Nov 23, 6:19 AM
Unknown Object (File)
Wed, Nov 13, 11:22 AM
Unknown Object (File)
Sat, Nov 9, 5:55 PM
Unknown Object (File)
Sat, Nov 9, 5:55 PM
Unknown Object (File)
Sat, Nov 9, 5:55 PM
Unknown Object (File)
Sat, Nov 9, 5:55 PM
Unknown Object (File)
Sat, Nov 9, 5:55 PM

Details

Summary

Push onChangeThreadType callback down to ThreadSettingsPrivacyTab component to clean up parent ThreadSettingsModal component and to move callback closer to where it's used.

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

Depends on D3827

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

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.Apr 24 2022, 2:17 PM
tomek added inline comments.
web/modals/threads/thread-settings-privacy-tab.react.js
32 ↗(On Diff #11834)

We can use a callback here

54 ↗(On Diff #11834)

I think it might be a good idea to create a variable queuedChanges.type ?? threadInfo.type and use it in both places

This revision is now accepted and ready to land.Apr 26 2022, 8:28 AM
web/modals/threads/thread-settings-privacy-tab.react.js
32 ↗(On Diff #11834)
54 ↗(On Diff #11834)

will bring back the potentiallyChangedValue helper function to cut the verbosity here