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

17 lines
507 B
TypeScript
Raw Normal View History

2021-06-12 04:53:56 +02:00
import { FC } from 'react';
import { GetConfiguration } from '../../utils/GetConfiguration';
2021-04-16 05:42:00 +02:00
import { CurrencyIconProps } from './CurrencyIcon.types';
2021-06-12 04:53:56 +02:00
export const CurrencyIcon: FC<CurrencyIconProps> = props =>
2021-04-16 05:42:00 +02:00
{
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 } : {} } />
);
}