Commit c5205fae authored by tom's avatar tom

verified tick and balance history fixes

parent cec4c351
...@@ -19,10 +19,6 @@ interface Props { ...@@ -19,10 +19,6 @@ interface Props {
tabs: Array<RoutedSubTab>; tabs: Array<RoutedSubTab>;
} }
const TAB_LIST_PROPS = {
columnGap: 3,
};
export const currentChain: Chain = { export const currentChain: Chain = {
id: Number(appConfig.network.id), id: Number(appConfig.network.id),
name: appConfig.network.name || '', name: appConfig.network.name || '',
...@@ -58,9 +54,12 @@ const wagmiClient = createClient({ ...@@ -58,9 +54,12 @@ const wagmiClient = createClient({
provider, provider,
}); });
// Web3Modal Ethereum Client
const ethereumClient = new EthereumClient(wagmiClient, chains); const ethereumClient = new EthereumClient(wagmiClient, chains);
const TAB_LIST_PROPS = {
columnGap: 3,
};
const AddressContract = ({ tabs }: Props) => { const AddressContract = ({ tabs }: Props) => {
const modalZIndex = useToken<string>('zIndices', 'modal'); const modalZIndex = useToken<string>('zIndices', 'modal');
......
...@@ -49,11 +49,11 @@ const AddressCoinBalanceHistory = ({ query }: Props) => { ...@@ -49,11 +49,11 @@ const AddressCoinBalanceHistory = ({ query }: Props) => {
<Table variant="simple" size="sm"> <Table variant="simple" size="sm">
<Thead top={ 80 }> <Thead top={ 80 }>
<Tr> <Tr>
<Th width="25%">Block</Th> <Th width="20%">Block</Th>
<Th width="25%">Txn</Th> <Th width="20%">Txn</Th>
<Th width="25%">Age</Th> <Th width="20%">Age</Th>
<Th width="25%" isNumeric pr={ 1 }/> <Th width="20%" isNumeric pr={ 1 }>Balance { appConfig.network.currency.symbol }</Th>
<Th width="120px" isNumeric>Balance { appConfig.network.currency.symbol }</Th> <Th width="20%" isNumeric>Delta</Th>
</Tr> </Tr>
</Thead> </Thead>
<Tbody> <Tbody>
......
...@@ -30,7 +30,7 @@ const AddressCoinBalanceListItem = (props: Props) => { ...@@ -30,7 +30,7 @@ const AddressCoinBalanceListItem = (props: Props) => {
<StatHelpText display="flex" mb={ 0 } alignItems="center"> <StatHelpText display="flex" mb={ 0 } alignItems="center">
<StatArrow type={ isPositiveDelta ? 'increase' : 'decrease' }/> <StatArrow type={ isPositiveDelta ? 'increase' : 'decrease' }/>
<Text as="span" color={ isPositiveDelta ? 'green.500' : 'red.500' } fontWeight={ 600 }> <Text as="span" color={ isPositiveDelta ? 'green.500' : 'red.500' } fontWeight={ 600 }>
{ deltaBn.toFixed(8) } { deltaBn.toFormat() }
</Text> </Text>
</StatHelpText> </StatHelpText>
</Stat> </Stat>
......
...@@ -46,7 +46,7 @@ const AddressCoinBalanceTableItem = (props: Props) => { ...@@ -46,7 +46,7 @@ const AddressCoinBalanceTableItem = (props: Props) => {
<StatHelpText display="flex" mb={ 0 } alignItems="center"> <StatHelpText display="flex" mb={ 0 } alignItems="center">
<StatArrow type={ isPositiveDelta ? 'increase' : 'decrease' }/> <StatArrow type={ isPositiveDelta ? 'increase' : 'decrease' }/>
<Text as="span" color={ isPositiveDelta ? 'green.500' : 'red.500' } fontWeight={ 600 }> <Text as="span" color={ isPositiveDelta ? 'green.500' : 'red.500' } fontWeight={ 600 }>
{ deltaBn.toFixed(8) } { deltaBn.toFormat() }
</Text> </Text>
</StatHelpText> </StatHelpText>
</Stat> </Stat>
......
import { Flex, Skeleton, Tag, Box } from '@chakra-ui/react'; import { Flex, Skeleton, Tag, Box, Icon } from '@chakra-ui/react';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import React from 'react'; import React from 'react';
import type { RoutedTab } from 'ui/shared/RoutedTabs/types'; import type { RoutedTab } from 'ui/shared/RoutedTabs/types';
import iconSuccess from 'icons/status/success.svg';
import useApiQuery from 'lib/api/useApiQuery'; import useApiQuery from 'lib/api/useApiQuery';
import notEmpty from 'lib/notEmpty'; import notEmpty from 'lib/notEmpty';
import AddressBlocksValidated from 'ui/address/AddressBlocksValidated'; import AddressBlocksValidated from 'ui/address/AddressBlocksValidated';
...@@ -81,7 +82,18 @@ const AddressPageContent = () => { ...@@ -81,7 +82,18 @@ const AddressPageContent = () => {
addressQuery.data?.has_logs ? { id: 'logs', title: 'Logs', component: <AddressLogs scrollRef={ tabsScrollRef }/> } : undefined, addressQuery.data?.has_logs ? { id: 'logs', title: 'Logs', component: <AddressLogs scrollRef={ tabsScrollRef }/> } : undefined,
addressQuery.data?.is_contract ? { addressQuery.data?.is_contract ? {
id: 'contract', id: 'contract',
title: 'Contract', title: () => {
if (addressQuery.data.is_verified) {
return (
<>
<span>Contract</span>
<Icon as={ iconSuccess } boxSize="14px" color="green.500" ml={ 1 }/>
</>
);
}
return 'Contract';
},
component: <AddressContract tabs={ contractTabs }/>, component: <AddressContract tabs={ contractTabs }/>,
subTabs: contractTabs, subTabs: contractTabs,
} : undefined, } : undefined,
......
...@@ -31,7 +31,7 @@ const hiddenItemStyles: StyleProps = { ...@@ -31,7 +31,7 @@ const hiddenItemStyles: StyleProps = {
interface Props extends ThemingProps<'Tabs'> { interface Props extends ThemingProps<'Tabs'> {
tabs: Array<RoutedTab>; tabs: Array<RoutedTab>;
tabListProps?: ChakraProps; tabListProps?: ChakraProps | (({ isSticky }: { isSticky: boolean }) => ChakraProps);
rightSlot?: React.ReactNode; rightSlot?: React.ReactNode;
stickyEnabled?: boolean; stickyEnabled?: boolean;
className?: string; className?: string;
...@@ -130,7 +130,7 @@ const RoutedTabs = ({ tabs, tabListProps, rightSlot, stickyEnabled, className, . ...@@ -130,7 +130,7 @@ const RoutedTabs = ({ tabs, tabListProps, rightSlot, stickyEnabled, className, .
zIndex: { base: 'sticky2', lg: 'docked' }, zIndex: { base: 'sticky2', lg: 'docked' },
} : { }) } : { })
} }
{ ...tabListProps } { ...(typeof tabListProps === 'function' ? tabListProps({ isSticky }) : tabListProps) }
> >
{ tabsList.map((tab, index) => { { tabsList.map((tab, index) => {
if (!tab.id) { if (!tab.id) {
...@@ -162,7 +162,7 @@ const RoutedTabs = ({ tabs, tabListProps, rightSlot, stickyEnabled, className, . ...@@ -162,7 +162,7 @@ const RoutedTabs = ({ tabs, tabListProps, rightSlot, stickyEnabled, className, .
scrollSnapAlign="start" scrollSnapAlign="start"
flexShrink={ 0 } flexShrink={ 0 }
> >
{ tab.title } { typeof tab.title === 'function' ? tab.title() : tab.title }
</Tab> </Tab>
); );
}) } }) }
......
import type React from 'react';
export interface RoutedTab { export interface RoutedTab {
id: string; id: string;
title: string; title: string | (() => React.ReactNode);
component: React.ReactNode; component: React.ReactNode;
subTabs?: Array<RoutedSubTab>; subTabs?: Array<RoutedSubTab>;
} }
......
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