Move constants out of component

This commit is contained in:
abefernan 2023-04-24 22:24:06 +02:00
parent cbc1f7b293
commit 14e7283bdc

View File

@ -37,6 +37,9 @@ interface GithubChainRegistryItem {
};
}
const chainsUrl = "https://api.github.com/repos/cosmos/chain-registry/contents";
const testnetsUrl = "https://api.github.com/repos/cosmos/chain-registry/contents/testnets";
const ChainSelect = () => {
const { state, dispatch } = useAppContext();
@ -61,9 +64,6 @@ const ChainSelect = () => {
const [tempRegistryName, setRegistryName] = useState(state.chain.registryName);
const [tempExplorerLink, setExplorerLink] = useState(state.chain.explorerLink);
const chainsUrl = "https://api.github.com/repos/cosmos/chain-registry/contents";
const testnetsUrl = "https://api.github.com/repos/cosmos/chain-registry/contents/testnets";
const getGhJson = useCallback(async () => {
// getting chain info from this repo: https://github.com/cosmos/chain-registry
try {