fix: manually adds basic solana chain metadata until available via API
This commit is contained in:
parent
4932223b76
commit
2568b0d3bb
BIN
dapps/react-dapp-v2-with-solana-web3js/public/solana_logo.png
Normal file
BIN
dapps/react-dapp-v2-with-solana-web3js/public/solana_logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
@ -97,6 +97,7 @@ interface BlockchainDisplayData {
|
||||
meta: ChainMetadata;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line
|
||||
function getBlockchainDisplayData(
|
||||
chainId: string,
|
||||
chainData: ChainNamespaces,
|
||||
@ -113,18 +114,28 @@ function getBlockchainDisplayData(
|
||||
return { data, meta };
|
||||
}
|
||||
|
||||
// TODO: add `solana` namespace + chains to https://github.com/pedrouid/blockchain-api
|
||||
// Specifying solana chain metadata manually here for now.
|
||||
const Blockchain: FC<PropsWithChildren<BlockchainProps>> = (
|
||||
props: PropsWithChildren<BlockchainProps>,
|
||||
) => {
|
||||
const { chainData, fetching, chainId, address, onClick, balances, active, actions } = props;
|
||||
const { fetching, chainId, address, onClick, balances, active, actions } = props;
|
||||
|
||||
if (!Object.keys(chainData).length) return null;
|
||||
// if (!Object.keys(chainData).length) return null;
|
||||
|
||||
const chain = getBlockchainDisplayData(chainId, chainData);
|
||||
if (typeof chain === "undefined") {
|
||||
return null;
|
||||
}
|
||||
const name = chain.meta.name || chain.data.name;
|
||||
// const chain = getBlockchainDisplayData(chainId, chainData);
|
||||
// if (typeof chain === "undefined") {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
const chain = {
|
||||
meta: {
|
||||
name: "Solana",
|
||||
rgb: "0, 0, 0",
|
||||
logo: "/solana_logo.png",
|
||||
},
|
||||
};
|
||||
const name = chain.meta.name; /*|| chain.data.name;*/
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
|
Loading…
Reference in New Issue
Block a user