Commit 8f8eb1a8 authored by Toon Claes's avatar Toon Claes

awardEmoji: Display custom emoji

In one of the previous commits it's made possible to award custom emoji.
With this change they are properly shown on the frontend.

Changelog: added
parent 1ea55ffc
...@@ -245,5 +245,12 @@ export function glEmojiTag(inputName, options) { ...@@ -245,5 +245,12 @@ export function glEmojiTag(inputName, options) {
? `data-fallback-sprite-class="${escape(fallbackSpriteClass)}" ` ? `data-fallback-sprite-class="${escape(fallbackSpriteClass)}" `
: ''; : '';
return `<gl-emoji ${fallbackSpriteAttribute}data-name="${escape(name)}"></gl-emoji>`; const fallbackUrl = opts.url;
const fallbackSrcAttribute = fallbackUrl
? `data-fallback-src="${fallbackUrl}" data-unicode-version="custom"`
: '';
return `<gl-emoji ${fallbackSrcAttribute}${fallbackSpriteAttribute}data-name="${escape(
name,
)}"></gl-emoji>`;
} }
...@@ -93,12 +93,14 @@ export default { ...@@ -93,12 +93,14 @@ export default {
return awardList.some((award) => award.user.id === this.currentUserId); return awardList.some((award) => award.user.id === this.currentUserId);
}, },
createAwardList(name, list) { createAwardList(name, list) {
const url = list.length ? list[0].url : null;
return { return {
name, name,
list, list,
title: this.getAwardListTitle(list, name), title: this.getAwardListTitle(list, name),
classes: this.getAwardClassBindings(list), classes: this.getAwardClassBindings(list),
html: glEmojiTag(name), html: glEmojiTag(name, { url }),
}; };
}, },
getAwardListTitle(awardsList, name) { getAwardListTitle(awardsList, name) {
......
...@@ -244,9 +244,13 @@ ...@@ -244,9 +244,13 @@
// above will be deprecated once all instances of "award emoji" are // above will be deprecated once all instances of "award emoji" are
// migrated to Vue. // migrated to Vue.
.gl-button .award-emoji-block gl-emoji { .gl-button .award-emoji-block {
margin-top: -1px; display: contents;
margin-bottom: -1px;
gl-emoji {
margin-top: -1px;
margin-bottom: -1px;
}
} }
.add-reaction-button { .add-reaction-button {
......
...@@ -254,10 +254,9 @@ li.note { ...@@ -254,10 +254,9 @@ li.note {
} }
img.emoji { img.emoji {
height: 20px; height: 16px;
vertical-align: top; vertical-align: top;
width: 20px; width: 20px;
margin-top: 1px;
} }
.chart { .chart {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment