Page MenuHomePhabricator

D3823.id11959.diff
No OneTemporary

D3823.id11959.diff

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

Mime Type
text/plain
Expires
Fri, Nov 8, 10:16 PM (20 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2446490
Default Alt Text
D3823.id11959.diff (2 KB)

Event Timeline