mirror of
https://github.com/flarum/framework.git
synced 2025-01-21 22:11:02 +08:00
forum: add DiscussionsUserPage component
This commit is contained in:
parent
80d8707d15
commit
2a66dc5572
|
@ -9,6 +9,7 @@ import IndexPage from './components/IndexPage';
|
|||
import DiscussionList from './components/DiscussionList';
|
||||
import DiscussionPage from './components/DiscussionPage';
|
||||
import PostsUserPage from './components/PostsUserPage';
|
||||
import DiscussionsUserPage from './components/DiscussionsUserPage';
|
||||
import SettingsPage from './components/SettingsPage';
|
||||
|
||||
import CommentPost from './components/CommentPost';
|
||||
|
@ -26,7 +27,7 @@ export default class Forum extends Application {
|
|||
|
||||
user: { path: '/u/:username', component: PostsUserPage },
|
||||
'user.posts': { path: '/u/:username', component: PostsUserPage },
|
||||
'user.discussions': { path: '/u/:username/discussions', component: PostsUserPage },
|
||||
'user.discussions': { path: '/u/:username/discussions', component: DiscussionsUserPage },
|
||||
|
||||
settings: { path: '/settings', component: SettingsPage },
|
||||
|
||||
|
|
27
js/src/forum/components/DiscussionsUserPage.tsx
Normal file
27
js/src/forum/components/DiscussionsUserPage.tsx
Normal file
|
@ -0,0 +1,27 @@
|
|||
import UserPage from './UserPage';
|
||||
import DiscussionList from './DiscussionList';
|
||||
|
||||
/**
|
||||
* The `DiscussionsUserPage` component shows a discussion list inside of a user
|
||||
* page.
|
||||
*/
|
||||
export default class DiscussionsUserPage extends UserPage {
|
||||
oninit(vnode) {
|
||||
super.oninit(vnode);
|
||||
|
||||
this.loadUser(m.route.param('username'));
|
||||
}
|
||||
|
||||
content() {
|
||||
return (
|
||||
<div className="DiscussionsUserPage">
|
||||
{DiscussionList.component({
|
||||
params: {
|
||||
q: `author:${this.user.username()}`,
|
||||
sort: 'newest',
|
||||
},
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user