mirror of
https://github.com/hanzonet/explore.git
synced 2026-10-30 18:16:57 +00:00
* add support for array of implementations * refactor ContainerWithScrollY component * contract source code: allow to choose between all implementations * fix layout of AddressNetWorth component * add scroll container to implementation address on write/read proxy contract tab * update screenshots
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import { Flex } from '@chakra-ui/react';
|
|
import { useRouter } from 'next/router';
|
|
import React from 'react';
|
|
|
|
import { useAppContext } from 'lib/contexts/app';
|
|
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
|
|
import PageTitle from 'ui/shared/Page/PageTitle';
|
|
import Sol2UmlDiagram from 'ui/sol2uml/Sol2UmlDiagram';
|
|
|
|
const Sol2Uml = () => {
|
|
const router = useRouter();
|
|
const appProps = useAppContext();
|
|
|
|
const addressHash = router.query.address?.toString() || '';
|
|
|
|
const backLink = React.useMemo(() => {
|
|
const hasGoBackLink = appProps.referrer && appProps.referrer.includes('/address');
|
|
|
|
if (!hasGoBackLink) {
|
|
return;
|
|
}
|
|
|
|
return {
|
|
label: 'Back to address',
|
|
url: appProps.referrer,
|
|
};
|
|
}, [ appProps.referrer ]);
|
|
|
|
return (
|
|
<>
|
|
<PageTitle
|
|
title="Solidity UML diagram"
|
|
backLink={ backLink }
|
|
/>
|
|
<Flex mb={ 10 } flexWrap="wrap" columnGap={ 3 }>
|
|
<span>For contract</span>
|
|
<AddressEntity
|
|
address={{ hash: addressHash, is_contract: true }}
|
|
/>
|
|
</Flex>
|
|
<Sol2UmlDiagram addressHash={ addressHash }/>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default Sol2Uml;
|