global update and global fix
This commit is contained in:
25
apps/frontend/components/chat/emoji-sprite-provider.tsx
Normal file
25
apps/frontend/components/chat/emoji-sprite-provider.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect } from 'react';
|
||||
|
||||
let spriteInjected = false;
|
||||
|
||||
export function EmojiSpriteProvider() {
|
||||
useEffect(() => {
|
||||
if (spriteInjected || typeof document === 'undefined') return;
|
||||
fetch('/emojis/lendry-emojis.svg')
|
||||
.then((response) => response.text())
|
||||
.then((markup) => {
|
||||
if (spriteInjected) return;
|
||||
const container = document.createElement('div');
|
||||
container.innerHTML = markup;
|
||||
container.style.display = 'none';
|
||||
container.setAttribute('aria-hidden', 'true');
|
||||
document.body.appendChild(container);
|
||||
spriteInjected = true;
|
||||
})
|
||||
.catch(() => {});
|
||||
}, []);
|
||||
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user