Skip to content

Commit

Permalink
fix(plugins/discussions): support for GitHub emojis
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlighter committed Jan 8, 2022
1 parent 5907c35 commit 7d6c753
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion source/plugins/discussions/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions source/templates/classic/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@
}
.label.label-flex {
display: flex;
align-items: center;
}
.label .label-right {
display: flex;
Expand Down Expand Up @@ -1341,6 +1342,9 @@
width: 1em;
margin-bottom: -.125em;
}
.label-flex .gemoji {
margin-right: .25rem;
}

/* Cake day */
.cakeday, .cakeday svg {
Expand Down

0 comments on commit 7d6c753

Please sign in to comment.