Skip to content

Commit 5f023fc

Browse files
authored
added CopyToClipboard option near the selected contract (#2417)
1 parent c1e74d7 commit 5f023fc

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

src/components/Proposal/Create/SchemeForms/CreateGenericMultiCallProposal.tsx

+17-12
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import MarkdownField from "./MarkdownField";
1515
import HelpButton from "components/Shared/HelpButton";
1616
import { getABIByContract, extractABIMethods, encodeABI } from "./ABIService";
1717
import * as Validators from "./Validators";
18+
import CopyToClipboard from "components/Shared/CopyToClipboard";
1819

1920
interface IExternalProps {
2021
daoAvatarAddress: string;
@@ -415,18 +416,22 @@ class CreateGenericMultiCallScheme extends React.Component<IProps, IStateProps>
415416
Contract Address
416417
<ErrorMessage name={`contracts.${index}.address`}>{(msg) => <span className={css.errorMessage}>{msg}</span>}</ErrorMessage>
417418
</label>
418-
<Field // eslint-disable-next-line react/jsx-no-bind
419-
onChange={async (e: any) => { setFieldValue(`contracts.${index}.address`, e.target.value); await this.getContractABI(e.target.value, setFieldValue, index, network); }}
420-
component="select"
421-
name={`contracts.${index}.address`}
422-
type="text"
423-
validate={Validators.requireValue}
424-
>
425-
<option value="" disabled>-- Choose contract --</option>
426-
<optgroup label={whitelistedContracts.length > 0 ? "Whitelisted contracts" : "Custom contracts"}>
427-
{contractsOptions}
428-
</optgroup>
429-
</Field>
419+
<div style={{ display: "flex" }}>
420+
<Field // eslint-disable-next-line react/jsx-no-bind
421+
onChange={async (e: any) => { setFieldValue(`contracts.${index}.address`, e.target.value); await this.getContractABI(e.target.value, setFieldValue, index, network); }}
422+
component="select"
423+
name={`contracts.${index}.address`}
424+
type="text"
425+
validate={Validators.requireValue}
426+
style={{ marginRight: "5px" }}
427+
>
428+
<option value="" disabled>-- Choose contract --</option>
429+
<optgroup label={whitelistedContracts.length > 0 ? "Whitelisted contracts" : "Custom contracts"}>
430+
{contractsOptions}
431+
</optgroup>
432+
</Field>
433+
<CopyToClipboard value={values.contracts[index].address} />
434+
</div>
430435
</div>
431436

432437
{

0 commit comments

Comments
 (0)