pull/174/head
Tim Pechersky 2021-08-25 14:29:49 +02:00
rodzic cd28ab3906
commit 35e83ed8da
2 zmienionych plików z 32 dodań i 32 usunięć

Wyświetl plik

@ -1,29 +1,29 @@
import React from "react"; import React from "react";
import { import { VStack, Code } from "@chakra-ui/react";
VStack,
Code,
} from "@chakra-ui/react";
import { Table, Thead, Tbody, Tr, Th, Td } from "@chakra-ui/react"; import { Table, Thead, Tbody, Tr, Th, Td } from "@chakra-ui/react";
const ContractSource = ({ source_info }) => { const ContractSource = ({ source_info }) => {
return ( return (
<VStack spacing={3}> <VStack spacing={3}>
<Table> <Table>
<Thead> <Thead>
<Tr> <Tr>
<Th>Contract Name</Th> <Th>Contract Name</Th>
<Th>Compiler version</Th> <Th>Compiler version</Th>
</Tr> </Tr>
</Thead> </Thead>
<Tbody> <Tbody>
<Tr key={source_info.name}> <Tr key={source_info.name}>
<Td>{source_info.name} </Td> <Td>{source_info.name} </Td>
<Td>{source_info.compiler_version}</Td> <Td>{source_info.compiler_version}</Td>
</Tr> </Tr>
</Tbody> </Tbody>
</Table> </Table>
<Code colorScheme="blackAlpha" w="110%" >{source_info.source_code}</Code> <Code colorScheme="blackAlpha" w="110%">
</VStack>) {source_info.source_code}
} </Code>
</VStack>
);
};
export default ContractSource; export default ContractSource;

Wyświetl plik

@ -9,7 +9,7 @@ import {
Box, Box,
VStack, VStack,
} from "@chakra-ui/react"; } from "@chakra-ui/react";
import ContractSource from './ContractSource' import ContractSource from "./ContractSource";
import { Table, Thead, Tbody, Tr, Th, Td } from "@chakra-ui/react"; import { Table, Thead, Tbody, Tr, Th, Td } from "@chakra-ui/react";
const toEth = (wei) => { const toEth = (wei) => {
return wei / Math.pow(10, 18); return wei / Math.pow(10, 18);
@ -95,13 +95,13 @@ const TxInfo = (props) => {
)} )}
</Tbody> </Tbody>
</Table> </Table>
{transaction.smart_contract_info && <ContractSource source_info={transaction.smart_contract_info} />} {transaction.smart_contract_info && (
{ <ContractSource source_info={transaction.smart_contract_info} />
transaction.tx.input && transaction.tx.input !== "0x" && ( )}
<TxABI byteCode={transaction.tx.input} abi={transaction.abi} /> {transaction.tx.input && transaction.tx.input !== "0x" && (
) <TxABI byteCode={transaction.tx.input} abi={transaction.abi} />
} )}
</Box > </Box>
); );
}; };
export default TxInfo; export default TxInfo;