Commit 857d420a authored by tom's avatar tom

fix tables layout on small screens

parent 26df8898
...@@ -17,13 +17,13 @@ interface Props { ...@@ -17,13 +17,13 @@ interface Props {
const InternalTxsTable = ({ data, currentAddress, isLoading }: Props) => { const InternalTxsTable = ({ data, currentAddress, isLoading }: Props) => {
return ( return (
<AddressHighlightProvider> <AddressHighlightProvider>
<TableRoot> <TableRoot minW="900px">
<TableHeaderSticky top={ 68 }> <TableHeaderSticky top={ 68 }>
<TableRow> <TableRow>
<TableColumnHeader width="15%">Parent txn hash</TableColumnHeader> <TableColumnHeader width="180px">Parent txn hash</TableColumnHeader>
<TableColumnHeader width="15%">Type</TableColumnHeader> <TableColumnHeader width="15%">Type</TableColumnHeader>
<TableColumnHeader width="10%">Block</TableColumnHeader> <TableColumnHeader width="15%">Block</TableColumnHeader>
<TableColumnHeader width="40%">From/To</TableColumnHeader> <TableColumnHeader width="50%">From/To</TableColumnHeader>
<TableColumnHeader width="20%" isNumeric> <TableColumnHeader width="20%" isNumeric>
Value { currencyUnits.ether } Value { currencyUnits.ether }
</TableColumnHeader> </TableColumnHeader>
......
...@@ -6,13 +6,13 @@ import type { InternalTransaction } from 'types/api/internalTransaction'; ...@@ -6,13 +6,13 @@ import type { InternalTransaction } from 'types/api/internalTransaction';
import config from 'configs/app'; import config from 'configs/app';
import { Badge } from 'toolkit/chakra/badge'; import { Badge } from 'toolkit/chakra/badge';
import { Skeleton } from 'toolkit/chakra/skeleton';
import { TableCell, TableRow } from 'toolkit/chakra/table'; import { TableCell, TableRow } from 'toolkit/chakra/table';
import AddressFromTo from 'ui/shared/address/AddressFromTo'; import AddressFromTo from 'ui/shared/address/AddressFromTo';
import BlockEntity from 'ui/shared/entities/block/BlockEntity'; import BlockEntity from 'ui/shared/entities/block/BlockEntity';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TxStatus from 'ui/shared/statusTag/TxStatus'; import TxStatus from 'ui/shared/statusTag/TxStatus';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip';
import TruncatedValue from 'ui/shared/TruncatedValue';
import { TX_INTERNALS_ITEMS } from 'ui/tx/internals/utils'; import { TX_INTERNALS_ITEMS } from 'ui/tx/internals/utils';
type Props = InternalTransaction & { currentAddress?: string; isLoading?: boolean }; type Props = InternalTransaction & { currentAddress?: string; isLoading?: boolean };
...@@ -81,9 +81,13 @@ const InternalTxsTableItem = ({ ...@@ -81,9 +81,13 @@ const InternalTxsTableItem = ({
/> />
</TableCell> </TableCell>
<TableCell isNumeric verticalAlign="middle"> <TableCell isNumeric verticalAlign="middle">
<Skeleton loading={ isLoading } display="inline-block" minW={ 6 }> <TruncatedValue
{ BigNumber(value).div(BigNumber(10 ** config.chain.currency.decimals)).toFormat() } value={ BigNumber(value).div(BigNumber(10 ** config.chain.currency.decimals)).toFormat() }
</Skeleton> isLoading={ isLoading }
minW={ 6 }
maxW="100%"
verticalAlign="middle"
/>
</TableCell> </TableCell>
</TableRow> </TableRow>
); );
......
...@@ -14,6 +14,7 @@ import AddressAddToWallet from 'ui/shared/address/AddressAddToWallet'; ...@@ -14,6 +14,7 @@ import AddressAddToWallet from 'ui/shared/address/AddressAddToWallet';
import type { EntityProps as AddressEntityProps } from 'ui/shared/entities/address/AddressEntity'; import type { EntityProps as AddressEntityProps } from 'ui/shared/entities/address/AddressEntity';
import AddressEntity from 'ui/shared/entities/address/AddressEntity'; import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import TokenEntity from 'ui/shared/entities/token/TokenEntity'; import TokenEntity from 'ui/shared/entities/token/TokenEntity';
import TruncatedValue from 'ui/shared/TruncatedValue';
type Props = { type Props = {
token: TokenInfo; token: TokenInfo;
...@@ -104,14 +105,18 @@ const TokensTableItem = ({ ...@@ -104,14 +105,18 @@ const TokensTableItem = ({
</Flex> </Flex>
</TableCell> </TableCell>
<TableCell isNumeric> <TableCell isNumeric>
<Skeleton loading={ isLoading } textStyle="sm" fontWeight={ 500 } display="inline-block"> <TruncatedValue
{ exchangeRate && `$${ Number(exchangeRate).toLocaleString(undefined, { minimumSignificantDigits: 4 }) }` } value={ exchangeRate ? `$${ Number(exchangeRate).toLocaleString(undefined, { minimumSignificantDigits: 4 }) }` : '' }
</Skeleton> isLoading={ isLoading }
maxW="100%"
/>
</TableCell> </TableCell>
<TableCell isNumeric maxWidth="300px" width="300px"> <TableCell isNumeric maxWidth="300px" width="300px">
<Skeleton loading={ isLoading } textStyle="sm" fontWeight={ 500 } display="inline-block"> <TruncatedValue
{ marketCap && `$${ BigNumber(marketCap).toFormat() }` } value={ marketCap ? `$${ BigNumber(marketCap).toFormat() }` : '' }
</Skeleton> isLoading={ isLoading }
maxW="100%"
/>
</TableCell> </TableCell>
<TableCell isNumeric> <TableCell isNumeric>
<Skeleton <Skeleton
......
...@@ -101,7 +101,7 @@ const TxsTableItem = ({ tx, showBlockInfo, currentAddress, enableTimeIncrement, ...@@ -101,7 +101,7 @@ const TxsTableItem = ({ tx, showBlockInfo, currentAddress, enableTimeIncrement,
</TableCell> </TableCell>
{ !config.UI.views.tx.hiddenFields?.value && ( { !config.UI.views.tx.hiddenFields?.value && (
<TableCell isNumeric> <TableCell isNumeric>
<CurrencyValue value={ tx.value } accuracy={ 8 } isLoading={ isLoading }/> <CurrencyValue value={ tx.value } accuracy={ 8 } isLoading={ isLoading } wordBreak="break-word"/>
</TableCell> </TableCell>
) } ) }
{ !config.UI.views.tx.hiddenFields?.tx_fee && ( { !config.UI.views.tx.hiddenFields?.tx_fee && (
...@@ -112,6 +112,7 @@ const TxsTableItem = ({ tx, showBlockInfo, currentAddress, enableTimeIncrement, ...@@ -112,6 +112,7 @@ const TxsTableItem = ({ tx, showBlockInfo, currentAddress, enableTimeIncrement,
isLoading={ isLoading } isLoading={ isLoading }
withCurrency={ Boolean(tx.celo || tx.stability_fee) } withCurrency={ Boolean(tx.celo || tx.stability_fee) }
justifyContent="end" justifyContent="end"
wordBreak="break-word"
/> />
</TableCell> </TableCell>
) } ) }
......
...@@ -25,7 +25,7 @@ const VerifiedContractsTable = ({ data, sort, setSorting, isLoading }: Props) => ...@@ -25,7 +25,7 @@ const VerifiedContractsTable = ({ data, sort, setSorting, isLoading }: Props) =>
}, [ sort, setSorting ]); }, [ sort, setSorting ]);
return ( return (
<TableRoot> <TableRoot minW="950px">
<TableHeaderSticky top={ ACTION_BAR_HEIGHT_DESKTOP }> <TableHeaderSticky top={ ACTION_BAR_HEIGHT_DESKTOP }>
<TableRow> <TableRow>
<TableColumnHeader width="50%">Contract</TableColumnHeader> <TableColumnHeader width="50%">Contract</TableColumnHeader>
......
...@@ -64,7 +64,7 @@ const VerifiedContractsTableItem = ({ data, isLoading }: Props) => { ...@@ -64,7 +64,7 @@ const VerifiedContractsTableItem = ({ data, isLoading }: Props) => {
value={ balance } value={ balance }
isLoading={ isLoading } isLoading={ isLoading }
my={ 1 } my={ 1 }
w="100%" maxW="100%"
/> />
</TableCell> </TableCell>
<TableCell isNumeric> <TableCell isNumeric>
......
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