Skip to content

Commit

Permalink
fix: wrong skeleton imports
Browse files Browse the repository at this point in the history
  • Loading branch information
hussedev committed Dec 1, 2024
1 parent 32194be commit e70ef89
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 113 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { UseQueryResult } from "@tanstack/react-query";
import { match, P } from "ts-pattern";

import { Avatar, BannerImage } from "@/primitives";
import { Avatar, BannerImage, Skeleton } from "@/primitives";
import { Card, CardContent } from "@/ui-shadcn/card";

import { ProjectData } from "../../types";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,55 @@ import {
useCheckerDispatchContext,
} from "~checker/store";

const canSubmitFinalEvaluation = true;
interface ApplicationSectionProps {
title: string;
projects: any[];
emptyMessage: string;
action: (projectId: string) => void;
actionLabel?: string;
keepAction?: boolean;
reviewer: string;
headerAction?: React.ReactNode;
}

const ApplicationSection = ({
title,
projects,
emptyMessage,
action,
actionLabel,
keepAction,
reviewer,
headerAction,
}: ApplicationSectionProps) => (
<div className="flex flex-col gap-2">
<div className="pb-1">
<div className="flex items-center justify-between pb-1">
<div className="font-mono text-2xl font-medium leading-loose text-black">
{`${title} (${projects.length})`}
</div>
{headerAction}
</div>
<div className="h-px bg-grey-300" />
</div>

<div>
{projects.length === 0 ? (
<div className="font-mono text-base font-normal leading-7 text-grey-900">
{emptyMessage}
</div>
) : (
<ProjectReviewList
reviewer={reviewer}

Check failure on line 53 in src/features/checker/pages/ReviewApplicationsPage/ReviewApplicationsPage.tsx

View workflow job for this annotation

GitHub Actions / test

Type 'string' is not assignable to type '`0x${string}`'.

Check failure on line 53 in src/features/checker/pages/ReviewApplicationsPage/ReviewApplicationsPage.tsx

View workflow job for this annotation

GitHub Actions / Run Chromatic

Type 'string' is not assignable to type '`0x${string}`'.
projects={projects}
action={action}
actionLabel={actionLabel}
keepAction={keepAction}
/>
)}
</div>
</div>
);

