diff --git a/apps/contract-verification/src/app/components/ConfigInput.tsx b/apps/contract-verification/src/app/components/ConfigInput.tsx new file mode 100644 index 0000000000..d0e9efa45c --- /dev/null +++ b/apps/contract-verification/src/app/components/ConfigInput.tsx @@ -0,0 +1,40 @@ +import React, { useEffect, useState, useContext } from 'react' +import { ethers } from 'ethers/' + +interface ConfigInputProps { + label: string + id: string + secret: boolean + initialValue: string + saveResult: (result: string) => void +} + +// Chooses one contract from the compilation output. +export const ConfigInput: React.FC = ({ label, id, secret, initialValue, saveResult }) => { + const [value, setValue] = useState(initialValue) + const [enabled, setEnabled] = useState(false) + + const handleChange = () => { + setEnabled(true) + } + + const handleSave = () => { + setEnabled(false) + saveResult(value) + } + + return ( +
+ + setValue(e.target.value)} disabled={!enabled} /> +
+ + +
+
+ ) +} diff --git a/apps/contract-verification/src/app/components/SearchableChainDropdown.tsx b/apps/contract-verification/src/app/components/SearchableChainDropdown.tsx index 6959d4c8be..1c8542f307 100644 --- a/apps/contract-verification/src/app/components/SearchableChainDropdown.tsx +++ b/apps/contract-verification/src/app/components/SearchableChainDropdown.tsx @@ -88,7 +88,7 @@ export const SearchableChainDropdown: React.FC = ({ label, id, se } return ( -
+
{' '} {/* Add ref here */} diff --git a/apps/contract-verification/src/app/components/index.tsx b/apps/contract-verification/src/app/components/index.tsx index 1aec06fc73..acdf9376b2 100644 --- a/apps/contract-verification/src/app/components/index.tsx +++ b/apps/contract-verification/src/app/components/index.tsx @@ -2,3 +2,4 @@ export { NavMenu } from './NavMenu' export { ContractDropdown } from './ContractDropdown' export { SearchableChainDropdown } from './SearchableChainDropdown' export { ContractAddressInput } from './ContractAddressInput' +export { ConfigInput } from './ConfigInput' diff --git a/apps/contract-verification/src/app/routes.tsx b/apps/contract-verification/src/app/routes.tsx index 2e4b78ad08..958262b75f 100644 --- a/apps/contract-verification/src/app/routes.tsx +++ b/apps/contract-verification/src/app/routes.tsx @@ -1,10 +1,8 @@ import React from 'react' import { HashRouter as Router, Route, Routes } from 'react-router-dom' -import { VerifyView } from './views' +import { VerifyView, ReceiptsView, LookupView, SettingsView } from './views' import { DefaultLayout } from './layouts' -import { ReceiptsView } from './views/ReceiptsView' -import { LookupView } from './views/LookupView' const DisplayRoutes = () => ( @@ -35,6 +33,15 @@ const DisplayRoutes = () => ( } /> + + + + + } + /> ) diff --git a/apps/contract-verification/src/app/views/SettingsView.tsx b/apps/contract-verification/src/app/views/SettingsView.tsx new file mode 100644 index 0000000000..ab68a6b323 --- /dev/null +++ b/apps/contract-verification/src/app/views/SettingsView.tsx @@ -0,0 +1,21 @@ +import { useState } from 'react' +import { SearchableChainDropdown, ConfigInput } from '../components' +import { Chain } from '../types/VerificationTypes' + +export const SettingsView = () => { + const [selectedChain, setSelectedChain] = useState() + + return ( + <> + + + {selectedChain && ( +
+ Etherscan + {}} /> + {}} /> +
+ )} + + ) +} diff --git a/apps/contract-verification/src/app/views/VerifyView.tsx b/apps/contract-verification/src/app/views/VerifyView.tsx index 46e0bc8ecd..f4999605a3 100644 --- a/apps/contract-verification/src/app/views/VerifyView.tsx +++ b/apps/contract-verification/src/app/views/VerifyView.tsx @@ -124,7 +124,7 @@ export const VerifyView = () => { })}
- + {/* */}
) diff --git a/apps/contract-verification/src/app/views/index.ts b/apps/contract-verification/src/app/views/index.ts index 7243595064..62916428af 100644 --- a/apps/contract-verification/src/app/views/index.ts +++ b/apps/contract-verification/src/app/views/index.ts @@ -1 +1,4 @@ export { VerifyView } from './VerifyView' +export { SettingsView } from './SettingsView' +export { LookupView } from './LookupView' +export { ReceiptsView } from './ReceiptsView'