Page MenuHomePhabricator

[web] Introduce `styleStatementBasedOnValidity` to `EnumSettingsOptionInfo`
ClosedPublic

Authored by atul on May 24 2022, 8:10 AM.
Tags
None
Referenced Files
F3355585: D4116.diff
Sat, Nov 23, 2:41 PM
Unknown Object (File)
Sat, Nov 16, 8:48 PM
Unknown Object (File)
Thu, Nov 14, 4:38 PM
Unknown Object (File)
Thu, Nov 14, 4:38 PM
Unknown Object (File)
Sat, Nov 9, 2:36 PM
Unknown Object (File)
Sat, Nov 9, 12:41 PM
Unknown Object (File)
Sat, Nov 9, 12:28 PM
Unknown Object (File)
Sat, Nov 9, 10:18 AM

Details

Summary

We introduce the styleStatementBasedOnValidity prop to EnumSettingsOptionInfo so we can re-use the EnumSettingsOption and EnumSettingsOptionInfo component for both the NotificationsModal (which indicates whether statements are factual) and the ThreadSettingsPrivacyTab of the ThreadSettingsModal (which doesn't style statements based on whether they're true or false.. because they're all true).

This diff replaces D4047 which was more brittle and depended on the valid prop being optional. We were essentially trying to encode three different states into a boolean which was hacky. We decided that instead we should introduce a new prop that explicitly determines whether a statement is styled or not.

Test Plan

Here's how the NotificationsModal looks:

4005.png (1×852 px, 97 KB)

Here's how the ThreadSettingsPrivacyTab looks:

30ce.png (986×700 px, 68 KB)

Diff Detail

Repository
rCOMM Comm
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul requested review of this revision.May 24 2022, 8:16 AM
tomek added inline comments.
web/components/enum-settings-option-info.react.js
37

I think we usually use null when a component is not present

This revision is now accepted and ready to land.May 25 2022, 3:47 AM
This revision was landed with ongoing or failed builds.May 25 2022, 8:08 AM
This revision was automatically updated to reflect the committed changes.