Use twemojis for reactions

This commit is contained in:
Rūdolfs Ošiņš
2025-01-29 11:13:14 -06:00
parent 557e96f98b
commit c4bef0e99b
2 changed files with 6 additions and 2 deletions
+2
View File
@@ -4,6 +4,7 @@
import Border from "./Border.svelte";
import Icon from "./Icon.svelte";
import Popover from "./Popover.svelte";
import { twemoji } from "@app/lib/utils";
interface Props {
reactions?: Reaction[];
@@ -62,6 +63,7 @@
({ emoji }) => emoji === reaction,
)}
<button
use:twemoji={{ exclude: ["21a9"] }}
class:active={Boolean(lookedUpReaction)}
onclick={() =>
select(lookedUpReaction || { emoji: reaction, authors: [] })}>
+4 -2
View File
@@ -2,6 +2,8 @@
import type { Author } from "@bindings/cob/Author";
import type { Reaction } from "@bindings/cob/Reaction";
import { twemoji } from "@app/lib/utils";
interface Props {
reactions: Reaction[];
handleReaction?: (authors: Author[], reaction: string) => Promise<void>;
@@ -42,12 +44,12 @@
await handleReaction(authors, emoji);
}
}}>
<span>{emoji}</span>
<span use:twemoji={{ exclude: ["21a9"] }}>{emoji}</span>
<span>{authors.length}</span>
</div>
{:else}
<div class="reaction txt-tiny" style="padding: 2px 4px;">
<span>{emoji}</span>
<span use:twemoji={{ exclude: ["21a9"] }}>{emoji}</span>
<span>{authors.length}</span>
</div>
{/if}