Page MenuHomePhabricator

[web] Introduce `ThreadSettingsRelationshipTab` component
ClosedPublic

Authored by jacek on Jul 29 2022, 3:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 9, 11:39 AM
Unknown Object (File)
Fri, Nov 8, 8:37 PM
Unknown Object (File)
Fri, Nov 8, 8:37 PM
Unknown Object (File)
Fri, Nov 8, 8:37 PM
Unknown Object (File)
Fri, Nov 8, 8:37 PM
Unknown Object (File)
Wed, Nov 6, 8:14 PM
Unknown Object (File)
Tue, Nov 5, 2:05 AM
Unknown Object (File)
Mon, Nov 4, 7:59 PM

Details

Summary

Introduce container for list of relationship buttons. It will be used as tab in thread settings modal on web

Screenshot_Google Chrome_2022-07-29_122412.png (665×460 px, 25 KB)

Test Plan

The component is not used yet. Test if tab displays correctly after introducing this tab in thread settings modal

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested changes to this revision.Jul 29 2022, 5:55 AM
tomek added inline comments.
web/modals/threads/settings/thread-settings-relationship-tab.react.js
14–15 ↗(On Diff #15091)

These props aren't used. Shouldn't this give a warning?

30 ↗(On Diff #15091)

In ThreadSettingsRelationshipButton setErrorMessage is string => void but here we use SetState<string>. Is flow ok with that? Is there a good reason for having different types?

This revision now requires changes to proceed.Jul 29 2022, 5:55 AM
web/modals/threads/settings/thread-settings-relationship-tab.react.js
14–15 ↗(On Diff #15091)

Interesting. I thought flow should indicate warning for such variables.

30 ↗(On Diff #15091)

Flow is ok here. I'll replace the type in ...Button with SetState<string>

web/modals/threads/settings/thread-settings-relationship-tab.react.js
14–15 ↗(On Diff #15091)

There can be a good reason for having a prop that you never use: to force the component to rerender. For instance, we do something similar here

Disable buttons basing on loading status

tomek added inline comments.
web/modals/threads/settings/thread-settings-relationship-tab.react.js
15–17 ↗(On Diff #15102)

I think that this selector should be in the same file where we create the action. We can either, create an action here and pass it to the component, or select the state there. The reason is that these need to be in sync, and having them in the same file makes it more likely to keep them in sync.

This revision is now accepted and ready to land.Aug 1 2022, 6:45 AM

Move createLoadingStatusSelector into Button component & simplify sintax