Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

fix: export separatedly components with document error #112

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 0 additions & 92 deletions colors.md

This file was deleted.

174 changes: 174 additions & 0 deletions notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
## useApplicationEvaluations.ts

```typescript
type UseApplicationEvaluations = (
chainId: number,
roundId: string,
applicationId: string,
) => {
data: {
application: ProjectApplication;
applicationEvaluations: Evaluation[];
};
isLoading: boolean;
isError: boolean;
error: Error;
};
```

- useQuery -> ["viewApplicationEvaluationsPage", chainId, roundId, applicationId]
- getApplicationByIdFromIndexer -> services/allo
- getCheckerApplicationEvaluations -> services/checker

---

## useApplicationOverviewEvaluations.ts

```typescript
type UseApplicationOverviewEvaluations = ({ applicationId }: { applicationId: string }) => {
application: CheckerApplication;
applicationEvaluations: Evaluation[];
evaluationQuestions: CheckerApiEvaluationQuestion[];
poolData: CheckerPoolData;
};
```

- gets poolId, chainId, poolsData from useCheckerContext
- generates poolUUID
- gets poolData from poolsData
- gets application from poolData
- gets applicationEvaluations from application
- gets evaluationQuestions from poolData

---

## useGetApplicationsFinalEvaluationPage.ts

```typescript
type UseGetApplicationsFinalEvaluationPage = () => {
categorizedReviews: Record<
"INREVIEW" | "READY_TO_REVIEW" | "APPROVED" | "REJECTED",
ProjectReview[]
>;
statCardsProps: StatCardProps[];
reviewBody: ReviewBody;
poolData: CheckerPoolData;
};
```

- gets poolId, chainId, poolsData from useCheckerContext
- generates poolUUID
- gets poolData from poolsData
- gets categorizedReviews and statCardsProps from poolData.applications -> categorizeProjectReviews()
- generates reviewBody with poolData

## useGetApplicationsReviewPage.ts

```typescript
type UseGetApplicationsReviewPage = () => {
categorizedReviews: Record<
"INREVIEW" | "READY_TO_REVIEW" | "APPROVED" | "REJECTED",
ProjectReview[]
>;
statCardsProps: StatCardProps[];
poolData: CheckerPoolData;
};
```

- gets poolId, chainId, poolsData from useCheckerContext
- generates poolUUID
- gets poolData from poolsData
- gets categorizedReviews and statCardsProps from poolData.applications -> categorizeProjectReviews()

---

## useGetPastApplications.ts

```typescript
type UseGetPastApplications = (
chainId: number,
roundId: string,
applicationId: string,
) => {
data: PastApplication[];
isLoading: boolean;
isError: boolean;
error: Error;
};
```

- useQuery -> ["getPastApplications", chainId, roundId, applicationId]
- getPastApplicationsByApplicationIdFromIndexer -> services/allo

---

## useInitialize.ts

```typescript
type UseInitialize = ({ address, poolId, chainId }: InitData) => void;
```

- sets initialState with setInitialStateAction
- usePoolData -> fetchPoolData and stores it in the context

---

## usePoolData.ts

```typescript
type UsePoolData = () => {
poolData: CheckerPoolData;
refetch: () => void;
};
```

- useQuery -> ["poolData", chainId, poolId, address]
- syncPool -> services/checker
- getApplicationsFromIndexer -> services/allo
- getCheckerPoolData -> services/checker
- generates poolUUID
- parses applications from indexer and checker api to applications object and stores it in the context

---

## usePerformEvaluation.ts

```typescript
type UsePerformEvaluation = () => {
setEvaluationBody: (evaluationBody: EvaluationBody) => void;
isEvaluating: boolean;
isError: boolean;
isSuccess: boolean;
};
```

- has a state to store the evaluationBody
- has a mutation to sign the evaluation
- has a mutation to submit the evaluation
- triggers the signing mutation when evaluationBody is set and submits the evaluation, resetting the evaluationBody.
NOTE: wouldn't it be better to have a single mutation that handles both signing and submitting?
Do we need to have a state to store the evaluationBody?

---

## usePerformOnChainReview.ts

```typescript
type UsePerformOnChainReview = () => {
setReviewBody: (reviewBody: ReviewBody) => void;
steps: Step[];
isReviewing: boolean;
isError: boolean;
isSuccess: boolean;
error: Error;
};
```

- has a state to store the reviewBody
- has states to store the progress of the review steps, contractUpdatingStatus, indexingStatus, finishingStatus
- has a mutation to submit the review
- triggers the mutation when reviewBody is set
- resets the review steps when the mutation is successful
- resets the reviewBody when the mutation is successful

NOTE: do we need to have a state to store the reviewBody?, do we need to have a state to store the review steps independently instead of combining them?
25 changes: 25 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,31 @@
"types": "./dist/retrofunding.d.ts",
"import": "./dist/retrofunding.js",
"require": "./dist/retrofunding.js"
},
"./form": {
"types": "./dist/form.d.ts",
"import": "./dist/form.js",
"require": "./dist/form.js"
},
"./setup-progress-form": {
"types": "./dist/setupProgressForm.d.ts",
"import": "./dist/setupProgressForm.js",
"require": "./dist/setupProgressForm.js"
},
"./accordion": {
"types": "./dist/accordion.d.ts",
"import": "./dist/accordion.js",
"require": "./dist/accordion.js"
},
"./markdown-editor": {
"types": "./dist/markdownEditor.d.ts",
"import": "./dist/markdownEditor.js",
"require": "./dist/markdownEditor.js"
},
"./markdown": {
"types": "./dist/markdown.d.ts",
"import": "./dist/markdown.js",
"require": "./dist/markdown.js"
}
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { CartesianGrid, Line, YAxis, LineChart } from "recharts";

export const AllocationChart = ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { PropsWithChildren } from "react";

import { cn } from "@/lib/utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { ArrowDownNarrowWide } from "lucide-react";
import { ArrowUpWideNarrow } from "lucide-react";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { cn } from "@/lib/utils";
import { Skeleton } from "@/primitives/Skeleton";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// src/components/Form/FormAllowlistController.tsx
"use client";

import React, { useRef } from "react";
import { useFormContext, Controller } from "react-hook-form";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// src/components/Form/ApplicationQuestionsController.tsx
"use client";

import React from "react";
import { useEffect } from "react";
import { useFieldArray, useFormContext, Controller } from "react-hook-form";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// src/components/Form/DisabledInputController.tsx
"use client";

import React from "react";
import { Controller, useFormContext } from "react-hook-form";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// src/components/Form/FieldArrayController.tsx
"use client";

import React from "react";
import { useFieldArray, useFormContext, Controller } from "react-hook-form";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import React from "react";
import { Controller, useFormContext } from "react-hook-form";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// src/components/Form/MarkdownEditorController.tsx
"use client";

import React from "react";
import { Controller, useFormContext } from "react-hook-form";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import * as React from "react";
import { Controller, useFormContext } from "react-hook-form";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import * as React from "react";
import { useFormContext, Controller } from "react-hook-form";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import * as React from "react";

import moment from "moment-timezone";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { CheckCircle2Icon } from "lucide-react";

import { Label } from "@/ui-shadcn/label";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import React from "react";
import { Controller, useFormContext } from "react-hook-form";

Expand Down
1 change: 0 additions & 1 deletion src/components/Form/utils/buildSchemaFromFields.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// File: utils/buildSchemaFromFields.ts
import { z } from "zod";

import { FormField } from "../types/fieldTypes";
Expand Down
Loading
Loading