Merge pull request #1576 from datitisev/user-posts-page

Make user posts page similar to discussion page, add empty text
This commit is contained in:
Toby Zerner 2018-09-23 07:22:08 +09:30 committed by GitHub
commit 5bd13b0c22
2 changed files with 14 additions and 1 deletions

View File

@ -1,6 +1,7 @@
import UserPage from './UserPage';
import LoadingIndicator from '../../common/components/LoadingIndicator';
import Button from '../../common/components/Button';
import Placeholder from '../../common/components/Placeholder';
import CommentPost from './CommentPost';
/**
@ -59,6 +60,15 @@ export default class PostsUserPage extends UserPage {
);
}
if (this.posts.length === 0 && !this.loading) {
const text = app.translator.trans('core.forum.user.posts_empty_text');
return (
<div className="PostsUserPage">
{Placeholder.component({text})}
</div>
);
}
return (
<div className="PostsUserPage">
<ul className="PostsUserPage-list">
@ -71,8 +81,10 @@ export default class PostsUserPage extends UserPage {
</li>
))}
</ul>
<div className="PostsUserPage-loadMore">
{footer}
</div>
</div>
);
}

View File

@ -1,5 +1,6 @@
.PostsUserPage-loadMore {
text-align: center;
margin-top: 10px;
.LoadingIndicator {
height: 46px;