sforkowany z mirror/soapbox
Fix crypto icons
rodzic
d900cd0c9c
commit
9c9c86d8f9
|
@ -1,12 +1,11 @@
|
|||
import genericIcon from 'cryptocurrency-icons/svg/color/generic.svg';
|
||||
import React from 'react';
|
||||
|
||||
/** Get crypto icon URL by ticker symbol, or fall back to generic icon */
|
||||
const getIcon = (ticker: string): string => {
|
||||
try {
|
||||
return require(`cryptocurrency-icons/svg/color/${ticker.toLowerCase()}.svg`);
|
||||
} catch {
|
||||
return require('cryptocurrency-icons/svg/color/generic.svg');
|
||||
}
|
||||
const modules: Record<string, any> = import.meta.glob('../../../../../node_modules/cryptocurrency-icons/svg/color/*.svg', { eager: true });
|
||||
const key = `../../../../../node_modules/cryptocurrency-icons/svg/color/${ticker}.svg`;
|
||||
return modules[key]?.default || genericIcon;
|
||||
};
|
||||
|
||||
interface ICryptoIcon {
|
||||
|
|
|
@ -400,8 +400,6 @@ const Thread: React.FC<IThread> = (props) => {
|
|||
index: ancestorsIds.size,
|
||||
offset: -80,
|
||||
});
|
||||
|
||||
setImmediate(() => statusRef.current?.querySelector<HTMLDivElement>('.detailed-actualStatus')?.focus());
|
||||
}, [props.params.statusId, status?.id, ancestorsIds.size, isLoaded]);
|
||||
|
||||
const handleRefresh = () => {
|
||||
|
|
Ładowanie…
Reference in New Issue