EmojiPicker: fix asset paths

This commit is contained in:
Alex Gleason 2022-07-11 15:09:41 -05:00
parent 3879dad039
commit 00802b01e9
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -1,15 +1,17 @@
import { Picker as EmojiPicker, PickerProps } from 'emoji-mart'; import { Picker as EmojiPicker, PickerProps } from 'emoji-mart';
import React, { useRef, useEffect } from 'react'; import React, { useRef, useEffect } from 'react';
import { joinPublicPath } from 'soapbox/utils/static';
import data from '../data'; import data from '../data';
const getSpritesheetURL = (set: string) => { const getSpritesheetURL = (set: string) => {
return '/packs/images/32.png'; return require('emoji-datasource/img/twitter/sheets/32.png');
} };
const getImageURL = (set: string, name: string) => { const getImageURL = (set: string, name: string) => {
return `/packs/emoji/${name}.svg`; return joinPublicPath(`/packs/emoji/${name}.svg`);
} };
function Picker(props: PickerProps) { function Picker(props: PickerProps) {
const ref = useRef(null); const ref = useRef(null);