Page MenuHomePhabricator

D4048.diff
No OneTemporary

D4048.diff

diff --git a/web/modals/threads/notifications/enum-settings-option.react.js b/web/modals/threads/notifications/enum-settings-option.react.js
--- a/web/modals/threads/notifications/enum-settings-option.react.js
+++ b/web/modals/threads/notifications/enum-settings-option.react.js
@@ -12,20 +12,23 @@
+onSelect: () => void,
+icon: React.Node,
+title: string,
- +description: $ReadOnlyArray<[string, boolean]>,
+ +statements: $ReadOnlyArray<{
+ +statement: string,
+ +isStatementValid: boolean,
+ }>,
};
function EnumSettingsOption(props: Props): React.Node {
- const { icon, title, description, selected, onSelect } = props;
+ const { icon, title, statements, selected, onSelect } = props;
const descriptionItems = React.useMemo(
() =>
- description.map(([text, isValid]) => (
- <EnumSettingsOptionInfo key={text} valid={isValid}>
- {text}
+ statements.map(({ statement, isStatementValid }) => (
+ <EnumSettingsOptionInfo key={statement} valid={isStatementValid}>
+ {statement}
</EnumSettingsOptionInfo>
)),
- [description],
+ [statements],
);
const optionContainerClasses = React.useMemo(
diff --git a/web/modals/threads/notifications/notifications-modal.react.js b/web/modals/threads/notifications/notifications-modal.react.js
--- a/web/modals/threads/notifications/notifications-modal.react.js
+++ b/web/modals/threads/notifications/notifications-modal.react.js
@@ -72,10 +72,10 @@
const isFocusedSelected = notificationSettings === 'focused';
const focusedItem = React.useMemo(() => {
- const description = [
- ['Banner notifs', true],
- ['Badge count', true],
- ['Lives in Focused tab', true],
+ const statements = [
+ { statement: 'Banner notifs', isStatementValid: true },
+ { statement: 'Badge count', isStatementValid: true },
+ { statement: 'Lives in Focused tab', isStatementValid: true },
];
const icon = (
<img
@@ -88,7 +88,7 @@
<EnumSettingsOption
selected={isFocusedSelected}
title="Focused (enabled)"
- description={description}
+ statements={statements}
icon={icon}
onSelect={onFocusedSelected}
/>
@@ -97,10 +97,10 @@
const isFocusedBadgeOnlySelected = notificationSettings === 'badge-only';
const focusedBadgeOnlyItem = React.useMemo(() => {
- const description = [
- ['Banner notifs', false],
- ['Badge count', true],
- ['Lives in Focused tab', true],
+ const statements = [
+ { statement: 'Banner notifs', isStatementValid: false },
+ { statement: 'Badge count', isStatementValid: true },
+ { statement: 'Lives in Focused tab', isStatementValid: true },
];
const icon = (
<img
@@ -113,7 +113,7 @@
<EnumSettingsOption
selected={isFocusedBadgeOnlySelected}
title="Focused (badge only)"
- description={description}
+ statements={statements}
icon={icon}
onSelect={onBadgeOnlySelected}
/>
@@ -122,10 +122,10 @@
const isBackgroundSelected = notificationSettings === 'background';
const backgroundItem = React.useMemo(() => {
- const description = [
- ['Banner notifs', false],
- ['Badge count', false],
- ['Lives in Backgound tab', true],
+ const statements = [
+ { statement: 'Banner notifs', isStatementValid: false },
+ { statement: 'Badge count', isStatementValid: false },
+ { statement: 'Lives in Background tab', isStatementValid: true },
];
const icon = (
<img
@@ -138,7 +138,7 @@
<EnumSettingsOption
selected={isBackgroundSelected}
title="Background"
- description={description}
+ statements={statements}
icon={icon}
onSelect={onBackgroundSelected}
/>

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 12:46 AM (22 h, 26 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2581818
Default Alt Text
D4048.diff (3 KB)

Event Timeline