From 7d42262e72007c239a759f429b7e6112afc9d8b4 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Tue, 28 Feb 2023 15:17:14 +0530 Subject: [PATCH] fix: build fix --- .../cycles/completed-cycles-list.tsx | 6 +++--- .../projects/[projectId]/cycles/index.tsx | 18 +++--------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/apps/app/components/cycles/completed-cycles-list.tsx b/apps/app/components/cycles/completed-cycles-list.tsx index b283e3da6..899a17bb2 100644 --- a/apps/app/components/cycles/completed-cycles-list.tsx +++ b/apps/app/components/cycles/completed-cycles-list.tsx @@ -12,12 +12,12 @@ import { CompletedCycleIcon } from "components/icons"; import cyclesService from "services/cycles.service"; import { CYCLE_COMPLETE_LIST } from "constants/fetch-keys"; -type Props = { +export interface CompletedCyclesListProps { setCreateUpdateCycleModal: React.Dispatch>; setSelectedCycle: React.Dispatch>; -}; +} -export const CompletedCyclesList: React.FC = ({ +export const CompletedCyclesList: React.FC = ({ setCreateUpdateCycleModal, setSelectedCycle, }) => { diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx index 78229fc54..9c4c3fb8d 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx @@ -16,7 +16,7 @@ import projectService from "services/project.service"; // layouts import AppLayout from "layouts/app-layout"; // components -import { CreateUpdateCycleModal, CyclesList } from "components/cycles"; +import { CompletedCyclesListProps, CreateUpdateCycleModal, CyclesList } from "components/cycles"; // ui import { HeaderButton, Loader } from "components/ui"; import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs"; @@ -25,13 +25,9 @@ import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs"; import { SelectCycleType } from "types"; import type { NextPage, GetServerSidePropsContext } from "next"; // fetching keys -import { - CYCLE_COMPLETE_LIST, - CYCLE_CURRENT_AND_UPCOMING_LIST, - PROJECT_DETAILS, -} from "constants/fetch-keys"; +import { CYCLE_CURRENT_AND_UPCOMING_LIST, PROJECT_DETAILS } from "constants/fetch-keys"; -const CompletedCyclesList = dynamic( +const CompletedCyclesList = dynamic( () => import("components/cycles").then((a) => a.CompletedCyclesList), { ssr: false, @@ -65,14 +61,6 @@ const ProjectCycles: NextPage = () => { : null ); - const getCycleStatus = (startDate: string, endDate: string) => { - const today = new Date(); - - if (today < new Date(startDate)) return "upcoming"; - else if (today > new Date(endDate)) return "completed"; - else return "current"; - }; - useEffect(() => { if (createUpdateCycleModal) return; const timer = setTimeout(() => {