diff --git a/webapp/channels/src/components/advanced_create_comment/advanced_create_comment.tsx b/webapp/channels/src/components/advanced_create_comment/advanced_create_comment.tsx index c8cc8bf8f2..bdf16ef47f 100644 --- a/webapp/channels/src/components/advanced_create_comment/advanced_create_comment.tsx +++ b/webapp/channels/src/components/advanced_create_comment/advanced_create_comment.tsx @@ -198,6 +198,7 @@ export type Props = { isFormattingBarHidden: boolean; searchAssociatedGroupsForReference: (prefix: string, teamId: string, channelId: string | undefined) => Promise<{ data: any }>; postEditorActions: PluginComponent[]; + placeholder?: string; } type State = { @@ -1311,6 +1312,7 @@ class AdvancedCreateComment extends React.PureComponent { fileUploadRef={this.fileUploadRef} isThreadView={this.props.isThreadView} additionalControls={pluginItems.filter(Boolean)} + placeholder={this.props.placeholder} /> ); diff --git a/webapp/channels/src/components/advanced_text_editor/advanced_text_editor.tsx b/webapp/channels/src/components/advanced_text_editor/advanced_text_editor.tsx index 439fb2e4e4..34d226038b 100644 --- a/webapp/channels/src/components/advanced_text_editor/advanced_text_editor.tsx +++ b/webapp/channels/src/components/advanced_text_editor/advanced_text_editor.tsx @@ -101,6 +101,7 @@ type Props = { additionalControls?: React.ReactNodeArray; labels?: React.ReactNode; disableSend?: boolean; + placeholder?: string; } const AdvanceTextEditor = ({ @@ -156,6 +157,7 @@ const AdvanceTextEditor = ({ additionalControls, labels, disableSend = false, + placeholder, }: Props) => { const readOnlyChannel = !canPost; const {formatMessage} = useIntl(); @@ -295,7 +297,9 @@ const AdvanceTextEditor = ({ ); let createMessage; - if (currentChannel && !readOnlyChannel) { + if (placeholder) { + createMessage = placeholder; + } else if (currentChannel && !readOnlyChannel) { createMessage = formatMessage( { id: 'create_post.write', diff --git a/webapp/channels/src/components/threading/thread_viewer/thread_viewer.tsx b/webapp/channels/src/components/threading/thread_viewer/thread_viewer.tsx index 53b16ed20d..bca19f239a 100644 --- a/webapp/channels/src/components/threading/thread_viewer/thread_viewer.tsx +++ b/webapp/channels/src/components/threading/thread_viewer/thread_viewer.tsx @@ -48,6 +48,7 @@ export type Props = Attrs & { highlightedPostId?: Post['id']; selectedPostFocusedAt?: number; isThreadView?: boolean; + inputPlaceholder?: string; }; type State = { @@ -212,6 +213,7 @@ export default class ThreadViewer extends React.PureComponent { {this.props.selected && ( (({ @@ -34,6 +35,7 @@ const CreateComment = forwardRef(({ threadId, latestPostId, isThreadView, + placeholder, }: Props, ref) => { const getChannel = useMemo(makeGetChannel, []); const rootPost = useSelector((state: GlobalState) => getPost(state, threadId)); @@ -95,6 +97,7 @@ const CreateComment = forwardRef(({ data-testid='comment-create' > { if (isCreateComment(itemId)) { return ( void; +} + +const ExportedCreatePost = ({placeholder, onSubmit}: Props) => { + const Component = AdvancedCreateComment as any; + + return ( + null} + updateCommentDraftWithRootId={() => null} + onMoveHistoryIndexBack={() => null} + onMoveHistoryIndexForward={() => null} + onEditLatestPost={() => ({data: true})} + /> + ); +}; + +export default ExportedCreatePost;