From e62b42ddc404624ca59bb23f992682f00428ea52 Mon Sep 17 00:00:00 2001 From: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> Date: Sun, 8 Sep 2024 11:51:00 +0500 Subject: [PATCH] chore: do not blur projects which are not approved yet --- .../features/projects/components/ProjectDetails.tsx | 5 +---- .../src/pages/projects/[projectId]/Project.tsx | 12 +----------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/packages/interface/src/features/projects/components/ProjectDetails.tsx b/packages/interface/src/features/projects/components/ProjectDetails.tsx index e696066e..f640620e 100644 --- a/packages/interface/src/features/projects/components/ProjectDetails.tsx +++ b/packages/interface/src/features/projects/components/ProjectDetails.tsx @@ -1,4 +1,3 @@ -import clsx from "clsx"; import { type ReactNode } from "react"; import { Heading } from "~/components/ui/Heading"; @@ -20,14 +19,12 @@ export interface IProjectDetailsProps { action?: ReactNode; projectId?: string; attestation?: Attestation; - disabled?: boolean; } const ProjectDetails = ({ projectId = "", attestation = undefined, action = undefined, - disabled = false, }: IProjectDetailsProps): JSX.Element => { const metadata = useProjectMetadata(attestation?.metadataPtr); @@ -37,7 +34,7 @@ const ProjectDetails = ({ const appState = useAppState(); return ( -
+
diff --git a/packages/interface/src/pages/projects/[projectId]/Project.tsx b/packages/interface/src/pages/projects/[projectId]/Project.tsx index caf6ef72..f05cd1c7 100644 --- a/packages/interface/src/pages/projects/[projectId]/Project.tsx +++ b/packages/interface/src/pages/projects/[projectId]/Project.tsx @@ -1,8 +1,6 @@ import { type GetServerSideProps } from "next"; -import { useMemo } from "react"; import { ReviewBar } from "~/features/applications/components/ReviewBar"; -import { useApprovedApplications } from "~/features/applications/hooks/useApprovedApplications"; import ProjectDetails from "~/features/projects/components/ProjectDetails"; import { useProjectById } from "~/features/projects/hooks/useProjects"; import { LayoutWithSidebar } from "~/layouts/DefaultLayout"; @@ -15,22 +13,14 @@ export interface IProjectDetailsProps { const ProjectDetailsPage = ({ projectId = "" }: IProjectDetailsProps): JSX.Element => { const projects = useProjectById(projectId); - const approved = useApprovedApplications(); const { name } = projects.data?.[0] ?? {}; const appState = useAppState(); - const approvedById = useMemo( - () => new Map(approved.data?.map(({ refUID }) => [refUID, true]) ?? []), - [approved.data], - ); - - const disabled = useMemo(() => approvedById.get(projectId), [approvedById, projectId]); - return ( {appState === EAppState.APPLICATION && } - + ); };