From a2d3b84019c74515abe3802b82b35d2c64123058 Mon Sep 17 00:00:00 2001 From: Manuel Wedler Date: Thu, 8 Aug 2024 14:45:42 +0200 Subject: [PATCH] Navigate to settings when clicking 'Enable?' on disabled verifier --- apps/contract-verification/src/app/views/LookupView.tsx | 4 +++- apps/contract-verification/src/app/views/VerifyView.tsx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/contract-verification/src/app/views/LookupView.tsx b/apps/contract-verification/src/app/views/LookupView.tsx index 9407e17d08..0dd52306bc 100644 --- a/apps/contract-verification/src/app/views/LookupView.tsx +++ b/apps/contract-verification/src/app/views/LookupView.tsx @@ -6,6 +6,7 @@ import { VERIFIERS } from '../types' import { AppContext } from '../AppContext' import { CustomTooltip } from '@remix-ui/helper' import { getVerifier } from '../Verifiers' +import { useNavigate } from 'react-router-dom' export const LookupView = () => { const { settings, clientInstance } = useContext(AppContext) @@ -14,6 +15,7 @@ export const LookupView = () => { const [contractAddressError, setContractAddressError] = useState('') const [loadingVerifiers, setLoadingVerifiers] = useState>>({}) const [lookupResults, setLookupResult] = useState>>({}) + const navigate = useNavigate() const chainSettings = selectedChain ? mergeChainSettingsWithDefaults(selectedChain.chainId.toString(), settings) : undefined @@ -77,7 +79,7 @@ export const LookupView = () => {
{verifierId}{' '} - + navigate('/settings')}> Enable? diff --git a/apps/contract-verification/src/app/views/VerifyView.tsx b/apps/contract-verification/src/app/views/VerifyView.tsx index d2f47201b6..599713970b 100644 --- a/apps/contract-verification/src/app/views/VerifyView.tsx +++ b/apps/contract-verification/src/app/views/VerifyView.tsx @@ -193,7 +193,7 @@ export const VerifyView = () => { {chainSettings.verifiers[verifierId].apiUrl} ) : ( - + navigate('/settings')}> Enable?