From 755b6b5667a164798d1bfbcbbadcc930d34db37b Mon Sep 17 00:00:00 2001 From: David Walsh Date: Wed, 26 Apr 2023 08:35:28 -0500 Subject: [PATCH] UX: Remove Goerli buy link and disable button (#18137) Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> --- shared/constants/network.ts | 5 +---- ui/hooks/experiences/useRamps.test.js | 18 ------------------ ui/hooks/experiences/useRamps.ts | 2 -- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/shared/constants/network.ts b/shared/constants/network.ts index 5227efe2e..bd3bec0fa 100644 --- a/shared/constants/network.ts +++ b/shared/constants/network.ts @@ -540,16 +540,13 @@ export const BUYABLE_CHAINS_MAP: { | typeof CHAIN_IDS.MOONRIVER | typeof CHAIN_IDS.AURORA | typeof CHAIN_IDS.LINEA_TESTNET + | typeof CHAIN_IDS.GOERLI >]: BuyableChainSettings; } = { [CHAIN_IDS.MAINNET]: { nativeCurrency: CURRENCY_SYMBOLS.ETH, network: BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME, }, - [CHAIN_IDS.GOERLI]: { - nativeCurrency: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.GOERLI], - network: BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME, - }, [CHAIN_IDS.SEPOLIA]: { nativeCurrency: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.SEPOLIA], network: BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME, diff --git a/ui/hooks/experiences/useRamps.test.js b/ui/hooks/experiences/useRamps.test.js index f104094e8..5f23a4e3b 100644 --- a/ui/hooks/experiences/useRamps.test.js +++ b/ui/hooks/experiences/useRamps.test.js @@ -26,24 +26,6 @@ describe('useRamps', () => { }); }); - it('should open the buy crypto URL for GOERLI chain ID', () => { - const mockChainId = '5'; - const mockBuyURI = 'https://goerli-faucet.slock.it/'; - - useSelector.mockReturnValue(mockChainId); - const openTabSpy = jest.spyOn(global.platform, 'openTab'); - - const { result } = renderHook(() => useRamps()); - - expect(typeof result.current.openBuyCryptoInPdapp).toBe('function'); - - result.current.openBuyCryptoInPdapp(); - - expect(openTabSpy).toHaveBeenCalledWith({ - url: mockBuyURI, - }); - }); - it('should open the buy crypto URL for SEPOLIA chain ID', () => { const mockChainId = '10'; const mockBuyURI = 'https://faucet.sepolia.dev/'; diff --git a/ui/hooks/experiences/useRamps.ts b/ui/hooks/experiences/useRamps.ts index 3b8947486..93ea6d47b 100644 --- a/ui/hooks/experiences/useRamps.ts +++ b/ui/hooks/experiences/useRamps.ts @@ -15,8 +15,6 @@ const useRamps = (): IUseRamps => { const getBuyURI = useCallback((_chainId: ChainId) => { switch (_chainId) { - case CHAIN_IDS.GOERLI: - return 'https://goerli-faucet.slock.it/'; case CHAIN_IDS.SEPOLIA: return 'https://faucet.sepolia.dev/'; default: