1
0
mirror of https://github.com/flarum/core.git synced 2025-08-12 03:14:33 +02:00

Add icons to tag tiles (#104)

This commit is contained in:
Miha Frangež
2020-11-30 20:06:51 +01:00
committed by GitHub
parent ad85470e54
commit 46d094192d
2 changed files with 7 additions and 0 deletions

2
extensions/tags/js/src/forum/components/TagsPage.js Normal file → Executable file
View File

@@ -4,6 +4,7 @@ import Link from 'flarum/components/Link';
import listItems from 'flarum/helpers/listItems';
import humanTime from 'flarum/helpers/humanTime';
import tagIcon from '../../common/helpers/tagIcon';
import tagLabel from '../../common/helpers/tagLabel';
import sortTags from '../../common/utils/sortTags';
@@ -38,6 +39,7 @@ export default class TagsPage extends Page {
<li className={'TagTile ' + (tag.color() ? 'colored' : '')}
style={{backgroundColor: tag.color()}}>
<Link className="TagTile-info" href={app.route.tag(tag)}>
{tag.icon() && tagIcon(tag, {}, { useColor: false })}
<h3 className="TagTile-name">{tag.name()}</h3>
<p className="TagTile-description">{tag.description()}</p>
{children

5
extensions/tags/less/forum/TagTiles.less Normal file → Executable file
View File

@@ -86,6 +86,11 @@
&:hover {
background: fade(#000, 5%);
}
.icon {
font-size: 24px;
float: left;
margin-right: 10px;
}
}
.TagTile-name {
font-size: 18px;