Commit 7098908a authored by tom's avatar tom

replace hint with tag

parent ddef9dd1
...@@ -15,7 +15,7 @@ interface Props { ...@@ -15,7 +15,7 @@ interface Props {
const TxStateListItem = ({ data }: Props) => { const TxStateListItem = ({ data }: Props) => {
const { before, after, change, hint, tokenId } = getStateElements(data); const { before, after, change, tag, tokenId } = getStateElements(data);
return ( return (
<ListItemMobileGrid.Container> <ListItemMobileGrid.Container>
...@@ -24,8 +24,8 @@ const TxStateListItem = ({ data }: Props) => { ...@@ -24,8 +24,8 @@ const TxStateListItem = ({ data }: Props) => {
<ListItemMobileGrid.Value py="3px"> <ListItemMobileGrid.Value py="3px">
<Address flexGrow={ 1 } w="100%" alignSelf="center"> <Address flexGrow={ 1 } w="100%" alignSelf="center">
<AddressIcon address={ data.address }/> <AddressIcon address={ data.address }/>
<AddressLink type="address" hash={ data.address.hash } ml={ 2 } truncation="constant" mr="auto"/> <AddressLink type="address" hash={ data.address.hash } ml={ 2 } truncation="constant" mr={ 3 }/>
{ hint } { tag }
</Address> </Address>
</ListItemMobileGrid.Value> </ListItemMobileGrid.Value>
......
...@@ -20,7 +20,7 @@ const TxStateTable = ({ data }: Props) => { ...@@ -20,7 +20,7 @@ const TxStateTable = ({ data }: Props) => {
<Table variant="simple" minWidth="1000px" size="sm" w="auto" mt={ 6 }> <Table variant="simple" minWidth="1000px" size="sm" w="auto" mt={ 6 }>
<Thead top={ 0 }> <Thead top={ 0 }>
<Tr> <Tr>
<Th width="140px"/> <Th width="140px">Type</Th>
<Th width="146px">Address</Th> <Th width="146px">Address</Th>
<Th width="33%" isNumeric>Before</Th> <Th width="33%" isNumeric>Before</Th>
<Th width="33%" isNumeric>After</Th> <Th width="33%" isNumeric>After</Th>
......
...@@ -14,12 +14,12 @@ interface Props { ...@@ -14,12 +14,12 @@ interface Props {
} }
const TxStateTableItem = ({ data }: Props) => { const TxStateTableItem = ({ data }: Props) => {
const { before, after, change, hint, tokenId } = getStateElements(data); const { before, after, change, tag, tokenId } = getStateElements(data);
return ( return (
<Tr> <Tr>
<Td lineHeight="30px"> <Td lineHeight="30px">
{ hint || '-' } { tag || '-' }
</Td> </Td>
<Td> <Td>
<Address height="30px"> <Address height="30px">
......
import { Box, Flex } from '@chakra-ui/react'; import { Box, Flex, Tag, Tooltip } from '@chakra-ui/react';
import BigNumber from 'bignumber.js'; import BigNumber from 'bignumber.js';
import React from 'react'; import React from 'react';
...@@ -11,18 +11,16 @@ import { nbsp } from 'lib/html-entities'; ...@@ -11,18 +11,16 @@ import { nbsp } from 'lib/html-entities';
import getNetworkValidatorTitle from 'lib/networks/getNetworkValidatorTitle'; import getNetworkValidatorTitle from 'lib/networks/getNetworkValidatorTitle';
import trimTokenSymbol from 'lib/token/trimTokenSymbol'; import trimTokenSymbol from 'lib/token/trimTokenSymbol';
import AddressLink from 'ui/shared/address/AddressLink'; import AddressLink from 'ui/shared/address/AddressLink';
import Hint from 'ui/shared/Hint';
import TxStateTokenIdList from './TxStateTokenIdList'; import TxStateTokenIdList from './TxStateTokenIdList';
export function getStateElements(data: TxStateChange) { export function getStateElements(data: TxStateChange) {
const hint = (() => { const tag = (() => {
if (data.is_miner) { if (data.is_miner) {
return ( return (
<Flex align="center" columnGap={ 1 } flexDir={{ base: 'row-reverse', lg: 'row' }}> <Tooltip label="A block producer who successfully included the block into the blockchain">
<Hint label="A block producer who successfully included the block into the blockchain"/> <Tag textTransform="capitalize" colorScheme="yellow">{ getNetworkValidatorTitle() }</Tag>
<Box color="text_secondary" textTransform="capitalize">{ getNetworkValidatorTitle() }</Box> </Tooltip>
</Flex>
); );
} }
...@@ -31,10 +29,9 @@ export function getStateElements(data: TxStateChange) { ...@@ -31,10 +29,9 @@ export function getStateElements(data: TxStateChange) {
if (changeDirection) { if (changeDirection) {
const text = changeDirection === 'from' ? 'Mint' : 'Burn'; const text = changeDirection === 'from' ? 'Mint' : 'Burn';
return ( return (
<Flex align="center" columnGap={ 1 } flexDir={{ base: 'row-reverse', lg: 'row' }}> <Tooltip label="Address used in tokens mintings and burnings">
<Hint label="Address used in tokens mintings and burnings"/> <Tag textTransform="capitalize" colorScheme="yellow">{ text } address</Tag>
<Box color="text_secondary" whiteSpace="nowrap">{ text } address</Box> </Tooltip>
</Flex>
); );
} }
} }
...@@ -54,7 +51,7 @@ export function getStateElements(data: TxStateChange) { ...@@ -54,7 +51,7 @@ export function getStateElements(data: TxStateChange) {
before: <Box>{ beforeBn.toFormat() } { appConfig.network.currency.symbol }</Box>, before: <Box>{ beforeBn.toFormat() } { appConfig.network.currency.symbol }</Box>,
after: <Box>{ afterBn.toFormat() } { appConfig.network.currency.symbol }</Box>, after: <Box>{ afterBn.toFormat() } { appConfig.network.currency.symbol }</Box>,
change: <Box color={ changeColor }>{ changeSign }{ nbsp }{ differenceBn.abs().toFormat() }</Box>, change: <Box color={ changeColor }>{ changeSign }{ nbsp }{ differenceBn.abs().toFormat() }</Box>,
hint, tag,
}; };
} }
case 'token': { case 'token': {
...@@ -110,7 +107,7 @@ export function getStateElements(data: TxStateChange) { ...@@ -110,7 +107,7 @@ export function getStateElements(data: TxStateChange) {
</Flex> </Flex>
) : null, ) : null,
change, change,
hint, tag,
tokenId, tokenId,
}; };
} }
......
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