add alt tags to emojis

This commit is contained in:
hzrd149
2024-03-08 10:17:13 +00:00
parent 7b2638d816
commit 0d5ce89ead
2 changed files with 13 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ export function embedEmoji(content: EmbedableContent, note: NostrEvent | DraftNo
display="inline-block"
verticalAlign="middle"
title={match[1]}
alt={match[1]}
/>
);
}

View File

@@ -73,7 +73,18 @@ function AddEmojiForm({ onAdd }: { onAdd: (values: { name: string; url: string }
function EmojiTag({ name, url, onRemove, scale }: { name: string; url: string; onRemove?: () => void; scale: number }) {
return (
<Tag>
<Image key={name + url} src={url} title={name} w={scale} h={scale} ml="-1" mr="2" my="1" borderRadius="md" />
<Image
key={name + url}
src={url}
title={name}
alt={`:${name}:`}
w={scale}
h={scale}
ml="-1"
mr="2"
my="1"
borderRadius="md"
/>
<TagLabel flex={1}>{name}</TagLabel>
{onRemove && <TagCloseButton onClick={onRemove} />}
</Tag>