mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 23:23:52 +08:00
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:
commit
5bd13b0c22
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
.PostsUserPage-loadMore {
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
|
||||
.LoadingIndicator {
|
||||
height: 46px;
|
||||
|
|
Loading…
Reference in New Issue
Block a user