From b56f9d1c664d24bc9348d294bc51da3dec73d145 Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Fri, 7 Jan 2022 13:47:51 -0500 Subject: [PATCH] fix(plugins/discussions): support for GitHub emojis --- source/plugins/discussions/index.mjs | 2 +- source/templates/classic/style.css | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/plugins/discussions/index.mjs b/source/plugins/discussions/index.mjs index ceba504579c..f2e46769ec8 100644 --- a/source/plugins/discussions/index.mjs +++ b/source/plugins/discussions/index.mjs @@ -33,7 +33,7 @@ fetched.map(({upvoteCount}) => discussions.upvotes.discussions += upvoteCount) //Compute favorite category - for (const category of [...fetched.map(({category:{emoji, name}}) => `${imports.emoji.get(emoji)} ${name}`)]) + for (const category of [...fetched.map(({category:{emoji, name}}) => `${imports.emoji.get(emoji) ?? emoji} ${name}`)]) categories[category] = (categories[category] ?? 0) + 1 const categoryEntries = Object.entries(categories).sort((a, b) => b[1] - a[1]) discussions.categories.stats = Object.fromEntries(categoryEntries) diff --git a/source/templates/classic/style.css b/source/templates/classic/style.css index 2d084468f71..baa781fc72c 100644 --- a/source/templates/classic/style.css +++ b/source/templates/classic/style.css @@ -310,6 +310,7 @@ } .label.label-flex { display: flex; + align-items: center; } .label .label-right { display: flex; @@ -1341,6 +1342,9 @@ width: 1em; margin-bottom: -.125em; } + .label-flex .gemoji { + margin-right: .25rem; + } /* Cake day */ .cakeday, .cakeday svg {