mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 21:11:55 +08:00
fix tagLabel links (#96)
This commit is contained in:
parent
e787048af1
commit
c6829edd85
|
@ -1,4 +1,5 @@
|
|||
import extract from 'flarum/utils/extract';
|
||||
import Link from 'flarum/components/Link';
|
||||
import tagIcon from './tagIcon';
|
||||
|
||||
export default function tagLabel(tag, attrs = {}) {
|
||||
|
@ -17,14 +18,14 @@ export default function tagLabel(tag, attrs = {}) {
|
|||
|
||||
if (link) {
|
||||
attrs.title = tag.description() || '';
|
||||
attrs.route = app.route('tag', {tags: tag.slug()});
|
||||
attrs.href = app.route('tag', {tags: tag.slug()});
|
||||
}
|
||||
} else {
|
||||
attrs.className += ' untagged';
|
||||
}
|
||||
|
||||
return (
|
||||
m((link ? 'a' : 'span'), attrs,
|
||||
m((link ? Link : 'span'), attrs,
|
||||
<span className="TagLabel-text">
|
||||
{tag && tag.icon() && tagIcon(tag, {}, {useColor: false})} {tagText}
|
||||
</span>
|
||||
|
|
Loading…
Reference in New Issue
Block a user