From 69057183e00d53c0ef503c1ee0d974fb732a5b10 Mon Sep 17 00:00:00 2001 From: Clark Winkelmann Date: Thu, 24 May 2018 18:18:39 +0200 Subject: [PATCH 1/3] Remove unused color variable --- extensions/tags/js/forum/src/components/TagsPage.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/extensions/tags/js/forum/src/components/TagsPage.js b/extensions/tags/js/forum/src/components/TagsPage.js index 1305ba767..aa890d89d 100644 --- a/extensions/tags/js/forum/src/components/TagsPage.js +++ b/extensions/tags/js/forum/src/components/TagsPage.js @@ -75,14 +75,10 @@ export default class TagsPage extends Component { {cloud.length ? (
- {cloud.map(tag => { - const color = tag.color(); - - return [ - tagLabel(tag, {link: true}), - ' ' - ]; - })} + {cloud.map(tag => [ + tagLabel(tag, {link: true}), + ' ', + ])}
) : ''} From a7ebbf1035d9f3891dbd4cf5829541079687d2fe Mon Sep 17 00:00:00 2001 From: Clark Winkelmann Date: Thu, 24 May 2018 18:50:11 +0200 Subject: [PATCH 2/3] Use Page component for Tags page --- extensions/tags/js/forum/src/components/TagsPage.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/extensions/tags/js/forum/src/components/TagsPage.js b/extensions/tags/js/forum/src/components/TagsPage.js index aa890d89d..0692548e9 100644 --- a/extensions/tags/js/forum/src/components/TagsPage.js +++ b/extensions/tags/js/forum/src/components/TagsPage.js @@ -1,4 +1,4 @@ -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'; @@ -7,14 +7,13 @@ 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(); } view() { From e029cdff8766ab1095e9e284cfa9c106ec676c41 Mon Sep 17 00:00:00 2001 From: Clark Winkelmann Date: Thu, 24 May 2018 18:50:54 +0200 Subject: [PATCH 3/3] Fix history usage (introduces new translation) --- extensions/tags/js/forum/src/components/TagsPage.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/extensions/tags/js/forum/src/components/TagsPage.js b/extensions/tags/js/forum/src/components/TagsPage.js index 0692548e9..a10ad2487 100644 --- a/extensions/tags/js/forum/src/components/TagsPage.js +++ b/extensions/tags/js/forum/src/components/TagsPage.js @@ -2,7 +2,6 @@ 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'; @@ -13,7 +12,7 @@ export default class TagsPage extends Page { this.tags = sortTags(app.store.all('tags').filter(tag => !tag.parent())); - app.history.push('tags', icon('fas fa-th-large')); + app.history.push('tags', app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip')); } view() {