diff --git a/app/soapbox/features/crypto_donate/components/crypto_icon.js b/app/soapbox/features/crypto_donate/components/crypto_icon.js deleted file mode 100644 index 9507769130..0000000000 Binary files a/app/soapbox/features/crypto_donate/components/crypto_icon.js and /dev/null differ diff --git a/app/soapbox/features/crypto_donate/components/crypto_icon.tsx b/app/soapbox/features/crypto_donate/components/crypto_icon.tsx new file mode 100644 index 0000000000..28c0535ab2 --- /dev/null +++ b/app/soapbox/features/crypto_donate/components/crypto_icon.tsx @@ -0,0 +1,29 @@ +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'); + } +}; + +interface ICryptoIcon { + ticker: string, + title?: string, + className?: string, +} + +const CryptoIcon: React.FC = ({ ticker, title, className }): JSX.Element => { + return ( +
+ {title +
+ ); +}; + +export default CryptoIcon;