Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3300602
D10315.id37159.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D10315.id37159.diff
View Options
diff --git a/web/modals/threads/notifications/notifications-modal.css b/web/modals/threads/notifications/notifications-modal.css
--- a/web/modals/threads/notifications/notifications-modal.css
+++ b/web/modals/threads/notifications/notifications-modal.css
@@ -2,7 +2,6 @@
display: flex;
flex-direction: column;
color: var(--fg);
- margin: 24px 32px;
row-gap: 20px;
min-width: 343px;
width: min-content;
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
@@ -218,8 +218,11 @@
);
}, [isSidebar, parentThreadInfo, threadInfo]);
+ const parentThreadIsInBackground =
+ isSidebar && !parentThreadInfo?.currentUser.subscription.home;
+
const modalContent = React.useMemo(() => {
- if (isSidebar && !parentThreadInfo?.currentUser.subscription.home) {
+ if (parentThreadIsInBackground) {
return (
<>
<p>
@@ -248,13 +251,6 @@
{focusedBadgeOnlyItem}
{backgroundItem}
</div>
- <Button
- variant="filled"
- onClick={onClickSave}
- disabled={notificationSettings === initialThreadSetting}
- >
- Save
- </Button>
{noticeText}
</>
);
@@ -262,17 +258,40 @@
backgroundItem,
focusedBadgeOnlyItem,
focusedItem,
- initialThreadSetting,
- isSidebar,
noticeText,
- notificationSettings,
- onClickSave,
parentThreadInfo,
+ parentThreadIsInBackground,
threadInfo,
]);
+ const saveButton = React.useMemo(() => {
+ if (parentThreadIsInBackground) {
+ return undefined;
+ }
+
+ return (
+ <Button
+ variant="filled"
+ onClick={onClickSave}
+ disabled={notificationSettings === initialThreadSetting}
+ >
+ Save
+ </Button>
+ );
+ }, [
+ initialThreadSetting,
+ notificationSettings,
+ onClickSave,
+ parentThreadIsInBackground,
+ ]);
+
return (
- <Modal name={modalName} size="fit-content" onClose={onClose}>
+ <Modal
+ name={modalName}
+ size="fit-content"
+ onClose={onClose}
+ primaryButton={saveButton}
+ >
<div className={css.container}>{modalContent}</div>
</Modal>
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 8:17 PM (21 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2535418
Default Alt Text
D10315.id37159.diff (2 KB)
Attached To
Mode
D10315: [web] cleanup thread notifications modal
Attached
Detach File
Event Timeline
Log In to Comment