Page MenuHomePhabricator

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

Authored by atul on May 24 2022, 8:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 7, 8:49 PM
Unknown Object (File)
Nov 23 2024, 5:23 PM
Unknown Object (File)
Nov 23 2024, 4:44 PM
Unknown Object (File)
Nov 23 2024, 4:27 PM
Unknown Object (File)
Nov 23 2024, 2:41 PM
Unknown Object (File)
Nov 16 2024, 8:48 PM
Unknown Object (File)
Nov 14 2024, 4:38 PM
Unknown Object (File)
Nov 14 2024, 4:38 PM

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 ↗(On Diff #13082)

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.