Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKurt committed Dec 2, 2024
1 parent 05554e0 commit e06e714
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)) ? (
<ReviewsCounterLabel negativeReviews={0} positiveReviews={0} />
) : (
<IconLabel type="ai-evaluation" percent={item.aiSuggestion} />
) : (
<ReviewsCounterLabel negativeReviews={0} positiveReviews={0} />
);
},
},
Expand Down
5 changes: 3 additions & 2 deletions src/features/checker/components/ProjectReviewList/mocks.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { addressFrom } from "@/lib";
import { ProjectReview } from "../../types";

export const mockPendingReview0: ProjectReview[] = [
Expand Down Expand Up @@ -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,
},
{
Expand Down
3 changes: 2 additions & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -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[]) {
Expand Down Expand Up @@ -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}`;
};

0 comments on commit e06e714

Please sign in to comment.