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
Unknown Object (File)
Tue, Nov 5, 4:56 AM
Unknown Object (File)
Thu, Oct 10, 2:32 AM
Unknown Object (File)
Thu, Oct 10, 2:32 AM
Unknown Object (File)
Thu, Oct 10, 2:31 AM
Unknown Object (File)
Thu, Oct 10, 2:31 AM
Unknown Object (File)
Thu, Oct 10, 2:31 AM
Unknown Object (File)
Thu, Oct 10, 2:28 AM
Unknown Object (File)
Sep 19 2024, 3:31 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