1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

message for empty content like placeholder

This commit is contained in:
Rokt33r
2015-12-28 17:41:42 +09:00
parent 54d563f49e
commit a0a1c84db1
4 changed files with 15 additions and 2 deletions

View File

@@ -45,8 +45,12 @@ export default class MarkdownPreview extends React.Component {
}
render () {
let isEmpty = this.props.content.trim().length === 0
let content = isEmpty
? '(Empty content)'
: this.props.content
return (
<div className={'MarkdownPreview' + (this.props.className != null ? ' ' + this.props.className : '')} dangerouslySetInnerHTML={{__html: ' ' + markdown(this.props.content)}}/>
<div className={'MarkdownPreview' + (this.props.className != null ? ' ' + this.props.className : '') + (isEmpty ? ' empty' : '')} dangerouslySetInnerHTML={{__html: ' ' + markdown(content)}}/>
)
}
}