Skip to content

Commit 06b0d61

Browse files
authored
Show bulk actions if needed. (#421)
1 parent 49acf7d commit 06b0d61

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/components/tableV2/core/base-table.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const StyledHeaderRow = styled.tr`
2525
`
2626
const StyledHeaderCell = styled(Box)`
2727
position: relative;
28-
padding: 12px;
28+
padding: 4px 8px;
2929
border-bottom: 1px solid ${getColor("borderSecondary")};
3030
&:not(:last-child) {
3131
border-right: 1px solid ${getColor("borderSecondary")};
@@ -133,7 +133,7 @@ Table.HeadCell = forwardRef(
133133
sx={{
134134
textAlign: align,
135135
fontSize: "14px",
136-
height: "90px",
136+
height: "60px",
137137
position: "sticky",
138138
top: 0,
139139
...styles,
@@ -271,7 +271,7 @@ Table.Cell = forwardRef(
271271
<Box
272272
as="td"
273273
onClick={handleClick}
274-
padding={[3]}
274+
padding={[1, 2]}
275275
ref={ref}
276276
sx={{
277277
textAlign: align,

src/components/tableV2/netdataTable.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const NetdataTable = ({
6666
}) => {
6767
const [isColumnDropdownVisible, setIsColumnDropdownVisible] = useState(false)
6868
const [columnVisibility, setColumnVisibility] = useState(initialColumnVisibility)
69-
const [columnPinning, setColumnPinning] = React.useState(columnPinningOptions)
69+
const [columnPinning, setColumnPinning] = useState(columnPinningOptions)
7070

7171
const [originalSelectedRows, setOriginalSelectedRow] = useState([])
7272
const [sorting, setSorting] = useState(sortBy)
@@ -103,8 +103,10 @@ const NetdataTable = ({
103103

104104
const makeActionsColumn = useMemo(() => makeRowActions({ rowActions, testPrefix }), [rowActions])
105105

106+
const hasBulkActions = enableColumnPinning || enableColumnVisibility || bulkActions
107+
106108
const renderBulkActions = () =>
107-
bulkActions
109+
hasBulkActions
108110
? [
109111
makeBulkActions({
110112
bulkActions,
@@ -224,7 +226,7 @@ const NetdataTable = ({
224226
return (
225227
<SharedTableProvider>
226228
<Flex height="100%" overflow="hidden" width="100%" column>
227-
{onGlobalSearchChange || bulkActions ? (
229+
{onGlobalSearchChange || hasBulkActions ? (
228230
<GlobalControls
229231
bulkActions={renderBulkActions}
230232
dataGa={dataGa}

0 commit comments

Comments
 (0)