Skip to content

Commit

Permalink
refactor: remove firstLevel prop in ProjectListItemConnected
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorGoryany committed Oct 17, 2024
1 parent 3c4ff35 commit d9b65ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/components/DashboardPage/DashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ export const DashboardPage = ({ user, ssrTime, defaultPresetFallback }: External
{groupsOnScreen?.map(({ ...project }, i) => (
<ProjectListItemConnected
mainProject
firstLevel
key={project.id}
project={project}
filterPreset={preset}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ interface ProjectListItemConnectedProps extends ComponentProps<typeof ProjectLis
subTree?: ProjectTree[string] | null;
partnershipProject?: string[];
filterPreset?: FilterById;
firstLevel?: boolean;
mainProject?: boolean;
}

Expand Down Expand Up @@ -54,7 +53,6 @@ export const ProjectListItemConnected: FC<ProjectListItemConnectedProps> = ({
filterPreset,
parent,
project,
firstLevel,
subTree,
mainProject,
...props
Expand All @@ -70,7 +68,7 @@ export const ProjectListItemConnected: FC<ProjectListItemConnectedProps> = ({

const subNodes = useMemo(
() =>
subTree?.children && !firstLevel
subTree?.children
? Object.values(subTree.children).map(({ project: p }) => (
<ProjectListItemConnected
subTree={subTree?.children?.[p.id]}
Expand All @@ -84,10 +82,10 @@ export const ProjectListItemConnected: FC<ProjectListItemConnectedProps> = ({
/>
))
: [],
[filterPreset, firstLevel, isKanbanView, partnershipProject, project, subTree?.children],
[filterPreset, isKanbanView, partnershipProject, project, subTree?.children],
);

const showNoGoals = firstLevel || (!subNodes.length && subTree?.count !== undefined);
const showNoGoals = !subNodes.length && subTree?.count === undefined;

useEffect(() => {
setIsProjectEmpty(getIsProjectEmptySetter(subTree));
Expand Down

0 comments on commit d9b65ff

Please sign in to comment.