Skip to content

Commit

Permalink
refactor: remove isRoot from FilterGroupContainerProps
Browse files Browse the repository at this point in the history
  • Loading branch information
lawvs committed Aug 7, 2024
1 parent cb48139 commit 2ba90f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
1 change: 0 additions & 1 deletion packages/filter/src/views/filter-group-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { ReactNode } from "react";

export type FilterGroupContainerProps = {
filterGroup: FilterGroup;
isRoot: boolean;
children?: ReactNode;
};

Expand Down
10 changes: 3 additions & 7 deletions packages/filter/src/views/filter-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ export type FilterGroupProps = {
};

export const FilterGroupView = ({ rule: filterGroup }: FilterGroupProps) => {
const {
ruleState: { isRoot },
appendChildRule,
appendChildGroup,
} = useFilterGroup(filterGroup);
const { appendChildRule, appendChildGroup } = useFilterGroup(filterGroup);
const { Button: ButtonView } = useView("components");
const {
FilterGroupContainer,
Expand All @@ -22,7 +18,7 @@ export const FilterGroupView = ({ rule: filterGroup }: FilterGroupProps) => {
const count = filterGroup.conditions.length;
if (count <= 0) {
return (
<FilterGroupContainer isRoot={isRoot} filterGroup={filterGroup}>
<FilterGroupContainer filterGroup={filterGroup}>
<ButtonView
onClick={() => {
appendChildRule();
Expand All @@ -42,7 +38,7 @@ export const FilterGroupView = ({ rule: filterGroup }: FilterGroupProps) => {
}

return (
<FilterGroupContainer isRoot={isRoot} filterGroup={filterGroup}>
<FilterGroupContainer filterGroup={filterGroup}>
{filterGroup.conditions.map((childRule, groupIdx) => {
if (childRule.type === "Filter") {
return (
Expand Down

0 comments on commit 2ba90f8

Please sign in to comment.