Commit af0c5381 authored by tom's avatar tom

fix padding for page tabs

parent e4ef1455
...@@ -9,6 +9,7 @@ import BeaconChainWithdrawalsTable from 'ui/withdrawals/beaconChain/BeaconChainW ...@@ -9,6 +9,7 @@ import BeaconChainWithdrawalsTable from 'ui/withdrawals/beaconChain/BeaconChainW
type Props = { type Props = {
blockWithdrawalsQuery: QueryWithPagesResult<'block_withdrawals'>; blockWithdrawalsQuery: QueryWithPagesResult<'block_withdrawals'>;
} }
const TABS_HEIGHT = 88;
const BlockWithdrawals = ({ blockWithdrawalsQuery }: Props) => { const BlockWithdrawals = ({ blockWithdrawalsQuery }: Props) => {
const content = blockWithdrawalsQuery.data?.items ? ( const content = blockWithdrawalsQuery.data?.items ? (
...@@ -24,7 +25,7 @@ const BlockWithdrawals = ({ blockWithdrawalsQuery }: Props) => { ...@@ -24,7 +25,7 @@ const BlockWithdrawals = ({ blockWithdrawalsQuery }: Props) => {
<BeaconChainWithdrawalsTable <BeaconChainWithdrawalsTable
items={ blockWithdrawalsQuery.data.items } items={ blockWithdrawalsQuery.data.items }
isLoading={ blockWithdrawalsQuery.isPlaceholderData } isLoading={ blockWithdrawalsQuery.isPlaceholderData }
top={ blockWithdrawalsQuery.pagination.isVisible ? 76 : 0 } top={ blockWithdrawalsQuery.pagination.isVisible ? TABS_HEIGHT : 0 }
view="block" view="block"
/> />
</Hide> </Hide>
......
...@@ -18,6 +18,7 @@ import type { QueryWithPagesResult } from 'ui/shared/pagination/useQueryWithPage ...@@ -18,6 +18,7 @@ import type { QueryWithPagesResult } from 'ui/shared/pagination/useQueryWithPage
import * as SocketNewItemsNotice from 'ui/shared/SocketNewItemsNotice'; import * as SocketNewItemsNotice from 'ui/shared/SocketNewItemsNotice';
const OVERLOAD_COUNT = 75; const OVERLOAD_COUNT = 75;
const TABS_HEIGHT = 88;
interface Props { interface Props {
type?: BlockType; type?: BlockType;
...@@ -95,7 +96,7 @@ const BlocksContent = ({ type, query }: Props) => { ...@@ -95,7 +96,7 @@ const BlocksContent = ({ type, query }: Props) => {
<Box display={{ base: 'none', lg: 'block' }}> <Box display={{ base: 'none', lg: 'block' }}>
<BlocksTable <BlocksTable
data={ query.data.items } data={ query.data.items }
top={ query.pagination.isVisible ? 76 : 0 } top={ query.pagination.isVisible ? TABS_HEIGHT : 0 }
page={ query.pagination.page } page={ query.pagination.page }
isLoading={ query.isPlaceholderData } isLoading={ query.isPlaceholderData }
showSocketInfo={ query.pagination.page === 1 } showSocketInfo={ query.pagination.page === 1 }
......
...@@ -30,9 +30,10 @@ import TxsWithFrontendSorting from 'ui/txs/TxsWithFrontendSorting'; ...@@ -30,9 +30,10 @@ import TxsWithFrontendSorting from 'ui/txs/TxsWithFrontendSorting';
const TAB_LIST_PROPS = { const TAB_LIST_PROPS = {
marginBottom: 0, marginBottom: 0,
pt: 6, pt: 6,
pb: 3, pb: 6,
marginTop: -5, marginTop: -5,
}; };
const TABS_HEIGHT = 88;
const BlockPageContent = () => { const BlockPageContent = () => {
const router = useRouter(); const router = useRouter();
...@@ -63,7 +64,7 @@ const BlockPageContent = () => { ...@@ -63,7 +64,7 @@ const BlockPageContent = () => {
component: ( component: (
<> <>
{ blockTxsQuery.isDegradedData && <ServiceDegradationWarning isLoading={ blockTxsQuery.isPlaceholderData } mb={ 6 }/> } { blockTxsQuery.isDegradedData && <ServiceDegradationWarning isLoading={ blockTxsQuery.isPlaceholderData } mb={ 6 }/> }
<TxsWithFrontendSorting query={ blockTxsQuery } showBlockInfo={ false } showSocketInfo={ false } top={ 76 }/> <TxsWithFrontendSorting query={ blockTxsQuery } showBlockInfo={ false } showSocketInfo={ false } top={ TABS_HEIGHT }/>
</> </>
), ),
}, },
...@@ -72,7 +73,7 @@ const BlockPageContent = () => { ...@@ -72,7 +73,7 @@ const BlockPageContent = () => {
id: 'blob_txs', id: 'blob_txs',
title: 'Blob txns', title: 'Blob txns',
component: ( component: (
<TxsWithFrontendSorting query={ blockBlobTxsQuery } showBlockInfo={ false } showSocketInfo={ false } top={ 76 }/> <TxsWithFrontendSorting query={ blockBlobTxsQuery } showBlockInfo={ false } showSocketInfo={ false }/>
), ),
} : null, } : null,
config.features.beaconChain.isEnabled && Boolean(blockQuery.data?.withdrawals_count) ? config.features.beaconChain.isEnabled && Boolean(blockQuery.data?.withdrawals_count) ?
......
...@@ -16,7 +16,7 @@ import RoutedTabs from 'ui/shared/Tabs/RoutedTabs'; ...@@ -16,7 +16,7 @@ import RoutedTabs from 'ui/shared/Tabs/RoutedTabs';
const TAB_LIST_PROPS = { const TAB_LIST_PROPS = {
marginBottom: 0, marginBottom: 0,
pt: 6, pt: 6,
pb: 3, pb: 6,
marginTop: -5, marginTop: -5,
}; };
......
import { Box, Flex } from '@chakra-ui/react'; import { Box, Flex, Heading } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import config from 'configs/app'; import config from 'configs/app';
...@@ -27,7 +27,7 @@ const Home = () => { ...@@ -27,7 +27,7 @@ const Home = () => {
data-label="hero plate" data-label="hero plate"
> >
<Flex mb={{ base: 2, lg: 6 }} justifyContent="space-between" alignItems="center"> <Flex mb={{ base: 2, lg: 6 }} justifyContent="space-between" alignItems="center">
<Box <Heading
as="h1" as="h1"
fontSize={{ base: '18px', lg: '40px' }} fontSize={{ base: '18px', lg: '40px' }}
lineHeight={{ base: '24px', lg: '48px' }} lineHeight={{ base: '24px', lg: '48px' }}
...@@ -39,7 +39,7 @@ const Home = () => { ...@@ -39,7 +39,7 @@ const Home = () => {
`${ config.chain.name } blockchain explorer` : `${ config.chain.name } blockchain explorer` :
`${ config.chain.name } explorer` `${ config.chain.name } explorer`
} }
</Box> </Heading>
<Box display={{ base: 'none', lg: 'flex' }}> <Box display={{ base: 'none', lg: 'flex' }}>
{ config.features.account.isEnabled && <ProfileMenuDesktop isHomePage/> } { config.features.account.isEnabled && <ProfileMenuDesktop isHomePage/> }
{ config.features.blockchainInteraction.isEnabled && <WalletMenuDesktop isHomePage/> } { config.features.blockchainInteraction.isEnabled && <WalletMenuDesktop isHomePage/> }
......
...@@ -218,7 +218,7 @@ const TokenPageContent = () => { ...@@ -218,7 +218,7 @@ const TokenPageContent = () => {
return { return {
pt: 6, pt: 6,
pb: 3, pb: 6,
marginBottom: 0, marginBottom: 0,
boxShadow: activeTabIndex === 2 && isSticky ? 'action_bar' : 'none', boxShadow: activeTabIndex === 2 && isSticky ? 'action_bar' : 'none',
}; };
......
...@@ -26,10 +26,12 @@ import { SORT_OPTIONS, getTokenFilterValue, getBridgedChainsFilterValue } from ' ...@@ -26,10 +26,12 @@ import { SORT_OPTIONS, getTokenFilterValue, getBridgedChainsFilterValue } from '
const TAB_LIST_PROPS = { const TAB_LIST_PROPS = {
marginBottom: 0, marginBottom: 0,
py: 5, pt: 6,
pb: 6,
marginTop: -5, marginTop: -5,
alignItems: 'center', alignItems: 'center',
}; };
const TABS_HEIGHT = 88;
const TABS_RIGHT_SLOT_PROPS = { const TABS_RIGHT_SLOT_PROPS = {
ml: 8, ml: 8,
...@@ -101,6 +103,8 @@ const Tokens = () => { ...@@ -101,6 +103,8 @@ const Tokens = () => {
setBridgeChains(undefined); setBridgeChains(undefined);
}, []); }, []);
const hasMultipleTabs = bridgedTokensFeature.isEnabled;
const filter = tab === 'bridged' ? ( const filter = tab === 'bridged' ? (
<PopoverFilter isActive={ bridgeChains && bridgeChains.length > 0 } contentProps={{ maxW: '350px' }} appliedFiltersNum={ bridgeChains?.length }> <PopoverFilter isActive={ bridgeChains && bridgeChains.length > 0 } contentProps={{ maxW: '350px' }} appliedFiltersNum={ bridgeChains?.length }>
<TokensBridgedChainsFilter onChange={ handleBridgeChainsChange } defaultValue={ bridgeChains }/> <TokensBridgedChainsFilter onChange={ handleBridgeChainsChange } defaultValue={ bridgeChains }/>
...@@ -120,7 +124,7 @@ const Tokens = () => { ...@@ -120,7 +124,7 @@ const Tokens = () => {
onSearchChange={ handleSearchTermChange } onSearchChange={ handleSearchTermChange }
sort={ sort } sort={ sort }
onSortChange={ handleSortChange } onSortChange={ handleSortChange }
inTabsSlot={ !isMobile && bridgedTokensFeature.isEnabled } inTabsSlot={ !isMobile && hasMultipleTabs }
/> />
); );
...@@ -151,6 +155,7 @@ const Tokens = () => { ...@@ -151,6 +155,7 @@ const Tokens = () => {
onSortChange={ handleSortChange } onSortChange={ handleSortChange }
actionBar={ isMobile ? actionBar : null } actionBar={ isMobile ? actionBar : null }
hasActiveFilters={ Boolean(searchTerm || tokenTypes) } hasActiveFilters={ Boolean(searchTerm || tokenTypes) }
tableTop={ hasMultipleTabs ? TABS_HEIGHT : undefined }
/> />
), ),
}, },
...@@ -165,6 +170,7 @@ const Tokens = () => { ...@@ -165,6 +170,7 @@ const Tokens = () => {
actionBar={ isMobile ? actionBar : null } actionBar={ isMobile ? actionBar : null }
hasActiveFilters={ Boolean(searchTerm || bridgeChains) } hasActiveFilters={ Boolean(searchTerm || bridgeChains) }
description={ description } description={ description }
tableTop={ hasMultipleTabs ? TABS_HEIGHT : undefined }
/> />
), ),
} : undefined, } : undefined,
...@@ -176,11 +182,11 @@ const Tokens = () => { ...@@ -176,11 +182,11 @@ const Tokens = () => {
title={ config.meta.seo.enhancedDataEnabled ? `Tokens on ${ config.chain.name }` : 'Tokens' } title={ config.meta.seo.enhancedDataEnabled ? `Tokens on ${ config.chain.name }` : 'Tokens' }
withTextAd withTextAd
/> />
{ tabs.length === 1 && !isMobile && actionBar } { !hasMultipleTabs && !isMobile && actionBar }
<RoutedTabs <RoutedTabs
tabs={ tabs } tabs={ tabs }
tabListProps={ isMobile ? undefined : TAB_LIST_PROPS } tabListProps={ isMobile ? undefined : TAB_LIST_PROPS }
rightSlot={ !isMobile ? actionBar : null } rightSlot={ hasMultipleTabs && !isMobile ? actionBar : null }
rightSlotProps={ !isMobile ? TABS_RIGHT_SLOT_PROPS : undefined } rightSlotProps={ !isMobile ? TABS_RIGHT_SLOT_PROPS : undefined }
stickyEnabled={ !isMobile } stickyEnabled={ !isMobile }
onTabChange={ handleTabChange } onTabChange={ handleTabChange }
......
...@@ -21,9 +21,10 @@ import TxsWithFrontendSorting from 'ui/txs/TxsWithFrontendSorting'; ...@@ -21,9 +21,10 @@ import TxsWithFrontendSorting from 'ui/txs/TxsWithFrontendSorting';
const TAB_LIST_PROPS = { const TAB_LIST_PROPS = {
marginBottom: 0, marginBottom: 0,
pt: 6, pt: 6,
pb: 3, pb: 6,
marginTop: -5, marginTop: -5,
}; };
const TABS_HEIGHT = 88;
const Transactions = () => { const Transactions = () => {
const verifiedTitle = config.chain.verificationType === 'validation' ? 'Validated' : 'Mined'; const verifiedTitle = config.chain.verificationType === 'validation' ? 'Validated' : 'Mined';
...@@ -97,7 +98,7 @@ const Transactions = () => { ...@@ -97,7 +98,7 @@ const Transactions = () => {
showSocketInfo={ txsValidatedQuery.pagination.page === 1 } showSocketInfo={ txsValidatedQuery.pagination.page === 1 }
socketInfoNum={ num } socketInfoNum={ num }
socketInfoAlert={ socketAlert } socketInfoAlert={ socketAlert }
top={ 76 } top={ TABS_HEIGHT }
/> }, /> },
{ {
id: 'pending', id: 'pending',
...@@ -109,7 +110,7 @@ const Transactions = () => { ...@@ -109,7 +110,7 @@ const Transactions = () => {
showSocketInfo={ txsPendingQuery.pagination.page === 1 } showSocketInfo={ txsPendingQuery.pagination.page === 1 }
socketInfoNum={ num } socketInfoNum={ num }
socketInfoAlert={ socketAlert } socketInfoAlert={ socketAlert }
top={ 76 } top={ TABS_HEIGHT }
/> />
), ),
}, },
...@@ -122,7 +123,7 @@ const Transactions = () => { ...@@ -122,7 +123,7 @@ const Transactions = () => {
showSocketInfo={ txsWithBlobsQuery.pagination.page === 1 } showSocketInfo={ txsWithBlobsQuery.pagination.page === 1 }
socketInfoNum={ num } socketInfoNum={ num }
socketInfoAlert={ socketAlert } socketInfoAlert={ socketAlert }
top={ 76 } top={ TABS_HEIGHT }
/> />
), ),
}, },
......
...@@ -15,6 +15,8 @@ import type { QueryWithPagesResult } from 'ui/shared/pagination/useQueryWithPage ...@@ -15,6 +15,8 @@ import type { QueryWithPagesResult } from 'ui/shared/pagination/useQueryWithPage
import TokenHoldersList from './TokenHoldersList'; import TokenHoldersList from './TokenHoldersList';
import TokenHoldersTable from './TokenHoldersTable'; import TokenHoldersTable from './TokenHoldersTable';
const TABS_HEIGHT = 88;
type Props = { type Props = {
token?: TokenInfo; token?: TokenInfo;
holdersQuery: QueryWithPagesResult<'token_holders'>; holdersQuery: QueryWithPagesResult<'token_holders'>;
...@@ -52,7 +54,7 @@ const TokenHoldersContent = ({ holdersQuery, token, shouldRender = true }: Props ...@@ -52,7 +54,7 @@ const TokenHoldersContent = ({ holdersQuery, token, shouldRender = true }: Props
<TokenHoldersTable <TokenHoldersTable
data={ items } data={ items }
token={ token } token={ token }
top={ holdersQuery.pagination.isVisible ? 76 : 0 } top={ holdersQuery.pagination.isVisible ? TABS_HEIGHT : 0 }
isLoading={ holdersQuery.isPlaceholderData } isLoading={ holdersQuery.isPlaceholderData }
/> />
</Box> </Box>
......
...@@ -10,7 +10,7 @@ import TokenHoldersTable from './TokenHoldersTable'; ...@@ -10,7 +10,7 @@ import TokenHoldersTable from './TokenHoldersTable';
test('base view without IDs', async({ render }) => { test('base view without IDs', async({ render }) => {
const component = await render( const component = await render(
<Box pt="128px"> <Box pt="128px">
<TokenHoldersTable data={ tokenHoldersERC20.items } token={ tokenInfo } top={ 76 }/> <TokenHoldersTable data={ tokenHoldersERC20.items } token={ tokenInfo } top={ 88 }/>
</Box>, </Box>,
); );
...@@ -20,7 +20,7 @@ test('base view without IDs', async({ render }) => { ...@@ -20,7 +20,7 @@ test('base view without IDs', async({ render }) => {
test('base view with IDs', async({ render }) => { test('base view with IDs', async({ render }) => {
const component = await render( const component = await render(
<Box pt="128px"> <Box pt="128px">
<TokenHoldersTable data={ tokenHoldersERC1155.items } token={ tokenInfoERC1155a } top={ 76 }/> <TokenHoldersTable data={ tokenHoldersERC1155.items } token={ tokenInfoERC1155a } top={ 88 }/>
</Box>, </Box>,
); );
......
...@@ -18,6 +18,8 @@ import * as SocketNewItemsNotice from 'ui/shared/SocketNewItemsNotice'; ...@@ -18,6 +18,8 @@ import * as SocketNewItemsNotice from 'ui/shared/SocketNewItemsNotice';
import TokenTransferList from 'ui/token/TokenTransfer/TokenTransferList'; import TokenTransferList from 'ui/token/TokenTransfer/TokenTransferList';
import TokenTransferTable from 'ui/token/TokenTransfer/TokenTransferTable'; import TokenTransferTable from 'ui/token/TokenTransfer/TokenTransferTable';
const TABS_HEIGHT = 88;
type Props = { type Props = {
transfersQuery: QueryWithPagesResult<'token_transfers'> | QueryWithPagesResult<'token_instance_transfers'>; transfersQuery: QueryWithPagesResult<'token_transfers'> | QueryWithPagesResult<'token_instance_transfers'>;
tokenId?: string; tokenId?: string;
...@@ -67,7 +69,7 @@ const TokenTransfer = ({ transfersQuery, tokenId, token, shouldRender = true }: ...@@ -67,7 +69,7 @@ const TokenTransfer = ({ transfersQuery, tokenId, token, shouldRender = true }:
<Box display={{ base: 'none', lg: 'block' }}> <Box display={{ base: 'none', lg: 'block' }}>
<TokenTransferTable <TokenTransferTable
data={ data?.items } data={ data?.items }
top={ pagination.isVisible ? 76 : 0 } top={ pagination.isVisible ? TABS_HEIGHT : 0 }
showSocketInfo={ pagination.page === 1 } showSocketInfo={ pagination.page === 1 }
socketInfoAlert={ socketAlert } socketInfoAlert={ socketAlert }
socketInfoNum={ newItemsCount } socketInfoNum={ newItemsCount }
......
...@@ -18,9 +18,10 @@ interface Props { ...@@ -18,9 +18,10 @@ interface Props {
actionBar?: React.ReactNode; actionBar?: React.ReactNode;
hasActiveFilters: boolean; hasActiveFilters: boolean;
description?: React.ReactNode; description?: React.ReactNode;
tableTop?: number;
} }
const Tokens = ({ query, onSortChange, sort, actionBar, description, hasActiveFilters }: Props) => { const Tokens = ({ query, onSortChange, sort, actionBar, description, hasActiveFilters, tableTop }: Props) => {
const { isError, isPlaceholderData, data, pagination } = query; const { isError, isPlaceholderData, data, pagination } = query;
...@@ -50,6 +51,7 @@ const Tokens = ({ query, onSortChange, sort, actionBar, description, hasActiveFi ...@@ -50,6 +51,7 @@ const Tokens = ({ query, onSortChange, sort, actionBar, description, hasActiveFi
isLoading={ isPlaceholderData } isLoading={ isPlaceholderData }
setSorting={ onSortChange } setSorting={ onSortChange }
sorting={ sort } sorting={ sort }
top={ tableTop }
/> />
</Hide> </Hide>
</> </>
......
...@@ -53,7 +53,7 @@ const TokensActionBar = ({ ...@@ -53,7 +53,7 @@ const TokensActionBar = ({
</HStack> </HStack>
<ActionBar <ActionBar
mt={ inTabsSlot ? 0 : -6 } mt={ inTabsSlot ? 0 : -6 }
py={ inTabsSlot ? 0 : undefined } py={{ lg: inTabsSlot ? 0 : undefined }}
justifyContent={ inTabsSlot ? 'space-between' : undefined } justifyContent={ inTabsSlot ? 'space-between' : undefined }
display={{ base: pagination.isVisible ? 'flex' : 'none', lg: 'flex' }} display={{ base: pagination.isVisible ? 'flex' : 'none', lg: 'flex' }}
> >
......
...@@ -25,9 +25,10 @@ type Props = { ...@@ -25,9 +25,10 @@ type Props = {
sorting?: TokensSortingValue; sorting?: TokensSortingValue;
setSorting: (val?: TokensSortingValue) => void; setSorting: (val?: TokensSortingValue) => void;
isLoading?: boolean; isLoading?: boolean;
top?: number;
} }
const TokensTable = ({ items, page, isLoading, sorting, setSorting }: Props) => { const TokensTable = ({ items, page, isLoading, sorting, setSorting, top }: Props) => {
const sortIconTransform = sorting?.includes('asc') ? 'rotate(-90deg)' : 'rotate(90deg)'; const sortIconTransform = sorting?.includes('asc') ? 'rotate(-90deg)' : 'rotate(90deg)';
const sort = React.useCallback((field: TokensSortingField) => () => { const sort = React.useCallback((field: TokensSortingField) => () => {
...@@ -37,7 +38,7 @@ const TokensTable = ({ items, page, isLoading, sorting, setSorting }: Props) => ...@@ -37,7 +38,7 @@ const TokensTable = ({ items, page, isLoading, sorting, setSorting }: Props) =>
return ( return (
<Table> <Table>
<Thead top={ ACTION_BAR_HEIGHT_DESKTOP }> <Thead top={ top ?? ACTION_BAR_HEIGHT_DESKTOP }>
<Tr> <Tr>
<Th w="50%">Token</Th> <Th w="50%">Token</Th>
<Th isNumeric w="15%"> <Th isNumeric w="15%">
......
...@@ -10,7 +10,7 @@ type Props = { ...@@ -10,7 +10,7 @@ type Props = {
const TxsWatchlist = ({ query }: Props) => { const TxsWatchlist = ({ query }: Props) => {
useRedirectForInvalidAuthToken(); useRedirectForInvalidAuthToken();
return <TxsWithFrontendSorting query={ query } showSocketInfo={ false } top={ 76 }/>; return <TxsWithFrontendSorting query={ query } showSocketInfo={ false } top={ 88 }/>;
}; };
export default TxsWatchlist; export default TxsWatchlist;
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