mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 21:11:55 +08:00
Merge pull request #50 from clarkwinkelmann/use-page-component
Use page component for tags page
This commit is contained in:
commit
2b3e925cf9
|
@ -1,20 +1,18 @@
|
|||
import Component from 'flarum/Component';
|
||||
import Page from 'flarum/components/Page';
|
||||
import IndexPage from 'flarum/components/IndexPage';
|
||||
import listItems from 'flarum/helpers/listItems';
|
||||
import humanTime from 'flarum/helpers/humanTime';
|
||||
import icon from 'flarum/helpers/icon';
|
||||
|
||||
import tagLabel from 'flarum/tags/helpers/tagLabel';
|
||||
import sortTags from 'flarum/tags/utils/sortTags';
|
||||
|
||||
export default class TagsPage extends Component {
|
||||
export default class TagsPage extends Page {
|
||||
init() {
|
||||
super.init();
|
||||
|
||||
this.tags = sortTags(app.store.all('tags').filter(tag => !tag.parent()));
|
||||
|
||||
app.current = this;
|
||||
app.history.push('tags', icon('fas fa-th-large'));
|
||||
app.drawer.hide();
|
||||
app.modal.close();
|
||||
app.history.push('tags', app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip'));
|
||||
}
|
||||
|
||||
view() {
|
||||
|
@ -75,14 +73,10 @@ export default class TagsPage extends Component {
|
|||
|
||||
{cloud.length ? (
|
||||
<div className="TagCloud">
|
||||
{cloud.map(tag => {
|
||||
const color = tag.color();
|
||||
|
||||
return [
|
||||
{cloud.map(tag => [
|
||||
tagLabel(tag, {link: true}),
|
||||
' '
|
||||
];
|
||||
})}
|
||||
' ',
|
||||
])}
|
||||
</div>
|
||||
) : ''}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user