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 : ( - - ), + headerRight: () => ( + + ), }); - }, [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 ( - - - {threadSettingsNotificationsCopy.IS_SIDEBAR} - - - {canPromoteSidebar - ? threadSettingsNotificationsCopy.IS_SIDEBAR_CAN_PROMOTE - : threadSettingsNotificationsCopy.IS_SIDEBAR_CAN_NOT_PROMOTE} - - - ); - }, [ - canPromoteSidebar, - isSidebar, - styles.noticeText, - styles.noticeTextContainer, - ]); - const threadSettingsNotifications = React.useMemo(() => { - if (parentThreadIsMuted) { - return ( - - - {threadSettingsNotificationsCopy.PARENT_THREAD_IS_MUTED} - - - {canPromoteSidebar - ? threadSettingsNotificationsCopy.PARENT_THREAD_IS_MUTED_CAN_PROMOTE - : threadSettingsNotificationsCopy.PARENT_THREAD_IS_MUTED_CAN_NOT_PROMOTE} - - - ); - } - return ( @@ -297,18 +254,13 @@ onEnumValuePress={onMutedSelected} description={mutedDescription} icon={mutedIllustration} - disabled={isSidebar} /> - {noticeText} ); }, [ - 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 ( - <> -

- {threadSettingsNotificationsCopy.IS_SIDEBAR} -

-

- {canPromoteSidebar - ? threadSettingsNotificationsCopy.IS_SIDEBAR_CAN_PROMOTE - : threadSettingsNotificationsCopy.IS_SIDEBAR_CAN_NOT_PROMOTE} -

- - ); - }, [isSidebar, canPromoteSidebar]); - const modalContent = React.useMemo(() => { - if (parentThreadIsMuted) { - return ( - <> -

- {threadSettingsNotificationsCopy.PARENT_THREAD_IS_MUTED} -

-

- {canPromoteSidebar - ? threadSettingsNotificationsCopy.PARENT_THREAD_IS_MUTED_CAN_PROMOTE - : threadSettingsNotificationsCopy.PARENT_THREAD_IS_MUTED_CAN_NOT_PROMOTE} -

- - ); - } - return ( <>
@@ -180,29 +143,17 @@ {notifCountOnlyItem} {backgroundItem}
- {noticeText} ); - }, [ - parentThreadIsMuted, - homeItem, - notifCountOnlyItem, - backgroundItem, - noticeText, - canPromoteSidebar, - ]); + }, [homeItem, notifCountOnlyItem, backgroundItem]); const saveButton = React.useMemo(() => { - if (parentThreadIsMuted) { - return undefined; - } - return ( ); - }, [parentThreadIsMuted, onSave, saveButtonDisabled]); + }, [onSave, saveButtonDisabled]); return (