Skip to content

Commit

Permalink
Merge pull request #4754 from LiskHQ/4735-events-table-fix
Browse files Browse the repository at this point in the history
Fix events table styling
  • Loading branch information
ikem-legend authored Jan 23, 2023
2 parents e88b43c + 6e92c15 commit d626c5f
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 26 deletions.
5 changes: 5 additions & 0 deletions src/modules/block/components/blockDetails/blockDetails.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,9 @@ h1 {

.wrapper {
margin-bottom: 25px;

& .content {
padding-left: 0;
padding-right: 0;
}
}
2 changes: 1 addition & 1 deletion src/modules/block/components/blockDetails/blockDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const BlockDetails = ({
<BoxHeader>
<BoxTabs {...tabs} />
</BoxHeader>
<BoxContent>
<BoxContent className={styles.content}>
{activeTab === 'transactions'
? <Transactions blockId={id} />
: <TransactionEvents blockId={id} />}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.content {
padding: 0 !important;
padding: 0 20px !important;
margin-top: -10px !important;
}

.wrapper {
Expand Down Expand Up @@ -57,12 +58,18 @@ h1 {
padding: 5px 0px;
position: sticky;

&::after {
left: 0;
right: 0;
}

& > div:first-child {
padding-left: 0px;
padding-right: 16px;
}

& > div:nth-child(3) {
& > div:nth-child(3),
& > div:nth-child(4) {
padding-left: 8px !important;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@ const walletEventHeaderMap = (t) => [
},
{
title: t('Transaction ID'),
classList: grid['col-xs-4'],
classList: grid['col-xs-3'],
},
{
title: t('Module'),
classList: grid['col-xs-3'],
},
{
title: t('Name'),
classList: grid['col-xs-2'],
classList: grid['col-xs-3'],
},
];

const defaultEventHeaderMap = (t) => [
{
title: t('Index'),
classList: grid['col-xs-4'],
classList: grid['col-xs-3'],
},
{
title: t('Module'),
classList: grid['col-xs-4'],
},
{
title: t('Name'),
classList: grid['col-xs-3'],
classList: grid['col-xs-4'],
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@
text-transform: capitalize;
}

&::before {
content: '';
min-width: 100%;
position: absolute;
height: 1px;
border-top: 1px var(--color-platinum) solid;
}

& > div {
display: flex;
flex-direction: row;
Expand Down Expand Up @@ -100,6 +92,14 @@

.rowWrapper {
width: 100%;

&::after {
content: '';
min-width: calc(100% - 40px);
position: absolute;
height: 1px;
background-color: var(--color-platinum);
}
}

.jsonContainer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
EventName,
CollapseToggle,
BlockHeight,
TransctionID,
TransactionID,
} from './components';

const TransactionEventRow = ({ data: transactionEvent, isWallet }) => {
Expand All @@ -25,9 +25,9 @@ const TransactionEventRow = ({ data: transactionEvent, isWallet }) => {
<div data-testid="transaction-event-row-wrapper" className={styles.rowWrapper}>
<div className={`transaction-event-row ${styles.container}`}>
{isWallet ? <BlockHeight height={height} id={id} /> : <EventIndex id={index} />}
{isWallet && topics?.length > 0 && <TransctionID id={topics[0]} />}
{isWallet && topics?.length > 0 && <TransactionID id={topics[0]} />}
<EventModule module={module} isWallet={isWallet} />
<EventName name={name} isWallet={isWallet} />
<EventName name={name} isWallet={isWallet} />
<CollapseToggle
isWallet={isWallet}
isCollapsed={isCollapsed}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import React from 'react';
import { Link } from 'react-router-dom';
import grid from 'flexboxgrid/dist/flexboxgrid.css';
import Icon from 'src/theme/Icon';
import { truncateTransactionID } from 'src/modules/wallet/utils/account';
import { Link } from 'react-router-dom';

import { TertiaryButton } from 'src/theme/buttons';
import styles from './TransactionEventsRow.css';

export const TransctionID = ({ id }) => (
<div className={`event-hash ${styles.transactionID} ${grid['col-xs-4']}`}>
<Link to={`/transactions/details?transactionID=${id}`}>
{id.length === 64 ? truncateTransactionID(id) : '-'}
</Link>
export const TransactionID = ({ id }) => (
<div className={`event-hash ${styles.transactionID} ${grid['col-xs-3']}`}>
{id.length === 64 ? (
<Link to={`/transactions/details?transactionID=${id}`}>{truncateTransactionID(id)}</Link>
) : (
'-'
)}
</div>
);

Expand All @@ -22,7 +24,7 @@ export const BlockHeight = ({ height, id }) => (
);

export const EventName = ({ name, isWallet }) => (
<div className={`${grid[`col-xs-${isWallet ? 2 : 3}`]} event-action ${styles.eventAction}`}>
<div className={`${grid[`col-xs-${isWallet ? 3 : 4}`]} event-action ${styles.eventAction}`}>
{name}
</div>
);
Expand All @@ -33,7 +35,7 @@ export const EventModule = ({ module, isWallet }) => (
</div>
);

export const EventIndex = ({ id }) => <div className={grid['col-xs-4']}>{id}</div>;
export const EventIndex = ({ id }) => <div className={grid['col-xs-3']}>{id}</div>;

export const CollapseToggle = ({ isCollapsed, onToggle }) => (
<div className={`${styles.toggleButton} ${grid['col-xs-1']}`}>
Expand Down

0 comments on commit d626c5f

Please sign in to comment.