pl-fe: remove links to block explorers
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@ -8,7 +8,6 @@ import Text from 'pl-fe/components/ui/text';
|
||||
import { CryptoIcon } from 'pl-fe/features/ui/util/async-components';
|
||||
import { useModalsStore } from 'pl-fe/stores/modals';
|
||||
|
||||
import { getExplorerUrl } from '../utils/block-explorer';
|
||||
import { getTitle } from '../utils/coin-db';
|
||||
|
||||
interface ICryptoAddress {
|
||||
@ -28,7 +27,6 @@ const CryptoAddress: React.FC<ICryptoAddress> = (props): JSX.Element => {
|
||||
};
|
||||
|
||||
const title = getTitle(ticker);
|
||||
const explorerUrl = getExplorerUrl(ticker, address);
|
||||
|
||||
return (
|
||||
<Stack>
|
||||
@ -45,12 +43,6 @@ const CryptoAddress: React.FC<ICryptoAddress> = (props): JSX.Element => {
|
||||
<a className='ml-1 text-gray-500 rtl:ml-0 rtl:mr-1' href='#' onClick={handleModalClick}>
|
||||
<Icon src={require('@tabler/icons/outline/qrcode.svg')} size={20} />
|
||||
</a>
|
||||
|
||||
{explorerUrl && (
|
||||
<a className='ml-1 text-gray-500 rtl:ml-0 rtl:mr-1' href={explorerUrl} target='_blank'>
|
||||
<Icon src={require('@tabler/icons/outline/external-link.svg')} size={20} />
|
||||
</a>
|
||||
)}
|
||||
</HStack>
|
||||
</HStack>
|
||||
|
||||
|
||||
@ -2,10 +2,8 @@ import { QRCodeCanvas as QRCode } from 'qrcode.react';
|
||||
import React from 'react';
|
||||
|
||||
import CopyableInput from 'pl-fe/components/copyable-input';
|
||||
import Icon from 'pl-fe/components/icon';
|
||||
import { CryptoIcon } from 'pl-fe/features/ui/util/async-components';
|
||||
|
||||
import { getExplorerUrl } from '../utils/block-explorer';
|
||||
import { getTitle } from '../utils/coin-db';
|
||||
|
||||
interface IDetailedCryptoAddress {
|
||||
@ -16,7 +14,6 @@ interface IDetailedCryptoAddress {
|
||||
|
||||
const DetailedCryptoAddress: React.FC<IDetailedCryptoAddress> = ({ address, ticker, note }): JSX.Element => {
|
||||
const title = getTitle(ticker);
|
||||
const explorerUrl = getExplorerUrl(ticker, address);
|
||||
|
||||
return (
|
||||
<div className='flex flex-col'>
|
||||
@ -28,11 +25,6 @@ const DetailedCryptoAddress: React.FC<IDetailedCryptoAddress> = ({ address, tick
|
||||
title={title}
|
||||
/>
|
||||
<div className='font-bold'>{title || ticker.toUpperCase()}</div>
|
||||
<div className='ml-auto flex'>
|
||||
{explorerUrl && <a className='ml-2 text-gray-400' href={explorerUrl} target='_blank'>
|
||||
<Icon className='size-4.5' src={require('@tabler/icons/outline/external-link.svg')} />
|
||||
</a>}
|
||||
</div>
|
||||
</div>
|
||||
{note && <div className='mb-2.5'>{note}</div>}
|
||||
<div className='mb-3 flex items-center justify-center p-2.5'>
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
import blockExplorers from './block-explorers.json';
|
||||
|
||||
type BlockExplorers = Record<string, string | null>;
|
||||
|
||||
const getExplorerUrl = (ticker: string, address: string): string | null => {
|
||||
const template = (blockExplorers as BlockExplorers)[ticker];
|
||||
if (!template) return null;
|
||||
return template.replace('{address}', address);
|
||||
};
|
||||
|
||||
export { getExplorerUrl };
|
||||
@ -1,26 +0,0 @@
|
||||
{
|
||||
"aave": "https://etherscan.io/address/{address}",
|
||||
"bat": "https://etherscan.io/address/{address}",
|
||||
"bch": "https://explorer.bitcoin.com/bch/address/{address}",
|
||||
"btc": "https://explorer.bitcoin.com/btc/address/{address}",
|
||||
"btg": "https://btgexplorer.com/address/{address}",
|
||||
"comp": "https://etherscan.io/address/{address}",
|
||||
"dash": "https://dashblockexplorer.com/address/{address}",
|
||||
"dgb": "https://digiexplorer.info/address/{address}",
|
||||
"doge": "https://dogechain.info/address/{address}",
|
||||
"etc": "https://etcblockexplorer.com/address/{address}",
|
||||
"eth": "https://etherscan.io/address/{address}",
|
||||
"grans": "https://ubiqscan.io/address/{address}",
|
||||
"link": "https://etherscan.io/address/{address}",
|
||||
"ltc": "https://litecoinblockexplorer.net/address/{address}",
|
||||
"mkr": "https://etherscan.io/address/{address}",
|
||||
"oxt": "https://etherscan.io/address/{address}",
|
||||
"sushi": "https://etherscan.io/address/{address}",
|
||||
"ubq": "https://ubiqscan.io/address/{address}",
|
||||
"uni": "https://etherscan.io/address/{address}",
|
||||
"usdc": "https://etherscan.io/address/{address}",
|
||||
"vtc": "https://vtcblocks.com/address/{address}",
|
||||
"xmr": "https://monerohash.com/explorer/search?value={address}",
|
||||
"xrp": "https://xrpscan.com/account/{address}",
|
||||
"zec": "https://zecblockexplorer.com/address/{address}"
|
||||
}
|
||||
Reference in New Issue
Block a user