Skip to content

Commit 6321977

Browse files
authored
use getBlockById from the store for modules (#6325)
1 parent 208df80 commit 6321977

File tree

1 file changed

+11
-5
lines changed
  • web/core/components/gantt-chart/sidebar/modules

1 file changed

+11
-5
lines changed

web/core/components/gantt-chart/sidebar/modules/sidebar.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
"use client";
22

3+
import { observer } from "mobx-react";
34
// ui
45
import { Loader } from "@plane/ui";
56
// components
6-
import { ChartDataType, IBlockUpdateData, IGanttBlock } from "@/components/gantt-chart";
7+
import { IBlockUpdateData } from "@/components/gantt-chart";
8+
// hooks
9+
import { useTimeLineChart } from "@/hooks/use-timeline-chart";
10+
//
11+
import { ETimeLineTypeType } from "../../contexts";
712
import { GanttDnDHOC } from "../gantt-dnd-HOC";
813
import { handleOrderChange } from "../utils";
914
import { ModulesSidebarBlock } from "./block";
@@ -12,13 +17,14 @@ import { ModulesSidebarBlock } from "./block";
1217
type Props = {
1318
title: string;
1419
blockUpdateHandler: (block: any, payload: IBlockUpdateData) => void;
15-
getBlockById: (id: string, currentViewData?: ChartDataType | undefined) => IGanttBlock;
1620
blockIds: string[];
1721
enableReorder: boolean;
1822
};
1923

20-
export const ModuleGanttSidebar: React.FC<Props> = (props) => {
21-
const { blockUpdateHandler, blockIds, getBlockById, enableReorder } = props;
24+
export const ModuleGanttSidebar: React.FC<Props> = observer((props) => {
25+
const { blockUpdateHandler, blockIds, enableReorder } = props;
26+
27+
const { getBlockById } = useTimeLineChart(ETimeLineTypeType.MODULE);
2228

2329
const handleOnDrop = (
2430
draggingBlockId: string | undefined,
@@ -52,4 +58,4 @@ export const ModuleGanttSidebar: React.FC<Props> = (props) => {
5258
)}
5359
</div>
5460
);
55-
};
61+
});

0 commit comments

Comments
 (0)