fix: build fix

This commit is contained in:
Anmol Singh Bhatia 2023-02-28 15:17:14 +05:30
parent 19e9f510bc
commit 7d42262e72
2 changed files with 6 additions and 18 deletions

View File

@ -12,12 +12,12 @@ import { CompletedCycleIcon } from "components/icons";
import cyclesService from "services/cycles.service"; import cyclesService from "services/cycles.service";
import { CYCLE_COMPLETE_LIST } from "constants/fetch-keys"; import { CYCLE_COMPLETE_LIST } from "constants/fetch-keys";
type Props = { export interface CompletedCyclesListProps {
setCreateUpdateCycleModal: React.Dispatch<React.SetStateAction<boolean>>; setCreateUpdateCycleModal: React.Dispatch<React.SetStateAction<boolean>>;
setSelectedCycle: React.Dispatch<React.SetStateAction<SelectCycleType>>; setSelectedCycle: React.Dispatch<React.SetStateAction<SelectCycleType>>;
}; }
export const CompletedCyclesList: React.FC<Props> = ({ export const CompletedCyclesList: React.FC<CompletedCyclesListProps> = ({
setCreateUpdateCycleModal, setCreateUpdateCycleModal,
setSelectedCycle, setSelectedCycle,
}) => { }) => {

View File

@ -16,7 +16,7 @@ import projectService from "services/project.service";
// layouts // layouts
import AppLayout from "layouts/app-layout"; import AppLayout from "layouts/app-layout";
// components // components
import { CreateUpdateCycleModal, CyclesList } from "components/cycles"; import { CompletedCyclesListProps, CreateUpdateCycleModal, CyclesList } from "components/cycles";
// ui // ui
import { HeaderButton, Loader } from "components/ui"; import { HeaderButton, Loader } from "components/ui";
import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs"; import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs";
@ -25,13 +25,9 @@ import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs";
import { SelectCycleType } from "types"; import { SelectCycleType } from "types";
import type { NextPage, GetServerSidePropsContext } from "next"; import type { NextPage, GetServerSidePropsContext } from "next";
// fetching keys // fetching keys
import { import { CYCLE_CURRENT_AND_UPCOMING_LIST, PROJECT_DETAILS } from "constants/fetch-keys";
CYCLE_COMPLETE_LIST,
CYCLE_CURRENT_AND_UPCOMING_LIST,
PROJECT_DETAILS,
} from "constants/fetch-keys";
const CompletedCyclesList = dynamic( const CompletedCyclesList = dynamic<CompletedCyclesListProps>(
() => import("components/cycles").then((a) => a.CompletedCyclesList), () => import("components/cycles").then((a) => a.CompletedCyclesList),
{ {
ssr: false, ssr: false,
@ -65,14 +61,6 @@ const ProjectCycles: NextPage = () => {
: null : 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(() => { useEffect(() => {
if (createUpdateCycleModal) return; if (createUpdateCycleModal) return;
const timer = setTimeout(() => { const timer = setTimeout(() => {