chore: set alt of Twemoji for copying

This commit is contained in:
sup39 2024-01-18 20:47:03 +09:00
parent 658185a39f
commit dd27cd6b5e
Signed by: sup39
GPG key ID: 111C00916C1641E5
3 changed files with 5 additions and 2 deletions

View file

@ -98,7 +98,8 @@ function RenderEmoticonElement({
isUsingTwemoji() ? <img isUsingTwemoji() ? <img
className={css.EmoticonImg} className={css.EmoticonImg}
src={getEmojiUrl(element.key)} src={getEmojiUrl(element.key)}
alt={element.shortcode} alt={element.key}
title={element.shortcode}
/> : element.key /> : element.key
)} )}
{children} {children}

View file

@ -283,7 +283,8 @@ const NativeEmoji = (emoji: IEmoji) =>
loading="lazy" loading="lazy"
className={css.EmoticonImg} className={css.EmoticonImg}
src={getEmojiUrl(emoji.unicode)} src={getEmojiUrl(emoji.unicode)}
alt={emoji.shortcode} alt={emoji.unicode}
title={emoji.shortcode}
/> : emoji.unicode; /> : emoji.unicode;
export function EmojiItem({ export function EmojiItem({

View file

@ -46,6 +46,7 @@ const textToEmojifyJSX = (text: string): (string | JSX.Element)[] =>
return <span key={pushIndex} className={css.EmoticonBase}>{ return <span key={pushIndex} className={css.EmoticonBase}>{
isUsingTwemoji() ? <img isUsingTwemoji() ? <img
className={className} className={className}
alt={char}
title={title} title={title}
src={getEmojiUrl(char)} src={getEmojiUrl(char)}
/> : <span /> : <span