mirror of
https://git.shipoclu.com/moon/plspace.git
synced 2026-08-14 03:02:31 +00:00
refactor and fix all references to emojis
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import type { EmojiReaction, Status } from '$lib/api/types'
|
||||
import { useAppServices } from '$lib/app-services'
|
||||
import { safeCustomEmojiUrl } from '$lib/util/html'
|
||||
|
||||
interface Props {
|
||||
status: Status
|
||||
@@ -94,11 +95,12 @@
|
||||
{#if reactions.length > 0}
|
||||
<div class="emoji-reaction-bar" aria-label="Emoji reactions">
|
||||
{#each reactions as reaction (reaction.url ?? reaction.name)}
|
||||
{@const imageUrl = reaction.url ? safeCustomEmojiUrl(reaction.url) : null}
|
||||
<button
|
||||
type="button"
|
||||
class="emoji-reaction"
|
||||
class:emoji-reaction--mine={reaction.me}
|
||||
data-custom={reaction.url ? 'true' : 'false'}
|
||||
data-custom={imageUrl ? 'true' : 'false'}
|
||||
aria-label={accessibleLabel(reaction)}
|
||||
aria-pressed={reaction.me ? 'true' : 'false'}
|
||||
title={session.signedIn
|
||||
@@ -107,10 +109,10 @@
|
||||
disabled={!session.signedIn || busyEmoji !== null}
|
||||
onclick={() => void toggle(reaction)}
|
||||
>
|
||||
{#if reaction.url}
|
||||
{#if imageUrl}
|
||||
<img
|
||||
class="emoji-reaction-image"
|
||||
src={reaction.url}
|
||||
src={imageUrl}
|
||||
alt={customLabel(reaction)}
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
|
||||
Reference in New Issue
Block a user