From e06e714e049265ce473be0bacbea4f02b6adc434 Mon Sep 17 00:00:00 2001 From: 0xKurt Date: Mon, 2 Dec 2024 15:20:25 +0100 Subject: [PATCH] fix --- .../components/ProjectReviewList/ProjectReviewList.tsx | 4 ++-- src/features/checker/components/ProjectReviewList/mocks.tsx | 5 +++-- src/lib/utils.ts | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/features/checker/components/ProjectReviewList/ProjectReviewList.tsx b/src/features/checker/components/ProjectReviewList/ProjectReviewList.tsx index f856053..fb23021 100644 --- a/src/features/checker/components/ProjectReviewList/ProjectReviewList.tsx +++ b/src/features/checker/components/ProjectReviewList/ProjectReviewList.tsx @@ -68,9 +68,9 @@ export const ProjectReviewList = ({ width: "0.9fr", render: (item) => { // addressFrom(1) === ai evaluator return item.reviews.some(review => review.reviewer === addressFrom(1)) ? ( - - ) : ( + ) : ( + ); }, }, diff --git a/src/features/checker/components/ProjectReviewList/mocks.tsx b/src/features/checker/components/ProjectReviewList/mocks.tsx index f3bc227..d81d9ca 100644 --- a/src/features/checker/components/ProjectReviewList/mocks.tsx +++ b/src/features/checker/components/ProjectReviewList/mocks.tsx @@ -1,3 +1,4 @@ +import { addressFrom } from "@/lib"; import { ProjectReview } from "../../types"; export const mockPendingReview0: ProjectReview[] = [ @@ -37,11 +38,11 @@ export const mockReadyToSubmit0: ProjectReview[] = [ date: new Date(2024, 5, 3, 15, 0, 0), avatarUrl: "", reviews: [ - { approved: true, reviewer: "0xJohnDoe" }, + { approved: true, reviewer: addressFrom(1) }, { approved: false, reviewer: "0xJaneDoe" }, { approved: true, reviewer: "0xJoneDoe" }, ], - aiSuggestion: 72, + aiSuggestion: 0, scoreAverage: 88, }, { diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 48f3aae..9ea856d 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -1,6 +1,7 @@ import { clsx, type ClassValue } from "clsx"; import { twMerge } from "tailwind-merge"; import { match, P } from "ts-pattern"; +import { Hex } from "viem"; export function cn(...inputs: ClassValue[]) { @@ -56,7 +57,7 @@ export function capitalizeWord(word: string): string { return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); } -export const addressFrom = (index: number): string => { +export const addressFrom = (index: number): Hex => { const address = index.toString(16).padStart(40, "0"); return `0x${address}`; }; \ No newline at end of file