File tree Expand file tree Collapse file tree
main/HomeContainer/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,8 +45,12 @@ export default class MarkdownPreview extends React.Component {
4545 }
4646
4747 render ( ) {
48+ let isEmpty = this . props . content . trim ( ) . length === 0
49+ let content = isEmpty
50+ ? '(Empty content)'
51+ : this . props . content
4852 return (
49- < div className = { 'MarkdownPreview' + ( this . props . className != null ? ' ' + this . props . className : '' ) } dangerouslySetInnerHTML = { { __html : ' ' + markdown ( this . props . content ) } } />
53+ < div className = { 'MarkdownPreview' + ( this . props . className != null ? ' ' + this . props . className : '' ) + ( isEmpty ? ' empty' : '' ) } dangerouslySetInnerHTML = { { __html : ' ' + markdown ( content ) } } />
5054 )
5155 }
5256}
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ export default class ArticleList extends React.Component {
118118 < ModeIcon className = 'mode' mode = { article . mode } /> < div className = 'title' children = { title } />
119119 </ div >
120120 < div className = 'ArticleList-item-middle2' >
121- < pre > < code children = { article . content . substring ( 0 , 50 ) } /> </ pre >
121+ < pre > < code children = { article . content . trim ( ) . length === 0 ? '(Empty content)' : article . content . substring ( 0 , 50 ) } /> </ pre >
122122 </ div >
123123 < div className = 'ArticleList-item-bottom' >
124124 < div className = 'tags' > < i className = 'fa fa-fw fa-tags' /> { tagElements } </ div >
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ button, input
5050 width 250px
5151 overflow-y auto
5252 z-index 0
53+ user-select none
5354 & > ul > li
5455 .articleItem
5556 padding 10px
@@ -119,5 +120,9 @@ button, input
119120 overflow-y auto
120121 .MarkdownPreview
121122 marked ()
123+ & .empty
124+ color lighten (inactiveTextColor , 10% )
125+ user-select none
126+ font-size 14px
122127 .CodeEditor
123128 absolute top bottom left right
Original file line number Diff line number Diff line change @@ -257,6 +257,10 @@ infoButton()
257257 border-top solid 1px borderColor
258258 overflow-y auto
259259 user-select all
260+ & .empty
261+ color lighten (inactiveTextColor , 10% )
262+ user-select none
263+ font-size 14px
260264 .CodeEditor
261265 absolute left right bottom
262266 top 60px
You can’t perform that action at this time.
0 commit comments