diff --git a/web/modals/threads/new-thread-modal.react.js b/web/modals/threads/new-thread-modal.react.js deleted file mode 100644 --- a/web/modals/threads/new-thread-modal.react.js +++ /dev/null @@ -1,318 +0,0 @@ -// @flow - -import invariant from 'invariant'; -import * as React from 'react'; - -import { newThreadActionTypes, newThread } from 'lib/actions/thread-actions'; -import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors'; -import { threadInfoSelector } from 'lib/selectors/thread-selectors'; -import { - generateRandomColor, - threadTypeDescriptions, -} from 'lib/shared/thread-utils'; -import type { CalendarQuery } from 'lib/types/entry-types'; -import { - type ThreadInfo, - threadTypes, - assertThreadType, - type ThreadType, - type ClientNewThreadRequest, - type NewThreadResult, -} from 'lib/types/thread-types'; -import { - type DispatchActionPromise, - useDispatchActionPromise, - useServerCall, -} from 'lib/utils/action-utils'; -import { firstLine } from 'lib/utils/string-utils'; - -import Button from '../../components/button.react'; -import { useSelector } from '../../redux/redux-utils'; -import { nonThreadCalendarQuery } from '../../selectors/nav-selectors'; -import css from '../../style.css'; -import Modal from '../modal.react'; -import ColorPicker from './color-picker.react'; - -type BaseProps = { - +onClose: () => void, - +parentThreadID?: ?string, -}; -type Props = { - ...BaseProps, - +inputDisabled: boolean, - +calendarQuery: () => CalendarQuery, - +parentThreadInfo: ?ThreadInfo, - +dispatchActionPromise: DispatchActionPromise, - +newThread: (request: ClientNewThreadRequest) => Promise, -}; -type State = { - +threadType: ?ThreadType, - +name: string, - +description: string, - +color: string, - +errorMessage: string, -}; - -const { COMMUNITY_OPEN_SUBTHREAD, COMMUNITY_SECRET_SUBTHREAD } = threadTypes; - -class NewThreadModal extends React.PureComponent { - nameInput: ?HTMLInputElement; - openPrivacyInput: ?HTMLInputElement; - threadPasswordInput: ?HTMLInputElement; - - constructor(props: Props) { - super(props); - this.state = { - threadType: props.parentThreadID ? undefined : COMMUNITY_SECRET_SUBTHREAD, - name: '', - description: '', - color: props.parentThreadInfo - ? props.parentThreadInfo.color - : generateRandomColor(), - errorMessage: '', - }; - } - - componentDidMount() { - invariant(this.nameInput, 'nameInput ref unset'); - this.nameInput.focus(); - } - - render() { - let threadTypeSection = null; - if (this.props.parentThreadID) { - threadTypeSection = ( -
-
-
Chat type
-
-
- -
- -
-
-
- -
- -
-
-
-
-
- ); - } - return ( - -
-
-
-
Chat name
-
- -
-
-
-
Description
-
-