@@ -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
439441export default RichTextArea
0 commit comments