diff --git a/src/components/pool/components/PoolSummary/PoolSummary.tsx b/src/components/pool/components/PoolSummary/PoolSummary.tsx index 41caeaf..0d97f2b 100644 --- a/src/components/pool/components/PoolSummary/PoolSummary.tsx +++ b/src/components/pool/components/PoolSummary/PoolSummary.tsx @@ -44,11 +44,14 @@ export const PoolSummary = (pool: PoolSummaryProps) => { const applyLink = `https://builder.gitcoin.co/#/chains/${pool.chainId}/round/${pool.poolId}/apply`; const explorerLink = `https://explorer.gitcoin.co/#/round/${pool.chainId}/${pool.poolId}`; - // TODO Fix breadcrumbItems hrefs const breadcrumbItems = [ - { label: "My Programs", href: "#" }, - { label: "Program Details", href: "#" }, - { label: "Round Details", href: "#" }, + { label: "My Programs", href: "https://manager.gitcoin.co/#/" }, + // TODO: Fix href for Program Details + { label: "Program Details", href: "https://manager.gitcoin.co/#/1" }, + { + label: "Round Details", + href: `https://explorer.gitcoin.co/#/round/${pool.chainId}/${pool.poolId}`, + }, ]; return (
diff --git a/src/features/checker/Checker.stories.tsx b/src/features/checker/Checker.stories.tsx index 20feff4..544af7b 100644 --- a/src/features/checker/Checker.stories.tsx +++ b/src/features/checker/Checker.stories.tsx @@ -1,16 +1,17 @@ import type { Meta, StoryObj } from "@storybook/react"; -import { handlers } from "@/mocks/handlers"; +import { CheckerProvider } from "~checker/store"; import { Checker } from "./Checker"; +import { usePerformEvaluation, usePerformOnChainReview } from "./hooks"; const meta = { title: "Features/Checker", component: Checker, args: { address: "0x1234567890123456789012345678901234567890", - poolId: "609", - chainId: 42161, + poolId: "597", + chainId: 11155111, }, } satisfies Meta; @@ -19,9 +20,39 @@ export default meta; type Story = StoryObj; export const Default: Story = { - parameters: { - msw: { - handlers, + decorators: [ + (Story) => { + // New StoryWrapper component + const StoryWrapper = () => { + const { setEvaluationBody, isSigning, isSuccess, isEvaluating, isError, isErrorSigning } = + usePerformEvaluation(); + const { steps, setReviewBody, isReviewing } = usePerformOnChainReview(); + + return ( + + ); + }; + + return ( + + + + ); }, + ], + parameters: { + // msw: { + // handlers, + // }, }, }; diff --git a/src/features/checker/Checker.tsx b/src/features/checker/Checker.tsx index a92f98d..3672b27 100644 --- a/src/features/checker/Checker.tsx +++ b/src/features/checker/Checker.tsx @@ -1,14 +1,5 @@ -import { Hex } from "viem"; - -import { CheckerProvider } from "~checker/store"; - -import { CheckerRouter } from "./CheckerRouter"; - -export interface CheckerProps { - address: Hex; - poolId: string; - chainId: number; -} +import { CheckerRouter, CheckerProps } from "./CheckerRouter"; +import { CheckerProvider } from "./store"; export const Checker = (props: CheckerProps) => { return ( diff --git a/src/features/checker/CheckerRouter.tsx b/src/features/checker/CheckerRouter.tsx index cc2e7eb..3480672 100644 --- a/src/features/checker/CheckerRouter.tsx +++ b/src/features/checker/CheckerRouter.tsx @@ -1,36 +1,52 @@ import { match, P } from "ts-pattern"; import { Hex } from "viem"; +import { Step } from "@/components/ProgressModal"; import { useCheckerContext } from "@/features/checker/store/hooks/useCheckerContext"; -import { useInitialize, usePerformEvaluation, usePerformOnChainReview } from "~checker/hooks"; +import { useInitialize } from "~checker/hooks"; import { ApplicationEvaluationOverviewPage, ReviewApplicationsPage, + ReviewBody, SubmitApplicationEvaluationPage, SubmitFinalEvaluationPage, } from "~checker/pages"; +import { EvaluationBody } from "~checker/services/checker/api"; import { CheckerRoute } from "~checker/store"; -export interface CheckerRouterProps { +export interface CheckerProps { address: Hex; poolId: string; chainId: number; + setEvaluationBody: (body: EvaluationBody) => void; + isSigning: boolean; + isSuccess: boolean; + isEvaluating: boolean; + isError: boolean; + isErrorSigning: boolean; + steps: Step[]; + setReviewBody: (reviewBody: ReviewBody | null) => void; + isReviewing: boolean; } -export const CheckerRouter = ({ address, poolId, chainId }: CheckerRouterProps) => { +export const CheckerRouter = ({ + address, + poolId, + chainId, + setEvaluationBody, + isSigning, + isSuccess, + isEvaluating, + isError, + isErrorSigning, + steps, + setReviewBody, + isReviewing, +}: CheckerProps) => { useInitialize({ address, poolId, chainId }); - const { setEvaluationBody, isSigning, isSuccess, isEvaluating, isError, isErrorSigning } = - usePerformEvaluation(); - const { route } = useCheckerContext(); - const { - steps, - setReviewBody, - isSuccess: isReviewSuccess, - isError: isReviewError, - isReviewing, - } = usePerformOnChainReview(); + const { route } = useCheckerContext(); return match(route) .with({ id: CheckerRoute.ReviewApplications }, () => ) diff --git a/src/features/checker/hooks/useApplication.ts b/src/features/checker/hooks/useApplication.ts index b3a1b8d..0ebdedb 100644 --- a/src/features/checker/hooks/useApplication.ts +++ b/src/features/checker/hooks/useApplication.ts @@ -20,7 +20,7 @@ export const useApplicationEvaluations = ( ); const data = { application, - applicationEvaluations, + applicationEvaluations: applicationEvaluations, }; return data; }, diff --git a/src/features/checker/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.tsx b/src/features/checker/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.tsx index b26270b..fbed8ef 100644 --- a/src/features/checker/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.tsx +++ b/src/features/checker/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.tsx @@ -1,6 +1,5 @@ import { Hex } from "viem"; -import { PoolType } from "@/components/Badges"; import { PoolSummary } from "@/components/pool/components/PoolSummary/PoolSummary"; import { ProjectBanner } from "@/components/project/components/ProjectBanner/ProjectBanner"; import { Button } from "@/primitives/Button"; @@ -33,7 +32,7 @@ export const ApplicationEvaluationOverviewPage = ({ const { application, applicationEvaluations } = useApplicationOverviewEvaluations({ applicationId }) || {}; - if (!application || !applicationEvaluations) return null; + if (!application) return null; const dispatch = useCheckerDispatchContext(); @@ -80,7 +79,7 @@ export const ApplicationEvaluationOverviewPage = ({

- +