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

16 lines
478 B
TypeScript
Raw Normal View History

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