Compare commits

...

2 Commits

Author SHA1 Message Date
Yunus M
ee7f6a1aec feat: update background for tr, td on hover 2024-07-25 18:51:45 +05:30
Yunus M
7c97ea83de feat: add a min max limit for log body width in column view 2024-07-25 15:57:11 +05:30
4 changed files with 85 additions and 5 deletions

View File

@@ -0,0 +1,11 @@
.logs-table {
table tbody tr {
&:hover {
background-color: rgba(171, 189, 255, 0.04);
td {
background-color: rgba(171, 189, 255, 0.04) !important;
}
}
}
}

View File

@@ -2,3 +2,51 @@
cursor: pointer;
position: relative;
}
.log-timestamp {
width: 240px;
max-width: 240px;
min-width: 240px;
padding: 4px 8px 6px;
div {
font-weight: 400;
line-height: 20px; /* 128.571% */
letter-spacing: 0.2px;
}
}
.log-body {
margin: 4px 0;
width: 700px;
max-width: 700px;
min-width: 700px;
color: white;
padding: 4px 8px 6px;
div {
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 20px; /* 128.571% */
letter-spacing: 0.1px;
width: 100%;
min-width: 0 !important;
}
}
.log-actions {
position: absolute;
right: 0;
height: 100%;
vertical-align: middle;
}
.lightMode {
.log-body {
color: '#1d1d1d';
background-color: #ffffffd5;
}
}

View File

@@ -73,6 +73,22 @@ export default function TableRow({
const children = elementWithChildren.children as ReactElement;
const props = elementWithChildren.props as Record<string, unknown>;
const isBody = column.key === 'body';
const isTimestamp = column.key === 'timestamp';
if (isTimestamp || isBody) {
return (
<td
key={column.key}
className={`${isTimestamp ? 'log-timestamp' : 'log-body'}`}
>
{cloneElement(children, props)}
</td>
);
}
// Setting the width of body column to 500px to maintain the consistency and reduce layout shift due to body content change
return (
<TableCellStyled
$isDragColumn={false}
@@ -84,11 +100,13 @@ export default function TableRow({
);
})}
{hasActions && isLogsExplorerPage && (
<LogLinesActionButtons
handleShowContext={handleShowContext}
onLogCopy={onLogCopy}
customClassName="table-view-log-actions"
/>
<div className="log-actions">
<LogLinesActionButtons
handleShowContext={handleShowContext}
onLogCopy={onLogCopy}
customClassName="table-view-log-actions"
/>
</div>
)}
</>
);

View File

@@ -1,3 +1,5 @@
import './InfinityTableView.styles.scss';
import LogDetail from 'components/LogDetail';
import { VIEW_TYPES } from 'components/LogDetail/constants';
import { useTableView } from 'components/Logs/TableView/useTableView';
@@ -138,6 +140,7 @@ const InfinityTable = forwardRef<TableVirtuosoHandle, InfinityTableProps>(
tableViewProps.activeLogIndex !== -1 ? tableViewProps.activeLogIndex : 0
}
style={infinityDefaultStyles}
className="logs-table"
data={dataSource}
components={{
// eslint-disable-next-line react/jsx-props-no-spreading