From 14e7283bdc913636f00fb3ff358bd4e5d2958916 Mon Sep 17 00:00:00 2001 From: abefernan <44572727+abefernan@users.noreply.github.com> Date: Mon, 24 Apr 2023 22:24:06 +0200 Subject: [PATCH] Move constants out of component --- components/chainSelect/ChainSelect.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/chainSelect/ChainSelect.tsx b/components/chainSelect/ChainSelect.tsx index bfa7fbf..e9193bb 100644 --- a/components/chainSelect/ChainSelect.tsx +++ b/components/chainSelect/ChainSelect.tsx @@ -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 {