Commit 4aa73bbe authored by tom's avatar tom

markup fixes

parent 864a2aef
...@@ -15,18 +15,17 @@ type Props = TTokenTransfer; ...@@ -15,18 +15,17 @@ type Props = TTokenTransfer;
const TxDetailsTokenTransfer = ({ token, total, to, from }: Props) => { const TxDetailsTokenTransfer = ({ token, total, to, from }: Props) => {
const isColumnLayout = token.type === 'ERC-1155' && Array.isArray(total); const isColumnLayout = token.type === 'ERC-1155' && Array.isArray(total);
const tokenSnippet = <TokenSnippet symbol={ token.symbol } hash={ token.address } name={ token.name } ml={ 3 }/>;
const content = (() => { const content = (() => {
switch (token.type) { switch (token.type) {
case 'ERC-20': { case 'ERC-20': {
const payload = total as Erc20TotalPayload; const payload = total as Erc20TotalPayload;
return ( return (
<Flex> <Flex flexWrap="wrap" columnGap={ 3 } rowGap={ 2 }>
<Text fontWeight={ 500 } as="span">For:{ space } <Text fontWeight={ 500 } as="span">For:{ space }
<CurrencyValue value={ payload.value } exchangeRate={ token.exchange_rate } fontWeight={ 600 }/> <CurrencyValue value={ payload.value } exchangeRate={ token.exchange_rate } fontWeight={ 600 }/>
</Text> </Text>
{ tokenSnippet } <TokenSnippet symbol={ token.symbol } hash={ token.address } name={ token.name } w="auto" flexGrow="1"/>
</Flex> </Flex>
); );
} }
......
import { Flex, useColorModeValue } from '@chakra-ui/react'; import { Flex, useColorModeValue } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import type { TokenTransfer as TTokenTransfer } from 'types/api/tokenTransfer'; import type { TokenTransfer } from 'types/api/tokenTransfer';
import TokenTransfer from './TxDetailsTokenTransfer'; import TxDetailsTokenTransfer from './TxDetailsTokenTransfer';
interface Props { interface Props {
items: Array<TTokenTransfer>; items: Array<TokenTransfer>;
} }
function getItemsNum(items: Array<TTokenTransfer>) { function getItemsNum(items: Array<TokenTransfer>) {
const nonErc1155items = items.filter((item) => item.token.type !== 'ERC-1155').length; const nonErc1155items = items.filter((item) => item.token.type !== 'ERC-1155').length;
const erc1155items = items const erc1155items = items
.filter((item) => item.token.type === 'ERC-1155') .filter((item) => item.token.type === 'ERC-1155')
...@@ -52,7 +52,7 @@ const TxDetailsTokenTransferList = ({ items }: Props) => { ...@@ -52,7 +52,7 @@ const TxDetailsTokenTransferList = ({ items }: Props) => {
pr={ hasScroll ? 5 : 0 } pr={ hasScroll ? 5 : 0 }
pb={ hasScroll ? 10 : 0 } pb={ hasScroll ? 10 : 0 }
> >
{ items.map((item, index) => <TokenTransfer key={ index } { ...item }/>) } { items.map((item, index) => <TxDetailsTokenTransfer key={ index } { ...item }/>) }
</Flex> </Flex>
); );
}; };
......
...@@ -38,7 +38,7 @@ const TxDetailsTokenTransfers = ({ data, txHash }: Props) => { ...@@ -38,7 +38,7 @@ const TxDetailsTokenTransfers = ({ data, txHash }: Props) => {
title={ ( title={ (
<> <>
<Text as="span">{ title }</Text> <Text as="span">{ title }</Text>
{ items.length > 1 && <Text as="span" whiteSpace="pre" variant="secondary"> ({ items.length })</Text> } <Text as="span" whiteSpace="pre" variant="secondary"> ({ items.length })</Text>
</> </>
) } ) }
hint={ hint } hint={ hint }
......
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