nitro-react/src/utils/currency-icon/CurrencyIcon.tsx

16 lines
477 B
TypeScript
Raw Normal View History

2021-04-16 05:42:00 +02:00
import { Nitro } from 'nitro-renderer';
import { CurrencyIconProps } from './CurrencyIcon.types';
export function CurrencyIcon(props: CurrencyIconProps): JSX.Element
{
let url = Nitro.instance.getConfiguration<string>('currency.asset.icon.url', '');
url = url.replace('%type%', props.type.toString());
url = `url(${ url })`;
return (
<div className="nitro-currency-icon" style={ (url && url.length) ? { backgroundImage: url } : {} } />
);
}