Skip to content

Commit 4ef78cd

Browse files
author
Nguyen Minh Tuan
committed
feat: add showCheckbox prop to IndexTable
1 parent 45fdee5 commit 4ef78cd

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/@next/IndexTable/IndexTable.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { CheckboxCellContentContainer } from './components/Checkbox/CheckboxStyl
1414
type IndexTableProps = Omit<PolarisIndexTableProps, 'emptySearchTitle'> & {
1515
height?: string;
1616
selectableItemsCount?: number;
17+
showCheckbox?: boolean;
1718
};
1819

1920
const IndexTable = ({
@@ -25,6 +26,7 @@ const IndexTable = ({
2526
loading,
2627
emptyState,
2728
selectableItemsCount,
29+
showCheckbox = true,
2830
...props
2931
}: IndexTableProps) => {
3032
const renderCheckboxHeader = ({
@@ -45,7 +47,10 @@ const IndexTable = ({
4547
);
4648
};
4749

48-
const checkbox = !loading && itemCount > 0 ? renderCheckboxHeader : undefined;
50+
const checkbox =
51+
!loading && showCheckbox && itemCount > 0
52+
? renderCheckboxHeader
53+
: undefined;
4954

5055
return (
5156
<>

0 commit comments

Comments
 (0)