Skip to content
This repository has been archived by the owner on Aug 24, 2022. It is now read-only.

Commit

Permalink
style: rdg and resizable tables polished
Browse files Browse the repository at this point in the history
  • Loading branch information
tyn1998 committed Aug 10, 2022
1 parent e0617d1 commit 416e85c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/ui/MessagesView/MessagesView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React, {
import ResizableTable from './ResizableTable';
import DataGrid from 'react-data-grid';
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
import 'react-tabs/style/react-tabs.css';
import './react-tabs.scss';
import JsonView from 'react-json-view';
import { startCapturing, stopCapturing, getMessages } from '../../capturer';
import { updateMessages, getParsedMessage } from './messagesHelper';
Expand Down Expand Up @@ -184,7 +184,7 @@ const MessagesView = () => {

return (
<div>
<div className="toolbar" style={{ marginBottom: '5px' }}>
<div className="toolbar">
<button
className={`toolbar-button ${capturing ? 'active' : ''}`}
onClick={toggleCapturing}
Expand Down Expand Up @@ -221,7 +221,7 @@ const MessagesView = () => {
className={`rdg-light ${
filters.enabled ? 'filter-container' : undefined
}`}
style={{ fontSize: '10px', height: 'calc(100vh - 42px)' }}
style={{ height: 'calc(100vh - 37px)' }}
ref={gridRef}
columns={columns}
rows={filteredRows}
Expand Down
9 changes: 9 additions & 0 deletions src/ui/MessagesView/MessagesView.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.toolbar {
display: flex;
margin: 5px;
flex-direction: row;
flex-wrap: nowrap;
gap: 5px;
Expand Down Expand Up @@ -106,14 +107,22 @@
background-position: center center;
}

.rdg {
border: 0;
}

.rdg-header-cell {
font-size: 11px;
font-weight: normal;
background-color: #f1f3f4;
border-color: #cacdd1;
}

.rdg-body-cell {
font-size: 11px;
font-family: monospace;
border-bottom: 0;
border-color: #cacdd1;

&.column-type {
text-align: center;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/MessagesView/ResizableTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const ResizableTable = ({ children }) => {
<table className="rt-table" ref={tableElement}>
<thead>
<tr>
<td ref={ref1}>
<td id="rt-td1" ref={ref1}>
{children[0]}
<div
style={{ height: tableHeight }}
Expand Down
9 changes: 8 additions & 1 deletion src/ui/MessagesView/ResizableTable.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
table.rt-table {
width: 100%;
height: auto;
border-top: 1px solid #cacdd1;
border-bottom: 1px solid #cacdd1;
display: grid;
overflow: auto;
grid-template-columns:
minmax(150px, 7fr)
minmax(150px, 3fr);

overflow: hidden;
overflow: hidden;

thead,
tr {
Expand All @@ -16,9 +18,14 @@ table.rt-table {

td {
position: relative;
padding: 0;
}
}

#rt-td1 {
border-right: 1px solid #cacdd1;
}

.rt-handle {
display: block;
position: absolute;
Expand Down

0 comments on commit 416e85c

Please sign in to comment.