diff --git a/browser/main/HomePage/ArticleDetail.js b/browser/main/HomePage/ArticleDetail.js index c7daaa9e..60d51433 100644 --- a/browser/main/HomePage/ArticleDetail.js +++ b/browser/main/HomePage/ArticleDetail.js @@ -267,6 +267,9 @@ export default class ArticleDetail extends React.Component { newArticle.updatedAt = new Date() if (newArticle.createdAt == null) { newArticle.createdAt = new Date() + if (newArticle.title.trim().length === 0) { + newArticle.title = `Created at ${moment(newArticle.createdAt).format('YYYY/MM/DD HH:mm')}` + } activityRecord.emit('ARTICLE_CREATE') } else { activityRecord.emit('ARTICLE_UPDATE') @@ -464,7 +467,15 @@ export default class ArticleDetail extends React.Component {
- this.handleTitleKeyDown(e)} placeholder='Title' ref='title' value={this.state.article.title} onChange={e => this.handleTitleChange(e)}/> + this.handleTitleKeyDown(e)} + placeholder={this.state.article.createdAt == null + ? `Created at ${moment().format('YYYY/MM/DD HH:mm')}` + : 'Title'} + ref='title' + value={this.state.article.title} + onChange={e => this.handleTitleChange(e)} + />
Not tagged yet) let folder = _.findWhere(folders, {key: article.FolderKey}) + let title = article.status !== NEW + ? article.title.trim().length === 0 + ? (Untitled) + : article.title + : '(New article)' + return (
this.handleArticleClick(article)(e)} className={'articleItem' + (activeArticle.key === article.key ? ' active' : '')}> @@ -91,7 +97,7 @@ export default class ArticleList extends React.Component { {article.status != null ? article.status : moment(article.updatedAt).fromNow()}
-
{article.status !== NEW ? article.title : '(New article)'}
+
{title}
{tagElements}
diff --git a/browser/styles/main/HomeContainer/components/ArticleList.styl b/browser/styles/main/HomeContainer/components/ArticleList.styl index 6617773a..7d406c25 100644 --- a/browser/styles/main/HomeContainer/components/ArticleList.styl +++ b/browser/styles/main/HomeContainer/components/ArticleList.styl @@ -48,6 +48,8 @@ articleItemColor = #777 left 19px right 0 overflow ellipsis + small + color #AAA .bottom padding 5px 0 overflow-x auto