Changeset View
Changeset View
Standalone View
Standalone View
web/chat/chat-input-bar.react.js
Show All 18 Lines | |||||
import { | import { | ||||
threadHasPermission, | threadHasPermission, | ||||
viewerIsMember, | viewerIsMember, | ||||
threadFrozenDueToViewerBlock, | threadFrozenDueToViewerBlock, | ||||
threadActualMembers, | threadActualMembers, | ||||
checkIfDefaultMembersAreVoiced, | checkIfDefaultMembersAreVoiced, | ||||
} from 'lib/shared/thread-utils'; | } from 'lib/shared/thread-utils'; | ||||
import { getTypeaheadUserSuggestions } from 'lib/shared/typeahead-utils'; | import { getTypeaheadUserSuggestions } from 'lib/shared/typeahead-utils'; | ||||
import type { TypeaheadMatchedStrings } from 'lib/shared/typeahead-utils'; | |||||
import type { CalendarQuery } from 'lib/types/entry-types'; | import type { CalendarQuery } from 'lib/types/entry-types'; | ||||
import type { LoadingStatus } from 'lib/types/loading-types'; | import type { LoadingStatus } from 'lib/types/loading-types'; | ||||
import { messageTypes } from 'lib/types/message-types'; | import { messageTypes } from 'lib/types/message-types'; | ||||
import { | import { | ||||
type ThreadInfo, | type ThreadInfo, | ||||
threadPermissions, | threadPermissions, | ||||
type ClientThreadJoinRequest, | type ClientThreadJoinRequest, | ||||
type ThreadJoinPayload, | type ThreadJoinPayload, | ||||
Show All 36 Lines | type Props = { | ||||
+userInfos: UserInfos, | +userInfos: UserInfos, | ||||
// Redux dispatch functions | // Redux dispatch functions | ||||
+dispatchActionPromise: DispatchActionPromise, | +dispatchActionPromise: DispatchActionPromise, | ||||
// async functions that hit server APIs | // async functions that hit server APIs | ||||
+joinThread: (request: ClientThreadJoinRequest) => Promise<ThreadJoinPayload>, | +joinThread: (request: ClientThreadJoinRequest) => Promise<ThreadJoinPayload>, | ||||
+typeaheadMatchedStrings: ?TypeaheadMatchedStrings, | +typeaheadMatchedStrings: ?TypeaheadMatchedStrings, | ||||
+suggestedUsers: $ReadOnlyArray<RelativeMemberInfo>, | +suggestedUsers: $ReadOnlyArray<RelativeMemberInfo>, | ||||
}; | }; | ||||
export type TypeaheadMatchedStrings = { | |||||
+textBeforeAtSymbol: string, | |||||
+usernamePrefix: string, | |||||
}; | |||||
class ChatInputBar extends React.PureComponent<Props> { | class ChatInputBar extends React.PureComponent<Props> { | ||||
textarea: ?HTMLTextAreaElement; | textarea: ?HTMLTextAreaElement; | ||||
multimediaInput: ?HTMLInputElement; | multimediaInput: ?HTMLInputElement; | ||||
componentDidMount() { | componentDidMount() { | ||||
this.updateHeight(); | this.updateHeight(); | ||||
if (this.props.isThreadActive) { | if (this.props.isThreadActive) { | ||||
this.addReplyListener(); | this.addReplyListener(); | ||||
▲ Show 20 Lines • Show All 550 Lines • Show Last 20 Lines |