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:
@@ -45,8 +45,12 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
let isEmpty = this.props.content.trim().length === 0
|
||||||
|
let content = isEmpty
|
||||||
|
? '(Empty content)'
|
||||||
|
: this.props.content
|
||||||
return (
|
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)}}/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ export default class ArticleList extends React.Component {
|
|||||||
<ModeIcon className='mode' mode={article.mode}/> <div className='title' children={title}/>
|
<ModeIcon className='mode' mode={article.mode}/> <div className='title' children={title}/>
|
||||||
</div>
|
</div>
|
||||||
<div className='ArticleList-item-middle2'>
|
<div className='ArticleList-item-middle2'>
|
||||||
<pre><code children={article.content.substring(0, 50)}/></pre>
|
<pre><code children={article.content.trim().length === 0 ? '(Empty content)' : article.content.substring(0, 50)}/></pre>
|
||||||
</div>
|
</div>
|
||||||
<div className='ArticleList-item-bottom'>
|
<div className='ArticleList-item-bottom'>
|
||||||
<div className='tags'><i className='fa fa-fw fa-tags'/>{tagElements}</div>
|
<div className='tags'><i className='fa fa-fw fa-tags'/>{tagElements}</div>
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ button, input
|
|||||||
width 250px
|
width 250px
|
||||||
overflow-y auto
|
overflow-y auto
|
||||||
z-index 0
|
z-index 0
|
||||||
|
user-select none
|
||||||
&>ul>li
|
&>ul>li
|
||||||
.articleItem
|
.articleItem
|
||||||
padding 10px
|
padding 10px
|
||||||
@@ -119,5 +120,9 @@ button, input
|
|||||||
overflow-y auto
|
overflow-y auto
|
||||||
.MarkdownPreview
|
.MarkdownPreview
|
||||||
marked()
|
marked()
|
||||||
|
&.empty
|
||||||
|
color lighten(inactiveTextColor, 10%)
|
||||||
|
user-select none
|
||||||
|
font-size 14px
|
||||||
.CodeEditor
|
.CodeEditor
|
||||||
absolute top bottom left right
|
absolute top bottom left right
|
||||||
|
|||||||
@@ -257,6 +257,10 @@ infoButton()
|
|||||||
border-top solid 1px borderColor
|
border-top solid 1px borderColor
|
||||||
overflow-y auto
|
overflow-y auto
|
||||||
user-select all
|
user-select all
|
||||||
|
&.empty
|
||||||
|
color lighten(inactiveTextColor, 10%)
|
||||||
|
user-select none
|
||||||
|
font-size 14px
|
||||||
.CodeEditor
|
.CodeEditor
|
||||||
absolute left right bottom
|
absolute left right bottom
|
||||||
top 60px
|
top 60px
|
||||||
|
|||||||
Reference in New Issue
Block a user