Page MenuHomePhabricator

D13721.diff
No OneTemporary

D13721.diff

diff --git a/lib/shared/thread-settings-notifications-utils.js b/lib/shared/thread-settings-notifications-utils.js
--- a/lib/shared/thread-settings-notifications-utils.js
+++ b/lib/shared/thread-settings-notifications-utils.js
@@ -27,32 +27,6 @@
MUTED: 'Muted',
SIDEBAR_TITLE: 'Thread notifications',
CHANNEL_TITLE: 'Channel notifications',
- IS_SIDEBAR:
- 'It’s not possible to move this thread to Muted. ' +
- 'That’s because Comm’s design always shows threads ' +
- 'underneath their parent in the Inbox, which means ' +
- 'that if a thread’s parent is in Home, the thread ' +
- 'must also be there.',
- IS_SIDEBAR_CAN_PROMOTE:
- 'If you want to move this thread to Muted, ' +
- 'you can either move the parent to Muted, ' +
- 'or you can promote the thread to a channel.',
- IS_SIDEBAR_CAN_NOT_PROMOTE:
- 'If you want to move this thread to Muted, ' +
- 'you’ll have to move the parent to Muted.',
- PARENT_THREAD_IS_MUTED:
- 'It’s not possible to change the notif settings for a thread ' +
- 'whose parent is in Muted. That’s because Comm’s design ' +
- 'always shows threads underneath their parent in the Inbox, ' +
- 'which means that if a thread’s parent is in Muted, the ' +
- 'thread must also be there.',
- PARENT_THREAD_IS_MUTED_CAN_PROMOTE:
- 'If you want to change the notif settings for this thread, ' +
- 'you can either change the notif settings for the parent, ' +
- 'or you can promote the thread to a channel.',
- PARENT_THREAD_IS_MUTED_CAN_NOT_PROMOTE:
- 'If you want to change the notif settings for this thread, ' +
- 'you’ll have to change the notif settings for the parent.',
};
const updateSubscriptionLoadingStatusSelector = createLoadingStatusSelector(
diff --git a/native/chat/settings/thread-settings-notifications.react.js b/native/chat/settings/thread-settings-notifications.react.js
--- a/native/chat/settings/thread-settings-notifications.react.js
+++ b/native/chat/settings/thread-settings-notifications.react.js
@@ -147,23 +147,19 @@
onMutedSelected,
saveButtonDisabled,
onSave,
- isSidebar,
- canPromoteSidebar,
- parentThreadIsMuted,
} = useThreadSettingsNotifications(threadInfo, goBack);
React.useEffect(() => {
setOptions({
- headerRight: () =>
- parentThreadIsMuted ? null : (
- <HeaderRightTextButton
- label="Save"
- onPress={onSave}
- disabled={saveButtonDisabled}
- />
- ),
+ headerRight: () => (
+ <HeaderRightTextButton
+ label="Save"
+ onPress={onSave}
+ disabled={saveButtonDisabled}
+ />
+ ),
});
- }, [saveButtonDisabled, onSave, setOptions, parentThreadIsMuted]);
+ }, [saveButtonDisabled, onSave, setOptions]);
const styles = useStyles(unboundStyles);
@@ -230,46 +226,7 @@
[notificationSettings],
);
- const noticeText = React.useMemo(() => {
- if (!isSidebar) {
- return null;
- }
-
- return (
- <View style={styles.noticeTextContainer}>
- <Text style={styles.noticeText}>
- {threadSettingsNotificationsCopy.IS_SIDEBAR}
- </Text>
- <Text style={styles.noticeText}>
- {canPromoteSidebar
- ? threadSettingsNotificationsCopy.IS_SIDEBAR_CAN_PROMOTE
- : threadSettingsNotificationsCopy.IS_SIDEBAR_CAN_NOT_PROMOTE}
- </Text>
- </View>
- );
- }, [
- canPromoteSidebar,
- isSidebar,
- styles.noticeText,
- styles.noticeTextContainer,
- ]);
-
const threadSettingsNotifications = React.useMemo(() => {
- if (parentThreadIsMuted) {
- return (
- <View style={styles.parentThreadIsMutedNoticeContainerStyle}>
- <Text style={styles.parentThreadIsMutedNoticeText}>
- {threadSettingsNotificationsCopy.PARENT_THREAD_IS_MUTED}
- </Text>
- <Text style={styles.parentThreadIsMutedNoticeText}>
- {canPromoteSidebar
- ? threadSettingsNotificationsCopy.PARENT_THREAD_IS_MUTED_CAN_PROMOTE
- : threadSettingsNotificationsCopy.PARENT_THREAD_IS_MUTED_CAN_NOT_PROMOTE}
- </Text>
- </View>
- );
- }
-
return (
<View style={styles.container}>
<View style={styles.enumSettingsOptionContainer}>
@@ -297,18 +254,13 @@
onEnumValuePress={onMutedSelected}
description={mutedDescription}
icon={mutedIllustration}
- disabled={isSidebar}
/>
</View>
- {noticeText}
</View>
);
}, [
- parentThreadIsMuted,
styles.container,
styles.enumSettingsOptionContainer,
- styles.parentThreadIsMutedNoticeContainerStyle,
- styles.parentThreadIsMutedNoticeText,
notificationSettings,
onHomeSelected,
allNotificationsDescription,
@@ -319,9 +271,6 @@
onMutedSelected,
mutedDescription,
mutedIllustration,
- isSidebar,
- noticeText,
- canPromoteSidebar,
]);
return threadSettingsNotifications;
@@ -367,18 +316,6 @@
lineHeight: 18,
marginVertical: 8,
},
- parentThreadIsMutedNoticeContainerStyle: {
- backgroundColor: 'panelForeground',
- paddingHorizontal: 16,
- paddingVertical: 8,
- },
- parentThreadIsMutedNoticeText: {
- color: 'panelForegroundSecondaryLabel',
- fontSize: 16,
- lineHeight: 20,
- textAlign: 'left',
- marginVertical: 8,
- },
};
export default ThreadSettingsNotifications;
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
@@ -87,8 +87,6 @@
saveButtonDisabled,
onSave,
isSidebar,
- canPromoteSidebar,
- parentThreadIsMuted,
} = useThreadSettingsNotifications(threadInfo, onClose);
const isHomeSelected = notificationSettings === 'home';
@@ -128,51 +126,16 @@
title={threadSettingsNotificationsCopy.MUTED}
statements={mutedStatements}
icon={icon}
- disabled={isSidebar}
onSelect={onMutedSelected}
/>
);
- }, [isMutedSelected, onMutedSelected, isSidebar]);
+ }, [isMutedSelected, onMutedSelected]);
const modalName = isSidebar
? threadSettingsNotificationsCopy.SIDEBAR_TITLE
: threadSettingsNotificationsCopy.CHANNEL_TITLE;
- const noticeText = React.useMemo(() => {
- if (!isSidebar) {
- return null;
- }
-
- return (
- <>
- <p className={css.notice}>
- {threadSettingsNotificationsCopy.IS_SIDEBAR}
- </p>
- <p className={css.notice}>
- {canPromoteSidebar
- ? threadSettingsNotificationsCopy.IS_SIDEBAR_CAN_PROMOTE
- : threadSettingsNotificationsCopy.IS_SIDEBAR_CAN_NOT_PROMOTE}
- </p>
- </>
- );
- }, [isSidebar, canPromoteSidebar]);
-
const modalContent = React.useMemo(() => {
- if (parentThreadIsMuted) {
- return (
- <>
- <p className={css.parentThreadIsInBackgroundNotice}>
- {threadSettingsNotificationsCopy.PARENT_THREAD_IS_MUTED}
- </p>
- <p className={css.parentThreadIsInBackgroundNotice}>
- {canPromoteSidebar
- ? threadSettingsNotificationsCopy.PARENT_THREAD_IS_MUTED_CAN_PROMOTE
- : threadSettingsNotificationsCopy.PARENT_THREAD_IS_MUTED_CAN_NOT_PROMOTE}
- </p>
- </>
- );
- }
-
return (
<>
<div className={css.optionsContainer}>
@@ -180,29 +143,17 @@
{notifCountOnlyItem}
{backgroundItem}
</div>
- {noticeText}
</>
);
- }, [
- parentThreadIsMuted,
- homeItem,
- notifCountOnlyItem,
- backgroundItem,
- noticeText,
- canPromoteSidebar,
- ]);
+ }, [homeItem, notifCountOnlyItem, backgroundItem]);
const saveButton = React.useMemo(() => {
- if (parentThreadIsMuted) {
- return undefined;
- }
-
return (
<Button variant="filled" onClick={onSave} disabled={saveButtonDisabled}>
Save
</Button>
);
- }, [parentThreadIsMuted, onSave, saveButtonDisabled]);
+ }, [onSave, saveButtonDisabled]);
return (
<Modal

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 3:44 PM (17 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2562471
Default Alt Text
D13721.diff (8 KB)

Event Timeline