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

Commit 6d0d989

Browse files
authored
feat: checker main component boilerplate (#40)
* chore: implemented initial checker provider * chore: removed example OverviewPage * chore: added getApplicationsForManager query * chore: updated main index file * chore: implemented useApplications hook * chore: updated prettier imports order * chore: updated initial state and implemented action functions * chore: implemented Checker pages boilerplate with router
1 parent 5e3cba1 commit 6d0d989

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+693
-46
lines changed

.prettierrc

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"^@vite(.*)?$",
1616
"<THIRD_PARTY_MODULES>",
1717
"^@/(.*)$",
18+
"^~(.*)$",
1819
"^[./]"
1920
],
2021
"importOrderSeparation": true

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
"tailwind-variants": "^0.2.1",
147147
"ts-pattern": "^5.5.0",
148148
"vaul": "^1.1.0",
149+
"viem": "^2.21.48",
149150
"vite-plugin-svgr": "^4.2.0",
150151
"zod": "^3.23.8"
151152
}

pnpm-lock.yaml

+125
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { useCheckerContext } from "./useCheckerContext";
2+
3+
export const useApplications = () => {
4+
const { applications } = useCheckerContext();
5+
return applications;
6+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { useContext } from "react";
2+
3+
import { CheckerContext } from "~checker/store/CheckerContext";
4+
5+
export const useCheckerContext = () => {
6+
const checkerContext = useContext(CheckerContext);
7+
if (!checkerContext) {
8+
throw new Error("useCheckerContext must be used within a CheckerContextProvider");
9+
}
10+
return checkerContext;
11+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { useContext } from "react";
2+
3+
import { CheckerDispatchContext } from "~checker/store/CheckerContext";
4+
5+
export const useCheckerDispatchContext = () => {
6+
const checkerDispatchContext = useContext(CheckerDispatchContext);
7+
if (!checkerDispatchContext) {
8+
throw new Error(
9+
"useCheckerDispatchContext must be used within a CheckerDispatchContextProvider",
10+
);
11+
}
12+
return checkerDispatchContext;
13+
};

src/features/checker/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./pages/Checker";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export interface ApplicationEvaluationProps {
2+
projectId: string;
3+
}
4+
5+
export const ApplicationEvaluation = ({ projectId }: ApplicationEvaluationProps) => {
6+
return (
7+
<div className="flex flex-col gap-8">
8+
<div className="flex flex-col gap-[12px]">
9+
<div className="font-mono text-2xl font-medium leading-loose text-black">
10+
Application Evaluation
11+
</div>
12+
<div className="font-mono text-base font-normal leading-7 text-[#555555]">
13+
{`Evaluate ${projectId} here.`}
14+
</div>
15+
</div>
16+
</div>
17+
);
18+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./ApplicationEvaluation";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export interface ApplicationEvaluationOverviewProps {
2+
projectId: string;
3+
}
4+
5+
export const ApplicationEvaluationOverview = ({
6+
projectId,
7+
}: ApplicationEvaluationOverviewProps) => {
8+
return (
9+
<div className="flex flex-col gap-8">
10+
<div className="flex flex-col gap-[12px]">
11+
<div className="font-mono text-2xl font-medium leading-loose text-black">
12+
Application Evaluation Overview
13+
</div>
14+
<div className="font-mono text-base font-normal leading-7 text-[#555555]">
15+
{`Previous evaluations for ${projectId} here.`}
16+
</div>
17+
</div>
18+
</div>
19+
);
20+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./ApplicationEvaluationOverview";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { Meta, StoryObj } from "@storybook/react";
2+
3+
import { Checker } from "./Checker";
4+
5+
const meta = {
6+
title: "Features/Checker/Pages/Checker",
7+
component: Checker,
8+
args: {
9+
address: "0x1234567890123456789012345678901234567890",
10+
roundId: "609",
11+
chainId: 42161,
12+
},
13+
} satisfies Meta;
14+
15+
export default meta;
16+
17+
type Story = StoryObj<typeof Checker>;
18+
19+
export const Default: Story = {};

0 commit comments

Comments
 (0)