Added ability to change placeholder text, and make comment replies optional
This commit is contained in:
parent
f4d9ccaf08
commit
9369b56174
|
@ -100,14 +100,13 @@ const CommentWidget = props => {
|
||||||
onDelete={props.onRemoveBody}
|
onDelete={props.onRemoveBody}
|
||||||
onSaveAndClose={props.onSaveAndClose} />
|
onSaveAndClose={props.onSaveAndClose} />
|
||||||
)}
|
)}
|
||||||
|
{ comments.length === 0 && !props.readOnly && props.disableReply && props.annotation &&
|
||||||
{ !props.readOnly && props.annotation &&
|
|
||||||
<div className="r6o-widget comment editable">
|
<div className="r6o-widget comment editable">
|
||||||
<TextEntryField
|
<TextEntryField
|
||||||
focus={props.focus}
|
focus={props.focus}
|
||||||
content={draftReply.value}
|
content={draftReply.value}
|
||||||
editable={true}
|
editable={true}
|
||||||
placeholder={comments.length > 0 ? i18n.t('Add a reply...') : i18n.t('Add a comment...')}
|
placeholder={props.textPlaceHolder || i18n.t('Add a comment...') }
|
||||||
onChange={onEditReply}
|
onChange={onEditReply}
|
||||||
onSaveAndClose={() => props.onSaveAndClose()}
|
onSaveAndClose={() => props.onSaveAndClose()}
|
||||||
/>
|
/>
|
||||||
|
@ -121,6 +120,27 @@ const CommentWidget = props => {
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{ !props.readOnly && !props.disableReply && props.annotation &&
|
||||||
|
<div className="r6o-widget comment editable">
|
||||||
|
<TextEntryField
|
||||||
|
focus={props.focus}
|
||||||
|
content={draftReply.value}
|
||||||
|
editable={true}
|
||||||
|
placeholder={comments.length > 0 ? i18n.t('Add a reply...') : (props.textPlaceHolder || i18n.t('Add a comment...'))}
|
||||||
|
onChange={onEditReply}
|
||||||
|
onSaveAndClose={() => props.onSaveAndClose()}
|
||||||
|
/>
|
||||||
|
{ props.purposeSelector && draftReply.value.length > 0 &&
|
||||||
|
<PurposeSelect
|
||||||
|
editable={true}
|
||||||
|
content={draftReply.purpose}
|
||||||
|
onChange={onChangeReplyPurpose}
|
||||||
|
onSaveAndClose={() => props.onSaveAndClose()}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ const TagWidget = props => {
|
||||||
{!props.readOnly &&
|
{!props.readOnly &&
|
||||||
<Autocomplete
|
<Autocomplete
|
||||||
focus={props.focus}
|
focus={props.focus}
|
||||||
placeholder={i18n.t('Add tag...')}
|
placeholder={props.textPlaceHolder || i18n.t('Add tag...')}
|
||||||
vocabulary={props.vocabulary || []}
|
vocabulary={props.vocabulary || []}
|
||||||
onChange={onDraftChange}
|
onChange={onDraftChange}
|
||||||
onSubmit={onSubmit}/>
|
onSubmit={onSubmit}/>
|
||||||
|
|
Loading…
Reference in New Issue