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) => void, +changeThreadSettingsAction: () => Promise, +onSubmit: (event: SyntheticEvent) => void, + +mainContent: ?React.Node, +buttons: ?React.Node, +tabs: ?React.Node, }; @@ -123,50 +124,12 @@ } render() { - const { threadInfo } = this.props; - const inputDisabled = - this.props.changeInProgress || - !this.props.hasPermissionForTab(threadInfo, this.props.currentTabType); - - let mainContent = null; - if (this.props.currentTabType === 'general') { - mainContent = ( - - ); - } else if (this.props.currentTabType === 'privacy') { - mainContent = ( - - ); - } else if (this.props.currentTabType === 'delete') { - mainContent = ( - - ); - } - return (
    {this.props.tabs}
- {mainContent} + {this.props.mainContent}
{this.props.buttons}
@@ -398,6 +361,47 @@ const inputDisabled = changeInProgress || !hasPermissionForTab(threadInfo, currentTabType); + let mainContent; + if (currentTabType === 'general') { + mainContent = ( + + ); + } else if (currentTabType === 'privacy') { + mainContent = ( + + ); + } else if (currentTabType === 'delete') { + mainContent = ( + + ); + } + let buttons; if (currentTabType === 'delete') { buttons = ( @@ -494,6 +498,7 @@ onDelete={onDelete} changeThreadSettingsAction={changeThreadSettingsAction} onSubmit={onSubmit} + mainContent={mainContent} buttons={buttons} tabs={tabs} />