Skip to content

Commit 7a2e970

Browse files
committed
issue #2158 - Toggle text area placeholder for New post thread expanded & collapsed.
1 parent 9f91f88 commit 7a2e970

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/components/Feed/NewPost.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class NewPost extends React.Component {
1313
}
1414

1515
render() {
16-
const {currentUser, allMembers, titlePlaceholder, contentPlaceholder, isCreating, hasError} = this.props
16+
const {currentUser, allMembers, titlePlaceholder, contentPlaceholder, isCreating, hasError, expandedTitlePlaceholder} = this.props
1717
let authorName = currentUser.firstName
1818
if (authorName && currentUser.lastName) {
1919
authorName += ' ' + currentUser.lastName
@@ -29,6 +29,7 @@ class NewPost extends React.Component {
2929
<RichTextArea
3030
className={composerClasses}
3131
titlePlaceholder={titlePlaceholder || 'Title of the post'}
32+
expandedTitlePlaceholder={expandedTitlePlaceholder || titlePlaceholder || 'Title of the post'}
3233
contentPlaceholder={contentPlaceholder || 'New reply...'}
3334
onPost={this.props.onPost}
3435
onPostChange={this.props.onNewPostChange}
@@ -44,6 +45,7 @@ class NewPost extends React.Component {
4445

4546

4647
NewPost.propTypes = {
48+
expandedTitlePlaceholder: PropTypes.string,
4749
currentUser: PropTypes.object.isRequired,
4850
allMembers: PropTypes.object.isRequired,
4951
onPost: PropTypes.func.isRequired,

src/components/RichTextArea/RichTextArea.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ class RichTextArea extends React.Component {
254254
render() {
255255
const {MentionSuggestions} = this.mentionPlugin
256256
const {className, avatarUrl, authorName, titlePlaceholder, contentPlaceholder, editMode, isCreating,
257-
isGettingComment, disableTitle, disableContent} = this.props
257+
isGettingComment, disableTitle, disableContent, expandedTitlePlaceholder} = this.props
258258
const {editorExpanded, editorState, titleValue, oldMDContent, currentMDContent, uploading} = this.state
259259
let canSubmit = (disableTitle || titleValue.trim())
260260
&& (disableContent || editorState.getCurrentContent().hasText())
@@ -311,7 +311,7 @@ class RichTextArea extends React.Component {
311311
className={cn('new-post-title', {'hide-title': disableTitle})}
312312
type="text"
313313
onChange={this.onTitleChange}
314-
placeholder={titlePlaceholder || 'Title of the post'}
314+
placeholder={editorExpanded ? expandedTitlePlaceholder : titlePlaceholder || 'Title of the post'}
315315
/>
316316
<div className="draftjs-editor tc-textarea">
317317
{!disableContent && !isGettingComment &&
@@ -415,6 +415,7 @@ class RichTextArea extends React.Component {
415415
}
416416

417417
RichTextArea.propTypes = {
418+
expandedTitlePlaceholder: PropTypes.string,
418419
onPost: PropTypes.func.isRequired,
419420
onPostChange: PropTypes.func.isRequired,
420421
cancelEdit: PropTypes.func,

src/projects/detail/containers/FeedContainer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ class FeedView extends React.Component {
415415
heading="NEW STATUS POST"
416416
onNewPostChange={this.onNewPostChange}
417417
titlePlaceholder="Start a new discussion"
418+
expandedTitlePlaceholder="Add your discussion title"
418419
contentPlaceholder="Add your first post"
419420
/>
420421
</MediaQuery>

0 commit comments

Comments
 (0)