From b6f5851b7b8cf60bdaeeb2cecca8fec6bb81e7fb Mon Sep 17 00:00:00 2001 From: blushi Date: Mon, 9 Dec 2024 14:24:12 +0100 Subject: [PATCH] fix: ts error --- .../ProjectBatchTotals/ProjectBatchTotals.tsx | 15 ++++++++------- .../ProjectTopSection/ProjectTopSection.tsx | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/web-marketplace/src/components/molecules/ProjectBatchTotals/ProjectBatchTotals.tsx b/web-marketplace/src/components/molecules/ProjectBatchTotals/ProjectBatchTotals.tsx index fac963a200..55da35805c 100644 --- a/web-marketplace/src/components/molecules/ProjectBatchTotals/ProjectBatchTotals.tsx +++ b/web-marketplace/src/components/molecules/ProjectBatchTotals/ProjectBatchTotals.tsx @@ -31,6 +31,13 @@ const GridItem: React.FC> = ({ children }) => ( {children} ); +export type ProjectBatchTotalsProps = { + totals: BatchTotalsForProject & { registeredAmount?: number }; + projectWithOrderData?: NormalizeProject; + soldOutProjectsIds: string[]; + sx?: SxProps; + className?: string; +}; export function ProjectBatchTotals({ totals, @@ -38,13 +45,7 @@ export function ProjectBatchTotals({ soldOutProjectsIds, sx = [], className, -}: { - totals: BatchTotalsForProject & { registeredAmount?: number }; - projectWithOrderData?: NormalizeProject; - soldOutProjectsIds: string[]; - sx?: SxProps; - className?: string; -}): JSX.Element { +}: ProjectBatchTotalsProps): JSX.Element { const { _ } = useLingui(); const isSoldOut = getIsSoldOut({ project: projectWithOrderData, diff --git a/web-marketplace/src/components/organisms/ProjectTopSection/ProjectTopSection.tsx b/web-marketplace/src/components/organisms/ProjectTopSection/ProjectTopSection.tsx index 70dee50661..5cbbf31153 100644 --- a/web-marketplace/src/components/organisms/ProjectTopSection/ProjectTopSection.tsx +++ b/web-marketplace/src/components/organisms/ProjectTopSection/ProjectTopSection.tsx @@ -43,7 +43,7 @@ import { Prefinance } from 'components/templates/ProjectDetails/ProjectDetails.P import TerrasosCreditsInfo from 'components/templates/ProjectDetails/TerrasosCreditsInfo/TerrasosCreditsInfo'; import { useTags } from 'hooks/useTags'; -import { ProjectBatchTotals } from '../../molecules'; +import { ProjectBatchTotals, ProjectBatchTotalsProps } from '../../molecules'; import { ProjectTopSectionCreditClassCard } from './ProjectTopSection.CreditClassCard'; import { ProjectTopSectionQuoteMark, @@ -220,7 +220,7 @@ function ProjectTopSection({ normalizedProject?.complianceCredits.creditsRegistered ?? 0, retiredAmount: normalizedProject?.complianceCredits.creditsRetired ?? 0, tradableAmount: normalizedProject?.complianceCredits.creditsAvailable ?? 0, - }; + } as ProjectBatchTotalsProps['totals']; const isComplianceProject = normalizedProject?.marketType?.includes(COMPLIANCE_MARKET) ?? false;