use getBlockById from the store for modules (#6325)

This commit is contained in:
rahulramesha 2025-01-06 20:28:32 +05:30 committed by GitHub
parent 208df80c86
commit 6321977f1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,9 +1,14 @@
"use client";
import { observer } from "mobx-react";
// ui
import { Loader } from "@plane/ui";
// components
import { ChartDataType, IBlockUpdateData, IGanttBlock } from "@/components/gantt-chart";
import { IBlockUpdateData } from "@/components/gantt-chart";
// hooks
import { useTimeLineChart } from "@/hooks/use-timeline-chart";
//
import { ETimeLineTypeType } from "../../contexts";
import { GanttDnDHOC } from "../gantt-dnd-HOC";
import { handleOrderChange } from "../utils";
import { ModulesSidebarBlock } from "./block";
@ -12,13 +17,14 @@ import { ModulesSidebarBlock } from "./block";
type Props = {
title: string;
blockUpdateHandler: (block: any, payload: IBlockUpdateData) => void;
getBlockById: (id: string, currentViewData?: ChartDataType | undefined) => IGanttBlock;
blockIds: string[];
enableReorder: boolean;
};
export const ModuleGanttSidebar: React.FC<Props> = (props) => {
const { blockUpdateHandler, blockIds, getBlockById, enableReorder } = props;
export const ModuleGanttSidebar: React.FC<Props> = observer((props) => {
const { blockUpdateHandler, blockIds, enableReorder } = props;
const { getBlockById } = useTimeLineChart(ETimeLineTypeType.MODULE);
const handleOnDrop = (
draggingBlockId: string | undefined,
@ -52,4 +58,4 @@ export const ModuleGanttSidebar: React.FC<Props> = (props) => {
)}
</div>
);
};
});