Tris20
(Tristan)
May 17, 2024, 10:00am
1
I’m trying to add the free, solid, beer icon as my discourse reactions like icon
:
Unfortunately the far- prefix is added to the “beer” text
and the regular icon is not included in the free tier:
so the icon does not load:
If this is intended, is there a workaround for this?
1 Like
Firepup650
(Firepup Sixfifty)
May 17, 2024, 10:45am
2
By wild chance, does fas-beer
as the icon name work?
The icon works if you can’t like it anymore, but not when you can.
Looking at the code, when you liked already:
if (hasUsedMainReaction) {
return h(
"button.btn-toggle-reaction-like.btn-icon.no-text.reaction-button",
{
title: this.buildAttributes(attrs).title,
},
[iconNode(mainReactionIcon)]
);
}
When you did not like yet:
return h(
"button.btn-toggle-reaction-like.btn-icon.no-text.reaction-button",
{
title: this.buildAttributes(attrs).title,
},
[iconNode(`far-${mainReactionIcon}`)]
);
It expects a far—
version, which doesn’t seem to exist for beer
.
A quick solution in your case is to use the API to replace the far-beer
, for example:
<script type="text/discourse-plugin" version="0.8">
api.replaceIcon("far-beer", "beer");
</script>
I don’t know if a new setting should be introduced here or add some logic to use the same non-far version if the far-version doesn’t exist.
5 Likes
Tris20
(Tristan)
May 21, 2024, 9:53am
4
Sadly not, it’s empty just like above.
Arkshine:
A quick solution in your case is to use the API to replace the far-beer
, for example:
<script type="text/discourse-plugin" version="0.8">
api.replaceIcon("far-beer", "beer");
</script>
Thanks for taking a detailed look at this. Using the html above is definitely a good workaround for the forseeable future. We did this originally to replace the heart, but it completely slipped my mind that it could be used again to replace the far-beer too.
2 Likes