export const ReviewApplicationsPage = () => {
const { categorizedReviews, statCardsProps, application } = useGetApplicationsReviewPage() || {};
Expand All @@ -35,15 +83,48 @@ export const ReviewApplicationsPage = () => {
const openApplicationOnManager = (projectId: string) => {
dispatch(goToSubmitApplicationEvaluationAction({ projectId }));
};
const ReadyApplicationsToSubmit = categorizedReviews?.READY_TO_REVIEW || [];

const PendingApplications = categorizedReviews?.INREVIEW || [];

const ApprovedApplications = categorizedReviews?.APPROVED || [];
const RejectedApplications = categorizedReviews?.REJECTED || [];
const sections = [
{
title: "Ready to submit",
projects: categorizedReviews?.READY_TO_REVIEW || [],
emptyMessage:
"Evaluations that are ready to be submitted onchain will appear here once reviewed. Manager supports multiple reviewers.",
action: goToApplicationEvaluationOverview,
headerAction: (
<Button
value="Submit final evaluation"
disabled={!canSubmitFinalEvaluation}

Check failure on line 97 in src/features/checker/pages/ReviewApplicationsPage/ReviewApplicationsPage.tsx

View workflow job for this annotation

GitHub Actions / test

Cannot find name 'canSubmitFinalEvaluation'. Did you mean 'goToSubmitFinalEvaluation'?

Check failure on line 97 in src/features/checker/pages/ReviewApplicationsPage/ReviewApplicationsPage.tsx

View workflow job for this annotation

GitHub Actions / Run Chromatic

Cannot find name 'canSubmitFinalEvaluation'. Did you mean 'goToSubmitFinalEvaluation'?
onClick={goToSubmitFinalEvaluation}
/>
),
},
{
title: "In Review",
projects: categorizedReviews?.INREVIEW || [],
emptyMessage: "No applications are currently in review.",
action: goToApplicationEvaluationOverview,
},
{
title: "Approved applications",
projects: categorizedReviews?.APPROVED || [],
emptyMessage: "No approved applications.",
action: openApplicationOnManager,
actionLabel: "View project",
keepAction: true,
},
{
title: "Rejected applications",
projects: categorizedReviews?.REJECTED || [],
emptyMessage: "No rejected applications.",
action: openApplicationOnManager,
actionLabel: "View project",
keepAction: true,
},
];

return (
<div className="flex flex-col gap-6 ">
<div className="flex flex-col gap-6">
<PoolSummary
chainId={chainId}
poolId={poolId}
Expand Down Expand Up @@ -73,112 +154,10 @@ export const ReviewApplicationsPage = () => {
Evaluate projects here.
</div>
</div>
<div className="flex flex-col gap-2">
<div className="pb-1">
<div className="flex items-center justify-between pb-1">
<div className="font-mono text-2xl font-medium leading-loose text-black">
{`Ready to submit (${ReadyApplicationsToSubmit.length})`}
</div>
<Button
value="Submit final evaluation"
disabled={!canSubmitFinalEvaluation}
onClick={goToSubmitFinalEvaluation}
/>
</div>
<div className="h-px bg-grey-300" />
</div>

<div>
{ReadyApplicationsToSubmit.length === 0 ? (
<div className="font-mono text-base font-normal leading-7 text-grey-900">
Evaluations that are ready to be submitted onchain will appear here once reviewed.
Manager supports multiple reviewers.
</div>
) : (
<ProjectReviewList
reviewer={address}
projects={ReadyApplicationsToSubmit}
action={goToApplicationEvaluationOverview}
/>
)}
</div>
</div>
<div className="flex flex-col gap-2">
<div className="pb-1">
<div className="flex items-center justify-start pb-1">
<div className="font-mono text-2xl font-medium leading-loose text-black">
{`In Review (${PendingApplications.length})`}
</div>
</div>
<div className="h-px bg-[#c8cccc]" />
</div>

<div>
{PendingApplications.length === 0 ? (
<div className="font-mono text-base font-normal leading-7 text-grey-900">
No applications are currently in review.
</div>
) : (
<ProjectReviewList
reviewer={address}
projects={PendingApplications}
action={goToApplicationEvaluationOverview}
/>
)}
</div>
</div>
<div className="flex flex-col gap-2">
<div className="pb-1">
<div className="flex items-center justify-start pb-1">
<div className="font-mono text-2xl font-medium leading-loose text-black">
{`Approved applications (${ApprovedApplications.length})`}
</div>
</div>
<div className="h-px bg-[#c8cccc]" />
</div>

<div>
{ApprovedApplications.length === 0 ? (
<div className="font-mono text-base font-normal leading-7 text-grey-900">
No approved applications.
</div>
) : (
<ProjectReviewList
reviewer={address}
projects={ApprovedApplications}
action={openApplicationOnManager}
actionLabel="View project"
keepAction
/>
)}
</div>
</div>
<div className="flex flex-col gap-2">
<div className="pb-1">
<div className="flex items-center justify-start pb-1">
<div className="font-mono text-2xl font-medium leading-loose text-black">
{`Rejected applications (${RejectedApplications.length})`}
</div>
</div>
<div className="h-px bg-[#c8cccc]" />
</div>

<div>
{RejectedApplications.length === 0 ? (
<div className="font-mono text-base font-normal leading-7 text-grey-900">
No rejected applications.
</div>
) : (
<ProjectReviewList
reviewer={address}
projects={RejectedApplications}
action={openApplicationOnManager}
actionLabel="View project"
keepAction
/>
)}
</div>
</div>
{sections.map((section) => (
<ApplicationSection key={section.title} {...section} reviewer={address} />

Check failure on line 159 in src/features/checker/pages/ReviewApplicationsPage/ReviewApplicationsPage.tsx

View workflow job for this annotation

GitHub Actions / test

Type '`0x${string}` | undefined' is not assignable to type 'string'.

Check failure on line 159 in src/features/checker/pages/ReviewApplicationsPage/ReviewApplicationsPage.tsx

View workflow job for this annotation

GitHub Actions / Run Chromatic

Type '`0x${string}` | undefined' is not assignable to type 'string'.
))}
</div>
</div>
</div>
Expand Down

0 comments on commit e70ef89

Please sign in to comment.