Skip to content

Commit

Permalink
Add flag to hide search and filters menu in DataTable (#2764)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlinaGoaga authored Sep 20, 2022
1 parent a49c642 commit 2778ebc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/components/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export interface Props {
filters?: FilterConfig;
dialogOpen?: boolean;
hasCheckboxes?: boolean;
hideSearchAndFilters?: boolean;
}
//styled components
const EmptyRow = styled(TableRow)<{ colSpan: number }>`
Expand Down Expand Up @@ -329,6 +330,7 @@ function UnstyledDataTable({
filters,
hasCheckboxes: checkboxes,
dialogOpen,
hideSearchAndFilters,
}: Props) {
//URL info
const history = useHistory();
Expand Down Expand Up @@ -483,7 +485,7 @@ function UnstyledDataTable({
start={filters ? false : true}
>
{checkboxes && <CheckboxActions checked={checked} rows={filtered} />}
{filters && (
{filters && !hideSearchAndFilters && (
<Flex wide align end>
<ChipGroup
chips={chips}
Expand Down

0 comments on commit 2778ebc

Please sign in to comment.