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 @@ -13,22 +13,16 @@ import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors'; import { threadInfoSelector } from 'lib/selectors/thread-selectors'; import { threadHasPermission, robotextName } from 'lib/shared/thread-utils'; -import { type SetState } from 'lib/types/hook-types.js'; import { type ThreadInfo, threadTypes, assertThreadType, - type ChangeThreadSettingsPayload, - type UpdateThreadRequest, - type LeaveThreadPayload, threadPermissions, type ThreadChanges, } from 'lib/types/thread-types'; -import type { UserInfos } from 'lib/types/user-types'; import { useDispatchActionPromise, useServerCall, - type DispatchActionPromise, } from 'lib/utils/action-utils'; import { firstLine } from 'lib/utils/string-utils'; @@ -70,78 +64,6 @@ type BaseProps = { +threadID: string, }; -type Props = { - ...BaseProps, - +threadInfo: ThreadInfo, - +changeInProgress: boolean, - +viewerID: ?string, - +userInfos: UserInfos, - +dispatchActionPromise: DispatchActionPromise, - +deleteThread: ( - threadID: string, - currentAccountPassword: string, - ) => Promise, - +changeThreadSettings: ( - update: UpdateThreadRequest, - ) => Promise, - +onClose: () => void, - +errorMessage: string, - +setErrorMessage: SetState, - +accountPassword: string, - +setAccountPassword: SetState, - +currentTabType: TabType, - +setCurrentTabType: SetState, - +queuedChanges: ThreadChanges, - +setQueuedChanges: SetState, - +namePlaceholder: string, - +changeQueued: boolean, - +onChangeName: (event: SyntheticEvent) => void, - +onChangeDescription: (event: SyntheticEvent) => void, - +onChangeColor: (color: string) => void, - +onChangeThreadType: (event: SyntheticEvent) => void, - +onChangeAccountPassword: (event: SyntheticEvent) => void, - +hasPermissionForTab: (thread: ThreadInfo, tab: TabType) => boolean, - +deleteThreadAction: () => Promise, - +onDelete: (event: SyntheticEvent) => void, - +changeThreadSettingsAction: () => Promise, - +onSubmit: (event: SyntheticEvent) => void, - +mainContent: ?React.Node, - +buttons: ?React.Node, - +tabs: ?React.Node, -}; -class ThreadSettingsModal extends React.PureComponent { - constructor(props: Props) { - super(props); - } - - possiblyChangedValue(key: string) { - const valueChanged = - this.props.queuedChanges[key] !== null && - this.props.queuedChanges[key] !== undefined; - return valueChanged - ? this.props.queuedChanges[key] - : this.props.threadInfo[key]; - } - - render() { - return ( - -
    {this.props.tabs}
-
-
- {this.props.mainContent} -
- {this.props.buttons} -
- {this.props.errorMessage} -
-
-
-
-
- ); - } -} const deleteThreadLoadingStatusSelector = createLoadingStatusSelector( deleteThreadActionTypes, @@ -468,40 +390,18 @@ } return ( - + +
    {tabs}
+
+
+ {mainContent} +
+ {buttons} +
{errorMessage}
+
+
+
+
); }, );