2021-06-12 04:53:56 +02:00
|
|
|
import { FC } from 'react';
|
2021-06-23 10:05:23 +02:00
|
|
|
import { GetConfiguration } from '../../../api';
|
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 } : {} } />
|
|
|
|
);
|
|
|
|
}
|