diff --git a/web/modals/threads/settings/thread-settings-delete-button.react.js b/web/modals/threads/settings/thread-settings-delete-button.react.js new file mode 100644 --- /dev/null +++ b/web/modals/threads/settings/thread-settings-delete-button.react.js @@ -0,0 +1,43 @@ +// @flow + +import * as React from 'react'; + +import type { SetState } from 'lib/types/hook-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; + +import { useOnDeleteThread } from './thread-settings-utils.js'; +import Button, { buttonThemes } from '../../../components/button.react.js'; + +type Props = { + +threadInfo: ThreadInfo, + +threadSettingsOperationInProgress: boolean, + +setErrorMessage: SetState, +}; + +function ThreadSettingsDeleteButton(props: Props): React.Node { + const { threadInfo, threadSettingsOperationInProgress, setErrorMessage } = + props; + + const onDeleteThread = useOnDeleteThread({ + threadInfo: threadInfo, + setErrorMessage, + }); + + const threadSettingsDeleteButton = React.useMemo( + () => ( + + ), + [onDeleteThread, threadSettingsOperationInProgress], + ); + + return threadSettingsDeleteButton; +} + +export default ThreadSettingsDeleteButton; diff --git a/web/modals/threads/settings/thread-settings-delete-tab.css b/web/modals/threads/settings/thread-settings-delete-tab.css --- a/web/modals/threads/settings/thread-settings-delete-tab.css +++ b/web/modals/threads/settings/thread-settings-delete-tab.css @@ -1,9 +1,3 @@ -form.container { - display: flex; - flex-direction: column; - flex: 1; -} - div.warning_container { display: flex; flex-direction: row; diff --git a/web/modals/threads/settings/thread-settings-delete-tab.react.js b/web/modals/threads/settings/thread-settings-delete-tab.react.js --- a/web/modals/threads/settings/thread-settings-delete-tab.react.js +++ b/web/modals/threads/settings/thread-settings-delete-tab.react.js @@ -3,61 +3,21 @@ import * as React from 'react'; import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; -import { type SetState } from 'lib/types/hook-types.js'; -import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import SubmitSection from './submit-section.react.js'; import css from './thread-settings-delete-tab.css'; -import { useOnDeleteThread } from './thread-settings-utils.js'; -import { buttonThemes } from '../../../components/button.react.js'; - -type ThreadSettingsDeleteTabProps = { - +threadSettingsOperationInProgress: boolean, - +threadInfo: ThreadInfo, - +setErrorMessage: SetState, - +errorMessage?: ?string, -}; - -function ThreadSettingsDeleteTab( - props: ThreadSettingsDeleteTabProps, -): React.Node { - const { - threadSettingsOperationInProgress, - threadInfo, - setErrorMessage, - errorMessage, - } = props; - - const onDeleteThread = useOnDeleteThread({ - threadInfo, - setErrorMessage, - }); +function ThreadSettingsDeleteTab(): React.Node { return ( -
++ Your chat will be permanently deleted. There is no way to reverse this. +
+