Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed holder network name and contract overflow on tx #602

Merged
merged 2 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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