Commit 50e40510 authored by tom's avatar tom

contract fixes

parent 7713a84e
...@@ -137,7 +137,7 @@ const ContractMethodCallable = <T extends SmartContractMethod>({ data, onSubmit, ...@@ -137,7 +137,7 @@ const ContractMethodCallable = <T extends SmartContractMethod>({ data, onSubmit,
{ isWrite ? 'Write' : 'Query' } { isWrite ? 'Write' : 'Query' }
</Button> </Button>
</chakra.form> </chakra.form>
{ 'outputs' in data && data.outputs.length > 0 && ( { 'outputs' in data && !isWrite && data.outputs.length > 0 && (
<Flex mt={ 3 }> <Flex mt={ 3 }>
<Icon as={ arrowIcon } boxSize={ 5 } mr={ 1 }/> <Icon as={ arrowIcon } boxSize={ 5 } mr={ 1 }/>
<Text>{ data.outputs.map(({ type }) => type).join(', ') }</Text> <Text>{ data.outputs.map(({ type }) => type).join(', ') }</Text>
......
...@@ -7,7 +7,9 @@ import type { SmartContractMethodOutput } from 'types/api/contract'; ...@@ -7,7 +7,9 @@ import type { SmartContractMethodOutput } from 'types/api/contract';
import appConfig from 'configs/app/config'; import appConfig from 'configs/app/config';
import { WEI } from 'lib/consts'; import { WEI } from 'lib/consts';
import Address from 'ui/shared/address/Address';
import AddressLink from 'ui/shared/address/AddressLink'; import AddressLink from 'ui/shared/address/AddressLink';
import CopyToClipboard from 'ui/shared/CopyToClipboard';
interface Props { interface Props {
data: SmartContractMethodOutput; data: SmartContractMethodOutput;
...@@ -34,7 +36,12 @@ const ContractMethodStatic = ({ data }: Props) => { ...@@ -34,7 +36,12 @@ const ContractMethodStatic = ({ data }: Props) => {
const content = (() => { const content = (() => {
if (data.type === 'address' && data.value) { if (data.type === 'address' && data.value) {
return <AddressLink type="address" hash={ data.value }/>; return (
<Address>
<AddressLink type="address" hash={ data.value }/>
<CopyToClipboard text={ data.value }/>
</Address>
);
} }
return <chakra.span wordBreak="break-all">({ data.type }): { value }</chakra.span>; return <chakra.span wordBreak="break-all">({ data.type }): { value }</chakra.span>;
......
...@@ -84,10 +84,9 @@ const ContractVerificationForm = ({ method: methodFromQuery, config, hash }: Pro ...@@ -84,10 +84,9 @@ const ContractVerificationForm = ({ method: methodFromQuery, config, hash }: Pro
status: 'success', status: 'success',
variant: 'subtle', variant: 'subtle',
isClosable: true, isClosable: true,
onCloseComplete: () => {
router.push({ pathname: '/address/[hash]', query: { hash, tab: 'contract' } }, undefined, { shallow: true });
},
}); });
router.push({ pathname: '/address/[hash]', query: { hash, tab: 'contract' } }, undefined, { shallow: false });
}, [ hash, router, setError, toast ]); }, [ hash, router, setError, toast ]);
const handleSocketError = React.useCallback(() => { const handleSocketError = React.useCallback(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment