diff --git a/src/features/checker/components/ProjectEvaluationList/ProjectEvaluationList.tsx b/src/features/checker/components/ProjectEvaluationList/ProjectEvaluationList.tsx index 2f945ae..e3f2aa9 100644 --- a/src/features/checker/components/ProjectEvaluationList/ProjectEvaluationList.tsx +++ b/src/features/checker/components/ProjectEvaluationList/ProjectEvaluationList.tsx @@ -1,3 +1,4 @@ +import { DefaultLogo } from "@/assets"; import { IconLabel } from "@/components/IconLabel"; import { CircleStat } from "@/primitives/Indicators"; import { ListGrid, ListGridColumn } from "@/primitives/ListGrid"; @@ -31,7 +32,7 @@ export const ProjectEvaluationList = ({ alt={item.name} className="aspect-square size-12 rounded-sm" onError={(event: React.SyntheticEvent) => { - event.currentTarget.src = "/images/grey-image.png"; + event.currentTarget.src = DefaultLogo; }} /> {item.name} diff --git a/src/features/checker/components/ProjectReviewList/ProjectReviewList.tsx b/src/features/checker/components/ProjectReviewList/ProjectReviewList.tsx index cd6b56c..4ef671d 100644 --- a/src/features/checker/components/ProjectReviewList/ProjectReviewList.tsx +++ b/src/features/checker/components/ProjectReviewList/ProjectReviewList.tsx @@ -1,3 +1,4 @@ +import { DefaultLogo } from "@/assets"; import { IconLabel } from "@/components/IconLabel"; import { Button } from "@/primitives/Button"; import { CircleStat } from "@/primitives/Indicators"; @@ -27,7 +28,7 @@ export const ProjectReviewList = ({ reviewer, projects, action }: ProjectReviewL alt={item.name} className="aspect-square size-12 rounded-sm" onError={(event: React.SyntheticEvent) => { - event.currentTarget.src = "/images/grey-image.png"; + event.currentTarget.src = DefaultLogo; }} /> {item.name} diff --git a/src/features/checker/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.tsx b/src/features/checker/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.tsx index 2df4dbe..e9d75c5 100644 --- a/src/features/checker/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.tsx +++ b/src/features/checker/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.tsx @@ -76,7 +76,13 @@ export const ApplicationEvaluationOverviewPage = ({

- + {applicationEvaluations ? ( + + ) : ( +

+ No evaluations have been submitted for this project yet. +

+ )}
-
-
-
- Review applications -
-
- Evaluate projects here. -
+
+
+
+ + +
+
+
+ Review applications +
+
+ Evaluate projects here.
-
-
-
-
- {`Ready to submit (${ReadyApplicationsToSubmit.length})`} -
-
-
+
+
+
+
+
+ {`Ready to submit (${ReadyApplicationsToSubmit.length})`}
-
-
- -
- {ReadyApplicationsToSubmit.length === 0 ? ( -
- Evaluations that are ready to be submitted onchain will appear here once - reviewed. Manager supports multiple reviewers. -
- ) : ( - +
+
+
+ +
+ {ReadyApplicationsToSubmit.length === 0 ? ( +
+ Evaluations that are ready to be submitted onchain will appear here once reviewed. + Manager supports multiple reviewers. +
+ ) : ( + + )}
diff --git a/src/primitives/Avatar/Avatar.tsx b/src/primitives/Avatar/Avatar.tsx index 995d02d..feef152 100644 --- a/src/primitives/Avatar/Avatar.tsx +++ b/src/primitives/Avatar/Avatar.tsx @@ -40,12 +40,16 @@ export const Avatar = ({ variant = "default", // Default to default variant }: AvatarProps) => { const imageURL = useMemo(() => { - return match({ ipfsCID, url, fallbackName }) - .with({ ipfsCID: P.nullish, url: P.nullish, fallbackName: P.nullish }, () => defaultImage) - .with({ ipfsCID, url: P.string.length(0) }, ({ ipfsCID }) => `${ipfsBaseURL}${ipfsCID}`) - .with({ ipfsCID, url: P.nullish }, ({ ipfsCID }) => `${ipfsBaseURL}${ipfsCID}`) - .with({ ipfsCID: P.string.length(0), url }, ({ url }) => url) - .with({ ipfsCID: P.nullish, url }, ({ url }) => url) + return match({ ipfsCID, url }) + .with( + { ipfsCID: P.when((cid) => !cid || typeof cid !== "string"), url: P.nullish }, + () => defaultImage, + ) + .with({ ipfsCID: P.when((cid) => !cid || typeof cid !== "string"), url }, ({ url }) => url) + .with( + { ipfsCID: P.when((cid) => typeof cid === "string" && cid.length > 0), url: P.nullish }, + ({ ipfsCID }) => `${ipfsBaseURL}${ipfsCID}`, + ) .with( { ipfsCID: P.string.minLength(1), url: P.string.minLength(1) }, ({ ipfsCID }) => `${ipfsBaseURL}${ipfsCID}`, diff --git a/src/primitives/BannerImage/BannerImage.tsx b/src/primitives/BannerImage/BannerImage.tsx index 8d514d3..7c6216a 100644 --- a/src/primitives/BannerImage/BannerImage.tsx +++ b/src/primitives/BannerImage/BannerImage.tsx @@ -41,11 +41,15 @@ export const BannerImage = ({ }: BannerImageProps) => { const imageURL = useMemo(() => { return match({ ipfsCID, url }) - .with({ ipfsCID: P.nullish, url: P.nullish }, () => defaultImage) - .with({ ipfsCID, url: P.string.length(0) }, ({ ipfsCID }) => `${ipfsBaseURL}${ipfsCID}`) - .with({ ipfsCID, url: P.nullish }, ({ ipfsCID }) => `${ipfsBaseURL}${ipfsCID}`) - .with({ ipfsCID: P.string.length(0), url }, ({ url }) => url) - .with({ ipfsCID: P.nullish, url }, ({ url }) => url) + .with( + { ipfsCID: P.when((cid) => !cid || typeof cid !== "string"), url: P.nullish }, + () => defaultImage, + ) + .with({ ipfsCID: P.when((cid) => !cid || typeof cid !== "string"), url }, ({ url }) => url) + .with( + { ipfsCID: P.when((cid) => typeof cid === "string" && cid.length > 0), url: P.nullish }, + ({ ipfsCID }) => `${ipfsBaseURL}${ipfsCID}`, + ) .with( { ipfsCID: P.string.minLength(1), url: P.string.minLength(1) }, ({ ipfsCID }) => `${ipfsBaseURL}${ipfsCID}`,