Skip to content

Commit

Permalink
Fixed holder network name and contract overflow on tx (#602)
Browse files Browse the repository at this point in the history
* Fixed holder network name and contract overflow on tx

* Fixed network title on Nodes
  • Loading branch information
Malak67 authored Oct 23, 2023
1 parent 76f4815 commit 7ec22a8
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
4 changes: 4 additions & 0 deletions services/explorer/src/components/DataRow/DataRow.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ const useStyles = makeStyles(
width: '100%',
},
},
wrapText: {
whiteSpace: 'normal',
overflowWrap: 'break-word',
},
};
},
{ name: 'DataRow' }
Expand Down
9 changes: 7 additions & 2 deletions services/explorer/src/components/DataRow/DataRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import useStyles from './DataRow.styles';
export const DataRow: React.FC<{
title: string;
data: JSX.Element | string;
wrap?: boolean;
}> = (props) => {
const { title, data } = props;
const { title, data, wrap } = props;
const classes = useStyles();

return (
Expand All @@ -22,7 +23,11 @@ export const DataRow: React.FC<{
>
{title}:
</Typography>
<Box className={classes.dataContainer}>{data}</Box>
<Box
className={`${classes.dataContainer} ${wrap ? classes.wrapText : ''}`}
>
{data}
</Box>
</Box>
)
);
Expand Down
5 changes: 4 additions & 1 deletion services/explorer/src/pages/Nodes/Nodes.effects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const useNodesEffects = (): {
year: number;
loading: boolean;
weekPagination: WeekPagination;
pageSubtitle: string;
} => {
const [loading, setLoading] = useState<boolean>(false);
const [weekNumber, setWeekNumber] = useState<number>();
Expand All @@ -52,7 +53,7 @@ export const useNodesEffects = (): {

const { page, rowsPerPage, handleChangePage, handleChangeRowsPerPage } =
usePagination();
const { backendEndpoint } = useExplorerNetwork();
const { currentNetwork, backendEndpoint } = useExplorerNetwork();

const { data: blocks } = useGetBlocksThisWeek(
backendEndpoint,
Expand Down Expand Up @@ -138,6 +139,7 @@ export const useNodesEffects = (): {
weekPagination?.startDate
)} - ${formatDate(weekPagination?.endDate)})`;
const description = 'Total blocks produced this week';
const pageSubtitle = `List of TARAXA nodes on ${currentNetwork}`;

return {
blocks: blocks?.data,
Expand All @@ -163,5 +165,6 @@ export const useNodesEffects = (): {
year,
loading,
weekPagination,
pageSubtitle,
};
};
3 changes: 2 additions & 1 deletion services/explorer/src/pages/Nodes/Nodes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ const NodesPage = (): JSX.Element => {
year,
loading,
weekPagination,
pageSubtitle,
} = useNodesEffects();
return (
<>
<PageTitle title='Nodes' subtitle='List of TARAXA nodes on Mainnet' />
<PageTitle title='Nodes' subtitle={pageSubtitle} />
{weekPagination && (
<Box
sx={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,11 @@ const TransactionDataContainer = (): JSX.Element => {
<DataRow title='Nonce' data={`${transactionData?.nonce}`} />
{transactionData?.inputData &&
transactionData?.inputData !== '0x' && (
<DataRow title='Data' data={`${transactionData.inputData}`} />
<DataRow
title='Data'
data={`${transactionData.inputData}`}
wrap
/>
)}
{(getTransactionType(transactionData) ===
TransactionType.Contract_Call ||
Expand Down

0 comments on commit 7ec22a8

Please sign in to comment.