forked from github/plane
785a6e8871
* chore: gantt chart resizable blocks * chore: right scroll added * chore: left scroll added * fix: build errors * chore: remove unnecessary console logs * chore: add block type and remove info toggle * feat: gantt chart blocks y-axis drag and drop * chore: disable drag flag * fix: y-axis drag mutation * fix: scroll container undefined error * fix: negative scroll * fix: negative scroll * style: blocks tooltip consistency
34 lines
926 B
TypeScript
34 lines
926 B
TypeScript
import { useRouter } from "next/router";
|
|
|
|
import useSWR from "swr";
|
|
|
|
// services
|
|
import cyclesService from "services/cycles.service";
|
|
// components
|
|
import { CyclesView } from "components/cycles";
|
|
// fetch-keys
|
|
import { UPCOMING_CYCLES_LIST } from "constants/fetch-keys";
|
|
|
|
type Props = {
|
|
viewType: string | null;
|
|
};
|
|
|
|
export const UpcomingCyclesList: React.FC<Props> = ({ viewType }) => {
|
|
const router = useRouter();
|
|
const { workspaceSlug, projectId } = router.query;
|
|
|
|
const { data: upcomingCyclesList, mutate } = useSWR(
|
|
workspaceSlug && projectId ? UPCOMING_CYCLES_LIST(projectId.toString()) : null,
|
|
workspaceSlug && projectId
|
|
? () =>
|
|
cyclesService.getCyclesWithParams(
|
|
workspaceSlug.toString(),
|
|
projectId.toString(),
|
|
"upcoming"
|
|
)
|
|
: null
|
|
);
|
|
|
|
return <CyclesView cycles={upcomingCyclesList} mutateCycles={mutate} viewType={viewType} />;
|
|
};
|