Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3391115
D3823.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
D3823.diff
View Options
diff --git a/web/modals/threads/thread-settings-modal.react.js b/web/modals/threads/thread-settings-modal.react.js
--- a/web/modals/threads/thread-settings-modal.react.js
+++ b/web/modals/threads/thread-settings-modal.react.js
@@ -105,6 +105,7 @@
+onDelete: (event: SyntheticEvent<HTMLElement>) => void,
+changeThreadSettingsAction: () => Promise<ChangeThreadSettingsPayload>,
+onSubmit: (event: SyntheticEvent<HTMLElement>) => void,
+ +buttons: ?React.Node,
};
class ThreadSettingsModal extends React.PureComponent<Props> {
constructor(props: Props) {
@@ -159,30 +160,6 @@
);
}
- let buttons = null;
- if (this.props.currentTabType === 'delete') {
- buttons = (
- <Button
- onClick={this.props.onDelete}
- variant="danger"
- disabled={inputDisabled}
- >
- Delete
- </Button>
- );
- } else {
- buttons = (
- <Button
- type="submit"
- onClick={this.props.onSubmit}
- disabled={inputDisabled || !this.props.changeQueued}
- className={css.save_button}
- >
- Save
- </Button>
- );
- }
-
const tabs = [
<Tab
name="General"
@@ -237,7 +214,7 @@
<form method="POST">
{mainContent}
<div className={css.form_footer}>
- {buttons}
+ {this.props.buttons}
<div className={css.modal_form_error}>
{this.props.errorMessage}
</div>
@@ -464,6 +441,29 @@
);
}
+ const inputDisabled =
+ changeInProgress || !hasPermissionForTab(threadInfo, currentTabType);
+
+ let buttons;
+ if (currentTabType === 'delete') {
+ buttons = (
+ <Button onClick={onDelete} variant="danger" disabled={inputDisabled}>
+ Delete
+ </Button>
+ );
+ } else {
+ buttons = (
+ <Button
+ type="submit"
+ onClick={onSubmit}
+ disabled={inputDisabled || !changeQueued}
+ className={css.save_button}
+ >
+ Save
+ </Button>
+ );
+ }
+
return (
<ThreadSettingsModal
{...props}
@@ -495,6 +495,7 @@
onDelete={onDelete}
changeThreadSettingsAction={changeThreadSettingsAction}
onSubmit={onSubmit}
+ buttons={buttons}
/>
);
},
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 1, 2:22 AM (21 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2599946
Default Alt Text
D3823.diff (2 KB)
Attached To
Mode
D3823: [web] Lift `buttons: React.Node` from `ThreadSettingsModal` to `ConnectedThreadSettingsModal`
Attached
Detach File
Event Timeline
Log In to Comment