Skip to content

Commit 6c5ecd1

Browse files
committed
Git#2193-Changing button text properly wrt action fixed.
1 parent 64b58ad commit 6c5ecd1

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/components/ActionCard/Comment.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class Comment extends React.Component {
8080
authorName={authorName}
8181
cancelEdit={this.cancelEdit}
8282
allMembers={allMembers}
83+
editingTopic = {false}
8384
/>
8485
</div>
8586
)

src/components/Feed/Feed.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class Feed extends React.Component {
7070
hasError={error}
7171
cancelEdit={this.cancelEditTopic}
7272
disableContent
73+
editingTopic = {editTopicMode}
7374
/>
7475
</div>
7576
) : (

src/components/RichTextArea/RichTextArea.jsx

Lines changed: 4 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, expandedTitlePlaceholder} = this.props
257+
isGettingComment, disableTitle, disableContent, expandedTitlePlaceholder, editingTopic } = this.props
258258
const {editorExpanded, editorState, titleValue, oldMDContent, currentMDContent, uploading} = this.state
259259
let canSubmit = (disableTitle || titleValue.trim())
260260
&& (disableContent || editorState.getCurrentContent().hasText())
@@ -265,6 +265,7 @@ class RichTextArea extends React.Component {
265265
const blockType = RichUtils.getCurrentBlockType(editorState)
266266
const currentEntity = getCurrentEntity(editorState)
267267
const disableForCodeBlock = blockType === 'code-block'
268+
const editButtonText = editingTopic ? 'Update title' : 'Update post'
268269

269270
const Entry = (props) => {
270271
const {
@@ -395,7 +396,7 @@ class RichTextArea extends React.Component {
395396
}
396397
{ editMode &&
397398
<button className="tc-btn tc-btn-primary tc-btn-sm" onClick={this.onPost} disabled={!canSubmit }>
398-
{ isCreating ? 'Saving...' : 'Update title' }
399+
{ isCreating ? 'Saving...' : editButtonText }
399400
</button>
400401
}
401402
{ !editMode &&
@@ -434,6 +435,7 @@ RichTextArea.propTypes = {
434435
title: PropTypes.string,
435436
content: PropTypes.string,
436437
allMembers: PropTypes.object,
438+
editingTopic: PropTypes.bool
437439
}
438440

439441
export default RichTextArea

0 commit comments

Comments
 (0)