mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
963d26ccda
* chore: gantt sidebar and main content scroll sync * chore: add arrow navigation position logic * refactor: scroll position update logic * refactor: gantt chart components * refactor: gantt sidebar * fix: vertical scroll issue * fix: move to the hidden block button flickering * refactor: gantt sidebar components * chore: move timeline header outside * fix gantt scroll issue * fix: sticky position issues * fix: infinite timeline scroll logic * chore: removed unnecessary import statements --------- Co-authored-by: rahulramesha <rahulramesham@gmail.com>
54 lines
2.3 KiB
TypeScript
54 lines
2.3 KiB
TypeScript
import { FC } from "react";
|
|
// context
|
|
import { useChart } from "components/gantt-chart";
|
|
|
|
export const BiWeekChartView: FC<any> = () => {
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
const { currentView, currentViewData, renderView, dispatch, allViews } = useChart();
|
|
|
|
return (
|
|
<>
|
|
<div className="absolute flex h-full flex-grow divide-x divide-custom-border-200">
|
|
{renderView &&
|
|
renderView.length > 0 &&
|
|
renderView.map((_itemRoot: any, _idxRoot: any) => (
|
|
<div key={`title-${_idxRoot}`} className="relative flex flex-col">
|
|
<div className="relative border-b border-custom-border-200">
|
|
<div className="sticky left-0 inline-flex whitespace-nowrap px-2 py-1 text-sm font-medium capitalize">
|
|
{_itemRoot?.title}
|
|
</div>
|
|
</div>
|
|
|
|
<div className="flex h-full w-full divide-x divide-custom-border-200">
|
|
{_itemRoot.children &&
|
|
_itemRoot.children.length > 0 &&
|
|
_itemRoot.children.map((_item: any, _idx: any) => (
|
|
<div
|
|
key={`sub-title-${_idxRoot}-${_idx}`}
|
|
className="relative flex h-full flex-col overflow-hidden whitespace-nowrap"
|
|
style={{ width: `${currentViewData?.data.width}px` }}
|
|
>
|
|
<div
|
|
className={`flex-shrink-0 border-b py-1 text-center text-sm font-medium capitalize ${
|
|
_item?.today ? `border-red-500 text-red-500` : `border-custom-border-200`
|
|
}`}
|
|
>
|
|
<div>{_item.title}</div>
|
|
</div>
|
|
<div
|
|
className={`relative flex h-full w-full flex-1 justify-center ${
|
|
["sat", "sun"].includes(_item?.dayData?.shortTitle || "") ? `bg-custom-background-80` : ``
|
|
}`}
|
|
>
|
|
{_item?.today && <div className="absolute bottom-0 top-0 border border-red-500"> </div>}
|
|
</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</>
|
|
);
|
|
};
|